From 836dfebf723afc264868da69021c89221d02aa18 Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Thu, 10 Apr 2014 19:38:52 +0200 Subject: build http basic auth rather than requiring it from the user to write the correct auth string into the config --- utility/config.php | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) (limited to 'utility') 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); -- cgit v1.2.3