diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-04-10 19:38:52 +0200 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-04-10 19:38:52 +0200 |
commit | 836dfebf723afc264868da69021c89221d02aa18 (patch) | |
tree | ae5274151345a13f65488bb6562fe1db0da41244 /utility | |
parent | 5befce51ef9f38609b713cfbc6095a3b60b1d574 (diff) |
build http basic auth rather than requiring it from the user to write the correct auth string into the config
Diffstat (limited to 'utility')
-rw-r--r-- | utility/config.php | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/utility/config.php b/utility/config.php index 0fa636ea8..d415595b7 100644 --- a/utility/config.php +++ b/utility/config.php @@ -41,7 +41,8 @@ class Config { private $useCronUpdates; // turn off updates run by owncloud cronjob private $proxyHost; private $proxyPort; - private $proxyAuth; + private $proxyUser; + private $proxyPassword; private $api; @@ -55,7 +56,8 @@ class Config { $this->api = $api; $this->proxyHost = ''; $this->proxyPort = 8080; - $this->proxyAuth = ''; + $this->proxyUser = ''; + $this->proxyPassword = ''; } public function getProxyPort() { @@ -67,7 +69,19 @@ class Config { } public function getProxyAuth() { - return $this->proxyAuth; + if($this->proxyUser === '') { + return null; + } else { + return $this->proxyUser . ':' . $this->proxyPassword; + } + } + + public function getProxyUser() { + return $this->proxyUser; + } + + public function getProxyPassword() { + return $this->proxyPassword; } public function getAutoPurgeMinimumInterval() { @@ -128,8 +142,12 @@ class Config { $this->proxyHost = $value; } - public function setProxyAuth($value) { - $this->proxyAuth = $value; + public function setProxyUser($value) { + $this->proxyUser = $value; + } + + public function setProxyPassword($value) { + $this->proxyPassword = $value; } @@ -172,7 +190,8 @@ class Config { "useCronUpdates = " . var_export($this->useCronUpdates, true) . "\n" . "proxyHost = " . $this->proxyHost . "\n" . "proxyPort = " . $this->proxyPort . "\n" . - "proxyAuth = " . $this->proxyAuth; + "proxyUser = " . $this->proxyUser . "\n" . + "proxyPassword = " . $this->proxyPassword; ; $this->fileSystem->file_put_contents($configPath, $ini); |