diff options
Diffstat (limited to 'apps/user_ldap/lib')
-rw-r--r-- | apps/user_ldap/lib/Command/Search.php | 2 | ||||
-rw-r--r-- | apps/user_ldap/lib/Command/SetConfig.php | 2 | ||||
-rw-r--r-- | apps/user_ldap/lib/Command/TestConfig.php | 2 | ||||
-rw-r--r-- | apps/user_ldap/lib/Connection.php | 2 | ||||
-rw-r--r-- | apps/user_ldap/lib/Helper.php | 16 | ||||
-rw-r--r-- | apps/user_ldap/lib/Jobs/CleanUp.php | 2 | ||||
-rw-r--r-- | apps/user_ldap/lib/Jobs/UpdateGroups.php | 2 | ||||
-rw-r--r-- | apps/user_ldap/lib/LDAPProviderFactory.php | 2 | ||||
-rw-r--r-- | apps/user_ldap/lib/Proxy.php | 2 | ||||
-rw-r--r-- | apps/user_ldap/lib/Settings/Admin.php | 2 | ||||
-rw-r--r-- | apps/user_ldap/lib/Wizard.php | 2 |
11 files changed, 25 insertions, 11 deletions
diff --git a/apps/user_ldap/lib/Command/Search.php b/apps/user_ldap/lib/Command/Search.php index e1db3f47448..17e506855b2 100644 --- a/apps/user_ldap/lib/Command/Search.php +++ b/apps/user_ldap/lib/Command/Search.php @@ -102,7 +102,7 @@ class Search extends Command { } protected function execute(InputInterface $input, OutputInterface $output) { - $helper = new Helper(); + $helper = new Helper($this->ocConfig); $configPrefixes = $helper->getServerConfigurationPrefixes(true); $ldapWrapper = new LDAP(); diff --git a/apps/user_ldap/lib/Command/SetConfig.php b/apps/user_ldap/lib/Command/SetConfig.php index a1d5e90f3ed..5188bee1049 100644 --- a/apps/user_ldap/lib/Command/SetConfig.php +++ b/apps/user_ldap/lib/Command/SetConfig.php @@ -57,7 +57,7 @@ class SetConfig extends Command { } protected function execute(InputInterface $input, OutputInterface $output) { - $helper = new Helper(); + $helper = new Helper(\OC::$server->getConfig()); $availableConfigs = $helper->getServerConfigurationPrefixes(); $configID = $input->getArgument('configID'); if(!in_array($configID, $availableConfigs)) { diff --git a/apps/user_ldap/lib/Command/TestConfig.php b/apps/user_ldap/lib/Command/TestConfig.php index 55a834812aa..cd3ecc26d2b 100644 --- a/apps/user_ldap/lib/Command/TestConfig.php +++ b/apps/user_ldap/lib/Command/TestConfig.php @@ -47,7 +47,7 @@ class TestConfig extends Command { } protected function execute(InputInterface $input, OutputInterface $output) { - $helper = new Helper(); + $helper = new Helper(\OC::$server->getConfig()); $availableConfigs = $helper->getServerConfigurationPrefixes(); $configID = $input->getArgument('configID'); if(!in_array($configID, $availableConfigs)) { diff --git a/apps/user_ldap/lib/Connection.php b/apps/user_ldap/lib/Connection.php index 07a595f0529..64c8b9675a3 100644 --- a/apps/user_ldap/lib/Connection.php +++ b/apps/user_ldap/lib/Connection.php @@ -87,7 +87,7 @@ class Connection extends LDAPUtility { if($memcache->isAvailable()) { $this->cache = $memcache->create(); } - $helper = new Helper(); + $helper = new Helper(\OC::$server->getConfig()); $this->doNotValidate = !in_array($this->configPrefix, $helper->getServerConfigurationPrefixes()); $this->hasPagedResultSupport = diff --git a/apps/user_ldap/lib/Helper.php b/apps/user_ldap/lib/Helper.php index 1955e7b0eea..933aee382df 100644 --- a/apps/user_ldap/lib/Helper.php +++ b/apps/user_ldap/lib/Helper.php @@ -30,8 +30,22 @@ namespace OCA\User_LDAP; +use OCP\IConfig; + class Helper { + /** @var IConfig */ + private $config; + + /** + * Helper constructor. + * + * @param IConfig $config + */ + public function __construct(IConfig $config) { + $this->config = $config; + } + /** * returns prefixes for each saved LDAP/AD server configuration. * @param bool $activeConfigurations optional, whether only active configuration shall be @@ -251,7 +265,7 @@ class Helper { } //ain't it ironic? - $helper = new Helper(); + $helper = new Helper(\OC::$server->getConfig()); $configPrefixes = $helper->getServerConfigurationPrefixes(true); $ldapWrapper = new LDAP(); diff --git a/apps/user_ldap/lib/Jobs/CleanUp.php b/apps/user_ldap/lib/Jobs/CleanUp.php index b91fed14dd6..e69d24dfd06 100644 --- a/apps/user_ldap/lib/Jobs/CleanUp.php +++ b/apps/user_ldap/lib/Jobs/CleanUp.php @@ -83,7 +83,7 @@ class CleanUp extends TimedJob { if(isset($arguments['helper'])) { $this->ldapHelper = $arguments['helper']; } else { - $this->ldapHelper = new Helper(); + $this->ldapHelper = new Helper(\OC::$server->getConfig()); } if(isset($arguments['ocConfig'])) { diff --git a/apps/user_ldap/lib/Jobs/UpdateGroups.php b/apps/user_ldap/lib/Jobs/UpdateGroups.php index 3b951d20c43..b4259425fcc 100644 --- a/apps/user_ldap/lib/Jobs/UpdateGroups.php +++ b/apps/user_ldap/lib/Jobs/UpdateGroups.php @@ -172,7 +172,7 @@ class UpdateGroups extends \OC\BackgroundJob\TimedJob { if(!is_null(self::$groupBE)) { return self::$groupBE; } - $helper = new Helper(); + $helper = new Helper(\OC::$server->getConfig()); $configPrefixes = $helper->getServerConfigurationPrefixes(true); $ldapWrapper = new LDAP(); if(count($configPrefixes) === 1) { diff --git a/apps/user_ldap/lib/LDAPProviderFactory.php b/apps/user_ldap/lib/LDAPProviderFactory.php index 528af001037..f2915b43163 100644 --- a/apps/user_ldap/lib/LDAPProviderFactory.php +++ b/apps/user_ldap/lib/LDAPProviderFactory.php @@ -52,7 +52,7 @@ class LDAPProviderFactory implements ILDAPProviderFactory { public function getLDAPProvider() { $dbConnection = $this->serverContainer->getDatabaseConnection(); $userMapping = new UserMapping($dbConnection); - return new LDAPProvider($this->serverContainer, new Helper(), + return new LDAPProvider($this->serverContainer, new Helper($this->serverContainer->getConfig()), new DeletedUsersIndex($this->serverContainer->getConfig(), $dbConnection, $userMapping)); } diff --git a/apps/user_ldap/lib/Proxy.php b/apps/user_ldap/lib/Proxy.php index db1c761656f..6b896e0b13d 100644 --- a/apps/user_ldap/lib/Proxy.php +++ b/apps/user_ldap/lib/Proxy.php @@ -77,7 +77,7 @@ abstract class Proxy { $userManager = new Manager($ocConfig, $fs, $log, $avatarM, new \OCP\Image(), $db, $coreUserManager); $connector = new Connection($this->ldap, $configPrefix); - $access = new Access($connector, $this->ldap, $userManager, new Helper()); + $access = new Access($connector, $this->ldap, $userManager, new Helper(\OC::$server->getConfig())); $access->setUserMapper($userMap); $access->setGroupMapper($groupMap); self::$accesses[$configPrefix] = $access; diff --git a/apps/user_ldap/lib/Settings/Admin.php b/apps/user_ldap/lib/Settings/Admin.php index ca7db66c788..32035128b64 100644 --- a/apps/user_ldap/lib/Settings/Admin.php +++ b/apps/user_ldap/lib/Settings/Admin.php @@ -45,7 +45,7 @@ class Admin implements ISettings { * @return TemplateResponse */ public function getForm() { - $helper = new Helper(); + $helper = new Helper(\OC::$server->getConfig()); $prefixes = $helper->getServerConfigurationPrefixes(); $hosts = $helper->getServerConfigurationHosts(); diff --git a/apps/user_ldap/lib/Wizard.php b/apps/user_ldap/lib/Wizard.php index 852c806b104..cdc98c72cde 100644 --- a/apps/user_ldap/lib/Wizard.php +++ b/apps/user_ldap/lib/Wizard.php @@ -724,7 +724,7 @@ class Wizard extends LDAPUtility { //this did not help :( //Let's see whether we can parse the Host URL and convert the domain to //a base DN - $helper = new Helper(); + $helper = new Helper(\OC::$server->getConfig()); $domain = $helper->getDomainFromURL($this->configuration->ldapHost); if(!$domain) { return false; |