From a8bb4a18988534323d872b13a9895a2c9557b6c5 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 10 May 2017 09:44:02 +0200 Subject: Use automatic DI injection for UpdateLookupServer Signed-off-by: Joas Schilling --- apps/lookup_server_connector/lib/UpdateLookupServer.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'apps/lookup_server_connector/lib') diff --git a/apps/lookup_server_connector/lib/UpdateLookupServer.php b/apps/lookup_server_connector/lib/UpdateLookupServer.php index 3a7c2fa7236..ae8fcbd67ca 100644 --- a/apps/lookup_server_connector/lib/UpdateLookupServer.php +++ b/apps/lookup_server_connector/lib/UpdateLookupServer.php @@ -27,6 +27,7 @@ use OC\Security\IdentityProof\Signer; use OCA\LookupServerConnector\BackgroundJobs\RetryJob; use OCP\BackgroundJob\IJobList; use OCP\Http\Client\IClientService; +use OCP\IConfig; use OCP\IUser; /** @@ -44,27 +45,26 @@ class UpdateLookupServer { /** @var IJobList */ private $jobList; /** @var string URL point to lookup server */ - private $lookupServer = 'https://lookup.nextcloud.com'; + private $lookupServer; /** * @param AccountManager $accountManager * @param IClientService $clientService * @param Signer $signer * @param IJobList $jobList - * @param string $lookupServer if nothing is given we use the default lookup server + * @param IConfig $config */ public function __construct(AccountManager $accountManager, IClientService $clientService, Signer $signer, IJobList $jobList, - $lookupServer = '') { + IConfig $config) { $this->accountManager = $accountManager; $this->clientService = $clientService; $this->signer = $signer; $this->jobList = $jobList; - if ($lookupServer !== '') { - $this->lookupServer = $lookupServer; - } + + $this->lookupServer = $config->getSystemValue('lookup_server', 'https://lookup.nextcloud.com'); $this->lookupServer = rtrim($this->lookupServer, '/'); $this->lookupServer .= '/users'; } -- cgit v1.2.3