diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2022-10-24 10:11:06 +0200 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2022-10-24 10:11:06 +0200 |
commit | 0f07e437602b7a2d0258a17c9de2c01efb6876c3 (patch) | |
tree | d89c0cf5e81c466180c60e4874a2efc98319d434 /apps/user_ldap | |
parent | 2228a7b37497a7b51c35f55fae494b4e649b5d0f (diff) | |
download | nextcloud-server-0f07e437602b7a2d0258a17c9de2c01efb6876c3.tar.gz nextcloud-server-0f07e437602b7a2d0258a17c9de2c01efb6876c3.zip |
Get rid of calls to OCP\Server which is not available is 24
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/user_ldap')
-rw-r--r-- | apps/user_ldap/ajax/clearMappings.php | 2 | ||||
-rw-r--r-- | apps/user_ldap/lib/Jobs/CleanUp.php | 2 | ||||
-rw-r--r-- | apps/user_ldap/lib/Jobs/Sync.php | 2 | ||||
-rw-r--r-- | apps/user_ldap/lib/Mapping/UserMapping.php | 3 | ||||
-rw-r--r-- | apps/user_ldap/lib/Proxy.php | 17 |
5 files changed, 12 insertions, 14 deletions
diff --git a/apps/user_ldap/ajax/clearMappings.php b/apps/user_ldap/ajax/clearMappings.php index f8469cc85b1..778d325baf6 100644 --- a/apps/user_ldap/ajax/clearMappings.php +++ b/apps/user_ldap/ajax/clearMappings.php @@ -35,7 +35,7 @@ $subject = (string)$_POST['ldap_clear_mapping']; $mapping = null; try { if ($subject === 'user') { - $mapping = \OCP\Server::get(UserMapping::class); + $mapping = \OC::$server->get(UserMapping::class); $result = $mapping->clearCb( function ($uid) { \OC::$server->getUserManager()->emit('\OC\User', 'preUnassignedUserId', [$uid]); diff --git a/apps/user_ldap/lib/Jobs/CleanUp.php b/apps/user_ldap/lib/Jobs/CleanUp.php index 22067d81a9d..8f58e977db7 100644 --- a/apps/user_ldap/lib/Jobs/CleanUp.php +++ b/apps/user_ldap/lib/Jobs/CleanUp.php @@ -107,7 +107,7 @@ class CleanUp extends TimedJob { if (isset($arguments['mapping'])) { $this->mapping = $arguments['mapping']; } else { - $this->mapping = \OCP\Server::get(UserMapping::class); + $this->mapping = \OC::$server->get(UserMapping::class); } if (isset($arguments['deletedUsersIndex'])) { diff --git a/apps/user_ldap/lib/Jobs/Sync.php b/apps/user_ldap/lib/Jobs/Sync.php index b6c11cc7a8c..7c203a3e1ab 100644 --- a/apps/user_ldap/lib/Jobs/Sync.php +++ b/apps/user_ldap/lib/Jobs/Sync.php @@ -357,7 +357,7 @@ class Sync extends TimedJob { if (isset($argument['mapper'])) { $this->mapper = $argument['mapper']; } else { - $this->mapper = \OCP\Server::get(UserMapping::class); + $this->mapper = \OC::$server->get(UserMapping::class); } if (isset($argument['connectionFactory'])) { diff --git a/apps/user_ldap/lib/Mapping/UserMapping.php b/apps/user_ldap/lib/Mapping/UserMapping.php index ade9c67213a..31c7a5ec768 100644 --- a/apps/user_ldap/lib/Mapping/UserMapping.php +++ b/apps/user_ldap/lib/Mapping/UserMapping.php @@ -25,7 +25,6 @@ namespace OCA\User_LDAP\Mapping; use OCP\HintException; use OCP\IDBConnection; use OCP\IRequest; -use OCP\Server; use OCP\Support\Subscription\IAssertion; /** @@ -53,7 +52,7 @@ class UserMapping extends AbstractMapping { static $isProvisioningApi = null; if ($isProvisioningApi === null) { - $request = Server::get(IRequest::class); + $request = \OC::$server->get(IRequest::class); $isProvisioningApi = \preg_match(self::PROV_API_REGEX, $request->getRequestUri()) === 1; } if ($isProvisioningApi) { diff --git a/apps/user_ldap/lib/Proxy.php b/apps/user_ldap/lib/Proxy.php index 4df6c2683a6..dc4bb3698c6 100644 --- a/apps/user_ldap/lib/Proxy.php +++ b/apps/user_ldap/lib/Proxy.php @@ -37,7 +37,6 @@ use OCA\User_LDAP\Mapping\UserMapping; use OCA\User_LDAP\User\Manager; use OCP\IConfig; use OCP\IUserManager; -use OCP\Server; use Psr\Log\LoggerInterface; abstract class Proxy { @@ -64,14 +63,14 @@ abstract class Proxy { * @param string $configPrefix */ private function addAccess(string $configPrefix): void { - $ocConfig = Server::get(IConfig::class); - $userMap = Server::get(UserMapping::class); - $groupMap = Server::get(GroupMapping::class); - $coreUserManager = Server::get(IUserManager::class); - $logger = Server::get(LoggerInterface::class); - $helper = Server::get(Helper::class); - - $userManager = Server::get(Manager::class); + $ocConfig = \OC::$server->get(IConfig::class); + $userMap = \OC::$server->get(UserMapping::class); + $groupMap = \OC::$server->get(GroupMapping::class); + $coreUserManager = \OC::$server->get(IUserManager::class); + $logger = \OC::$server->get(LoggerInterface::class); + $helper = \OC::$server->get(Helper::class); + + $userManager = \OC::$server->get(Manager::class); $connector = new Connection($this->ldap, $configPrefix); $access = new Access($connector, $this->ldap, $userManager, $helper, $ocConfig, $coreUserManager, $logger); |