aboutsummaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/lib
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2024-10-10 12:40:31 +0200
committerCôme Chilliet <come.chilliet@nextcloud.com>2024-10-15 10:40:25 +0200
commit1580c8612b01bfa780d1a7372080a27d182fb7dd (patch)
treeb2776d0cd254ac9d6e54828978ce18b702f550d5 /apps/user_ldap/lib
parent4ff9b3e0ce53227e2be47c4c2dcb1fdc3e540b5f (diff)
downloadnextcloud-server-1580c8612b01bfa780d1a7372080a27d182fb7dd.tar.gz
nextcloud-server-1580c8612b01bfa780d1a7372080a27d182fb7dd.zip
chore(apps): Apply new rector configuration to autouse classes
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/user_ldap/lib')
-rw-r--r--apps/user_ldap/lib/Access.php7
-rw-r--r--apps/user_ldap/lib/AppInfo/Application.php3
-rw-r--r--apps/user_ldap/lib/Configuration.php3
-rw-r--r--apps/user_ldap/lib/FilesystemHelper.php4
-rw-r--r--apps/user_ldap/lib/GroupPluginManager.php3
-rw-r--r--apps/user_ldap/lib/Group_Proxy.php2
-rw-r--r--apps/user_ldap/lib/Jobs/CleanUp.php3
-rw-r--r--apps/user_ldap/lib/LDAP.php3
-rw-r--r--apps/user_ldap/lib/Mapping/AbstractMapping.php5
-rw-r--r--apps/user_ldap/lib/Notification/Notifier.php2
-rw-r--r--apps/user_ldap/lib/User/Manager.php8
-rw-r--r--apps/user_ldap/lib/User/OfflineUser.php2
-rw-r--r--apps/user_ldap/lib/User/User.php39
-rw-r--r--apps/user_ldap/lib/UserPluginManager.php5
-rw-r--r--apps/user_ldap/lib/User_LDAP.php4
-rw-r--r--apps/user_ldap/lib/User_Proxy.php4
-rw-r--r--apps/user_ldap/lib/Wizard.php3
17 files changed, 56 insertions, 44 deletions
diff --git a/apps/user_ldap/lib/Access.php b/apps/user_ldap/lib/Access.php
index e0c396a2cad..ba62239138d 100644
--- a/apps/user_ldap/lib/Access.php
+++ b/apps/user_ldap/lib/Access.php
@@ -21,6 +21,7 @@ use OCP\IAppConfig;
use OCP\IConfig;
use OCP\IUserManager;
use OCP\User\Events\UserIdAssignedEvent;
+use OCP\Util;
use Psr\Log\LoggerInterface;
use function strlen;
use function substr;
@@ -260,7 +261,7 @@ class Access extends LDAPUtility {
return false;
}
//LDAP attributes are not case sensitive
- $result = \OCP\Util::mb_array_change_key_case(
+ $result = Util::mb_array_change_key_case(
$this->invokeLDAPMethod('getAttributes', $er), MB_CASE_LOWER, 'UTF-8');
return $result;
@@ -341,7 +342,7 @@ class Access extends LDAPUtility {
return @$this->invokeLDAPMethod('exopPasswd', $userDN, '', $password) ||
@$this->invokeLDAPMethod('modReplace', $userDN, $password);
} catch (ConstraintViolationException $e) {
- throw new HintException('Password change rejected.', \OCP\Util::getL10N('user_ldap')->t('Password change rejected. Hint: ') . $e->getMessage(), (int)$e->getCode());
+ throw new HintException('Password change rejected.', Util::getL10N('user_ldap')->t('Password change rejected. Hint: ') . $e->getMessage(), (int)$e->getCode());
}
}
@@ -1329,7 +1330,7 @@ class Access extends LDAPUtility {
if (!is_array($item)) {
continue;
}
- $item = \OCP\Util::mb_array_change_key_case($item, MB_CASE_LOWER, 'UTF-8');
+ $item = Util::mb_array_change_key_case($item, MB_CASE_LOWER, 'UTF-8');
foreach ($attr as $key) {
if (isset($item[$key])) {
if (is_array($item[$key]) && isset($item[$key]['count'])) {
diff --git a/apps/user_ldap/lib/AppInfo/Application.php b/apps/user_ldap/lib/AppInfo/Application.php
index ae6092ae101..3c1cb5daa12 100644
--- a/apps/user_ldap/lib/AppInfo/Application.php
+++ b/apps/user_ldap/lib/AppInfo/Application.php
@@ -40,6 +40,7 @@ use OCP\IUserManager;
use OCP\Notification\IManager as INotificationManager;
use OCP\Share\IManager as IShareManager;
use OCP\User\Events\PostLoginEvent;
+use OCP\Util;
use Psr\Container\ContainerInterface;
use Psr\Log\LoggerInterface;
@@ -129,7 +130,7 @@ class Application extends App implements IBootstrap {
$context->injectFn(Closure::fromCallable([$this, 'registerBackendDependents']));
- \OCP\Util::connectHook(
+ Util::connectHook(
'\OCA\Files_Sharing\API\Server2Server',
'preLoginNameUsedAsUserName',
'\OCA\User_LDAP\Helper',
diff --git a/apps/user_ldap/lib/Configuration.php b/apps/user_ldap/lib/Configuration.php
index 989d0bd3929..658ade62f5d 100644
--- a/apps/user_ldap/lib/Configuration.php
+++ b/apps/user_ldap/lib/Configuration.php
@@ -7,6 +7,7 @@
*/
namespace OCA\User_LDAP;
+use OCP\Server;
use Psr\Log\LoggerInterface;
/**
@@ -673,7 +674,7 @@ class Configuration {
return [strtolower($attribute)];
}
if ($value !== self::AVATAR_PREFIX_DEFAULT) {
- \OCP\Server::get(LoggerInterface::class)->warning('Invalid config value to ldapUserAvatarRule; falling back to default.');
+ Server::get(LoggerInterface::class)->warning('Invalid config value to ldapUserAvatarRule; falling back to default.');
}
return $defaultAttributes;
}
diff --git a/apps/user_ldap/lib/FilesystemHelper.php b/apps/user_ldap/lib/FilesystemHelper.php
index 2a17282361a..eea7ec62ad8 100644
--- a/apps/user_ldap/lib/FilesystemHelper.php
+++ b/apps/user_ldap/lib/FilesystemHelper.php
@@ -7,6 +7,8 @@
*/
namespace OCA\User_LDAP;
+use OC\Files\Filesystem;
+
/**
* @brief wraps around static Nextcloud core methods
*/
@@ -17,7 +19,7 @@ class FilesystemHelper {
* @return bool
*/
public function isLoaded() {
- return \OC\Files\Filesystem::$loaded;
+ return Filesystem::$loaded;
}
/**
diff --git a/apps/user_ldap/lib/GroupPluginManager.php b/apps/user_ldap/lib/GroupPluginManager.php
index 37622a53480..6bdb5559a02 100644
--- a/apps/user_ldap/lib/GroupPluginManager.php
+++ b/apps/user_ldap/lib/GroupPluginManager.php
@@ -6,6 +6,7 @@
namespace OCA\User_LDAP;
use OCP\GroupInterface;
+use OCP\Server;
use Psr\Log\LoggerInterface;
class GroupPluginManager {
@@ -41,7 +42,7 @@ class GroupPluginManager {
foreach ($this->which as $action => $v) {
if ((bool)($respondToActions & $action)) {
$this->which[$action] = $plugin;
- \OCP\Server::get(LoggerInterface::class)->debug('Registered action ' . $action . ' to plugin ' . get_class($plugin), ['app' => 'user_ldap']);
+ Server::get(LoggerInterface::class)->debug('Registered action ' . $action . ' to plugin ' . get_class($plugin), ['app' => 'user_ldap']);
}
}
}
diff --git a/apps/user_ldap/lib/Group_Proxy.php b/apps/user_ldap/lib/Group_Proxy.php
index 1a78a65e61e..931ad7d181a 100644
--- a/apps/user_ldap/lib/Group_Proxy.php
+++ b/apps/user_ldap/lib/Group_Proxy.php
@@ -18,7 +18,7 @@ use OCP\GroupInterface;
use OCP\IConfig;
use OCP\IUserManager;
-class Group_Proxy extends Proxy implements \OCP\GroupInterface, IGroupLDAP, IGetDisplayNameBackend, INamedBackend, IDeleteGroupBackend, IBatchMethodsBackend, IIsAdminBackend {
+class Group_Proxy extends Proxy implements GroupInterface, IGroupLDAP, IGetDisplayNameBackend, INamedBackend, IDeleteGroupBackend, IBatchMethodsBackend, IIsAdminBackend {
private $backends = [];
private ?Group_LDAP $refBackend = null;
private Helper $helper;
diff --git a/apps/user_ldap/lib/Jobs/CleanUp.php b/apps/user_ldap/lib/Jobs/CleanUp.php
index 088a563dc27..12dcc1673d6 100644
--- a/apps/user_ldap/lib/Jobs/CleanUp.php
+++ b/apps/user_ldap/lib/Jobs/CleanUp.php
@@ -14,6 +14,7 @@ use OCA\User_LDAP\User_LDAP;
use OCA\User_LDAP\User_Proxy;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\BackgroundJob\TimedJob;
+use OCP\Server;
/**
* Class CleanUp
@@ -95,7 +96,7 @@ class CleanUp extends TimedJob {
if (isset($arguments['mapping'])) {
$this->mapping = $arguments['mapping'];
} else {
- $this->mapping = \OCP\Server::get(UserMapping::class);
+ $this->mapping = Server::get(UserMapping::class);
}
if (isset($arguments['deletedUsersIndex'])) {
diff --git a/apps/user_ldap/lib/LDAP.php b/apps/user_ldap/lib/LDAP.php
index b57cae72436..5e801dec720 100644
--- a/apps/user_ldap/lib/LDAP.php
+++ b/apps/user_ldap/lib/LDAP.php
@@ -12,6 +12,7 @@ use OCA\User_LDAP\DataCollector\LdapDataCollector;
use OCA\User_LDAP\Exceptions\ConstraintViolationException;
use OCP\IConfig;
use OCP\Profiler\IProfiler;
+use OCP\Server;
use Psr\Log\LoggerInterface;
class LDAP implements ILDAPWrapper {
@@ -31,7 +32,7 @@ class LDAP implements ILDAPWrapper {
$profiler->add($this->dataCollector);
}
- $this->logger = \OCP\Server::get(LoggerInterface::class);
+ $this->logger = Server::get(LoggerInterface::class);
}
/**
diff --git a/apps/user_ldap/lib/Mapping/AbstractMapping.php b/apps/user_ldap/lib/Mapping/AbstractMapping.php
index 94ac3c985ca..a8f0cf84d76 100644
--- a/apps/user_ldap/lib/Mapping/AbstractMapping.php
+++ b/apps/user_ldap/lib/Mapping/AbstractMapping.php
@@ -11,6 +11,7 @@ use Doctrine\DBAL\Exception;
use OCP\DB\IPreparedStatement;
use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\IDBConnection;
+use OCP\Server;
use Psr\Log\LoggerInterface;
/**
@@ -34,7 +35,7 @@ abstract class AbstractMapping {
/**
* @param \OCP\IDBConnection $dbc
*/
- public function __construct(\OCP\IDBConnection $dbc) {
+ public function __construct(IDBConnection $dbc) {
$this->dbc = $dbc;
}
@@ -333,7 +334,7 @@ abstract class AbstractMapping {
*/
public function map($fdn, $name, $uuid) {
if (mb_strlen($fdn) > 4000) {
- \OCP\Server::get(LoggerInterface::class)->error(
+ Server::get(LoggerInterface::class)->error(
'Cannot map, because the DN exceeds 4000 characters: {dn}',
[
'app' => 'user_ldap',
diff --git a/apps/user_ldap/lib/Notification/Notifier.php b/apps/user_ldap/lib/Notification/Notifier.php
index 23ad77f75f2..8858bc33f80 100644
--- a/apps/user_ldap/lib/Notification/Notifier.php
+++ b/apps/user_ldap/lib/Notification/Notifier.php
@@ -18,7 +18,7 @@ class Notifier implements INotifier {
/**
* @param IFactory $l10nFactory
*/
- public function __construct(\OCP\L10N\IFactory $l10nFactory) {
+ public function __construct(IFactory $l10nFactory) {
$this->l10nFactory = $l10nFactory;
}
diff --git a/apps/user_ldap/lib/User/Manager.php b/apps/user_ldap/lib/User/Manager.php
index 5d5ad8b2658..7b03483200d 100644
--- a/apps/user_ldap/lib/User/Manager.php
+++ b/apps/user_ldap/lib/User/Manager.php
@@ -77,7 +77,7 @@ class Manager {
* property array
* @param string $dn the DN of the user
* @param string $uid the internal (owncloud) username
- * @return \OCA\User_LDAP\User\User
+ * @return User
*/
private function createAndCache($dn, $uid) {
$this->checkAccess();
@@ -188,7 +188,7 @@ class Manager {
/**
* creates and returns an instance of OfflineUser for the specified user
* @param string $id
- * @return \OCA\User_LDAP\User\OfflineUser
+ * @return OfflineUser
*/
public function getDeletedUser($id) {
return new OfflineUser(
@@ -202,7 +202,7 @@ class Manager {
/**
* @brief returns a User object by its Nextcloud username
* @param string $id the DN or username of the user
- * @return \OCA\User_LDAP\User\User|\OCA\User_LDAP\User\OfflineUser|null
+ * @return User|OfflineUser|null
*/
protected function createInstancyByUserName($id) {
//most likely a uid. Check whether it is a deleted user
@@ -219,7 +219,7 @@ class Manager {
/**
* @brief returns a User object by its DN or Nextcloud username
* @param string $id the DN or username of the user
- * @return \OCA\User_LDAP\User\User|\OCA\User_LDAP\User\OfflineUser|null
+ * @return User|OfflineUser|null
* @throws \Exception when connection could not be established
*/
public function get($id) {
diff --git a/apps/user_ldap/lib/User/OfflineUser.php b/apps/user_ldap/lib/User/OfflineUser.php
index eed715ccc1c..873bd597df8 100644
--- a/apps/user_ldap/lib/User/OfflineUser.php
+++ b/apps/user_ldap/lib/User/OfflineUser.php
@@ -60,7 +60,7 @@ class OfflineUser {
*/
protected $db;
/**
- * @var \OCA\User_LDAP\Mapping\UserMapping
+ * @var UserMapping
*/
protected $mapping;
/** @var IManager */
diff --git a/apps/user_ldap/lib/User/User.php b/apps/user_ldap/lib/User/User.php
index 4a5f2442c9b..0a310f57012 100644
--- a/apps/user_ldap/lib/User/User.php
+++ b/apps/user_ldap/lib/User/User.php
@@ -23,6 +23,7 @@ use OCP\IUser;
use OCP\IUserManager;
use OCP\Notification\IManager as INotificationManager;
use OCP\Server;
+use OCP\Util;
use Psr\Log\LoggerInterface;
/**
@@ -121,7 +122,7 @@ class User {
$this->notificationManager = $notificationManager;
$this->birthdateParser = new BirthdateParserService();
- \OCP\Util::connectHook('OC_User', 'post_login', $this, 'handlePasswordExpiry');
+ Util::connectHook('OC_User', 'post_login', $this, 'handlePasswordExpiry');
}
/**
@@ -228,7 +229,7 @@ class User {
//User Profile Field - Phone number
$attr = strtolower($this->connection->ldapAttributePhone);
if (!empty($attr)) { // attribute configured
- $profileValues[\OCP\Accounts\IAccountManager::PROPERTY_PHONE]
+ $profileValues[IAccountManager::PROPERTY_PHONE]
= $ldapEntry[$attr][0] ?? '';
}
//User Profile Field - website
@@ -237,57 +238,57 @@ class User {
$cutPosition = strpos($ldapEntry[$attr][0], ' ');
if ($cutPosition) {
// drop appended label
- $profileValues[\OCP\Accounts\IAccountManager::PROPERTY_WEBSITE]
+ $profileValues[IAccountManager::PROPERTY_WEBSITE]
= substr($ldapEntry[$attr][0], 0, $cutPosition);
} else {
- $profileValues[\OCP\Accounts\IAccountManager::PROPERTY_WEBSITE]
+ $profileValues[IAccountManager::PROPERTY_WEBSITE]
= $ldapEntry[$attr][0];
}
} elseif (!empty($attr)) { // configured, but not defined
- $profileValues[\OCP\Accounts\IAccountManager::PROPERTY_WEBSITE] = '';
+ $profileValues[IAccountManager::PROPERTY_WEBSITE] = '';
}
//User Profile Field - Address
$attr = strtolower($this->connection->ldapAttributeAddress);
if (isset($ldapEntry[$attr])) {
if (str_contains($ldapEntry[$attr][0], '$')) {
// basic format conversion from postalAddress syntax to commata delimited
- $profileValues[\OCP\Accounts\IAccountManager::PROPERTY_ADDRESS]
+ $profileValues[IAccountManager::PROPERTY_ADDRESS]
= str_replace('$', ', ', $ldapEntry[$attr][0]);
} else {
- $profileValues[\OCP\Accounts\IAccountManager::PROPERTY_ADDRESS]
+ $profileValues[IAccountManager::PROPERTY_ADDRESS]
= $ldapEntry[$attr][0];
}
} elseif (!empty($attr)) { // configured, but not defined
- $profileValues[\OCP\Accounts\IAccountManager::PROPERTY_ADDRESS] = '';
+ $profileValues[IAccountManager::PROPERTY_ADDRESS] = '';
}
//User Profile Field - Twitter
$attr = strtolower($this->connection->ldapAttributeTwitter);
if (!empty($attr)) {
- $profileValues[\OCP\Accounts\IAccountManager::PROPERTY_TWITTER]
+ $profileValues[IAccountManager::PROPERTY_TWITTER]
= $ldapEntry[$attr][0] ?? '';
}
//User Profile Field - fediverse
$attr = strtolower($this->connection->ldapAttributeFediverse);
if (!empty($attr)) {
- $profileValues[\OCP\Accounts\IAccountManager::PROPERTY_FEDIVERSE]
+ $profileValues[IAccountManager::PROPERTY_FEDIVERSE]
= $ldapEntry[$attr][0] ?? '';
}
//User Profile Field - organisation
$attr = strtolower($this->connection->ldapAttributeOrganisation);
if (!empty($attr)) {
- $profileValues[\OCP\Accounts\IAccountManager::PROPERTY_ORGANISATION]
+ $profileValues[IAccountManager::PROPERTY_ORGANISATION]
= $ldapEntry[$attr][0] ?? '';
}
//User Profile Field - role
$attr = strtolower($this->connection->ldapAttributeRole);
if (!empty($attr)) {
- $profileValues[\OCP\Accounts\IAccountManager::PROPERTY_ROLE]
+ $profileValues[IAccountManager::PROPERTY_ROLE]
= $ldapEntry[$attr][0] ?? '';
}
//User Profile Field - headline
$attr = strtolower($this->connection->ldapAttributeHeadline);
if (!empty($attr)) {
- $profileValues[\OCP\Accounts\IAccountManager::PROPERTY_HEADLINE]
+ $profileValues[IAccountManager::PROPERTY_HEADLINE]
= $ldapEntry[$attr][0] ?? '';
}
//User Profile Field - biography
@@ -295,14 +296,14 @@ class User {
if (isset($ldapEntry[$attr])) {
if (str_contains($ldapEntry[$attr][0], '\r')) {
// convert line endings
- $profileValues[\OCP\Accounts\IAccountManager::PROPERTY_BIOGRAPHY]
+ $profileValues[IAccountManager::PROPERTY_BIOGRAPHY]
= str_replace(["\r\n","\r"], "\n", $ldapEntry[$attr][0]);
} else {
- $profileValues[\OCP\Accounts\IAccountManager::PROPERTY_BIOGRAPHY]
+ $profileValues[IAccountManager::PROPERTY_BIOGRAPHY]
= $ldapEntry[$attr][0];
}
} elseif (!empty($attr)) { // configured, but not defined
- $profileValues[\OCP\Accounts\IAccountManager::PROPERTY_BIOGRAPHY] = '';
+ $profileValues[IAccountManager::PROPERTY_BIOGRAPHY] = '';
}
//User Profile Field - birthday
$attr = strtolower($this->connection->ldapAttributeBirthDate);
@@ -310,7 +311,7 @@ class User {
$value = $ldapEntry[$attr][0];
try {
$birthdate = $this->birthdateParser->parseBirthdate($value);
- $profileValues[\OCP\Accounts\IAccountManager::PROPERTY_BIRTHDATE]
+ $profileValues[IAccountManager::PROPERTY_BIRTHDATE]
= $birthdate->format('Y-m-d');
} catch (InvalidArgumentException $e) {
// Invalid date -> just skip the property
@@ -323,7 +324,7 @@ class User {
//User Profile Field - pronouns
$attr = strtolower($this->connection->ldapAttributePronouns);
if (!empty($attr)) {
- $profileValues[\OCP\Accounts\IAccountManager::PROPERTY_PRONOUNS]
+ $profileValues[IAccountManager::PROPERTY_PRONOUNS]
= $ldapEntry[$attr][0] ?? '';
}
// check for changed data and cache just for TTL checking
@@ -354,7 +355,7 @@ class User {
// system must be postponed after the login. It is to ensure
// external mounts are mounted properly (e.g. with login
// credentials from the session).
- \OCP\Util::connectHook('OC_User', 'post_login', $this, 'updateAvatarPostLogin');
+ Util::connectHook('OC_User', 'post_login', $this, 'updateAvatarPostLogin');
break;
}
}
diff --git a/apps/user_ldap/lib/UserPluginManager.php b/apps/user_ldap/lib/UserPluginManager.php
index 7c51dc70f83..bbcf4157016 100644
--- a/apps/user_ldap/lib/UserPluginManager.php
+++ b/apps/user_ldap/lib/UserPluginManager.php
@@ -6,6 +6,7 @@
namespace OCA\User_LDAP;
use OC\User\Backend;
+use OCP\Server;
use Psr\Log\LoggerInterface;
class UserPluginManager {
@@ -43,12 +44,12 @@ class UserPluginManager {
foreach ($this->which as $action => $v) {
if (is_int($action) && (bool)($respondToActions & $action)) {
$this->which[$action] = $plugin;
- \OCP\Server::get(LoggerInterface::class)->debug('Registered action ' . $action . ' to plugin ' . get_class($plugin), ['app' => 'user_ldap']);
+ Server::get(LoggerInterface::class)->debug('Registered action ' . $action . ' to plugin ' . get_class($plugin), ['app' => 'user_ldap']);
}
}
if (method_exists($plugin, 'deleteUser')) {
$this->which['deleteUser'] = $plugin;
- \OCP\Server::get(LoggerInterface::class)->debug('Registered action deleteUser to plugin ' . get_class($plugin), ['app' => 'user_ldap']);
+ Server::get(LoggerInterface::class)->debug('Registered action deleteUser to plugin ' . get_class($plugin), ['app' => 'user_ldap']);
}
}
diff --git a/apps/user_ldap/lib/User_LDAP.php b/apps/user_ldap/lib/User_LDAP.php
index bd1a65f4d42..85ed69195b6 100644
--- a/apps/user_ldap/lib/User_LDAP.php
+++ b/apps/user_ldap/lib/User_LDAP.php
@@ -258,8 +258,8 @@ class User_LDAP extends BackendUtility implements IUserBackend, UserInterface, I
/**
* checks whether a user is still available on LDAP
*
- * @param string|\OCA\User_LDAP\User\User $user either the Nextcloud user
- * name or an instance of that user
+ * @param string|User $user either the Nextcloud user
+ * name or an instance of that user
* @throws \Exception
* @throws \OC\ServerNotAvailableException
*/
diff --git a/apps/user_ldap/lib/User_Proxy.php b/apps/user_ldap/lib/User_Proxy.php
index 0c00771aa67..3abaae741d8 100644
--- a/apps/user_ldap/lib/User_Proxy.php
+++ b/apps/user_ldap/lib/User_Proxy.php
@@ -220,8 +220,8 @@ class User_Proxy extends Proxy implements IUserBackend, UserInterface, IUserLDAP
/**
* check if a user exists on LDAP
*
- * @param string|\OCA\User_LDAP\User\User $user either the Nextcloud user
- * name or an instance of that user
+ * @param string|User $user either the Nextcloud user
+ * name or an instance of that user
*/
public function userExistsOnLDAP($user, bool $ignoreCache = false): bool {
$id = ($user instanceof User) ? $user->getUsername() : $user;
diff --git a/apps/user_ldap/lib/Wizard.php b/apps/user_ldap/lib/Wizard.php
index 87f0d04f497..262777c5022 100644
--- a/apps/user_ldap/lib/Wizard.php
+++ b/apps/user_ldap/lib/Wizard.php
@@ -11,6 +11,7 @@ namespace OCA\User_LDAP;
use OC\ServerNotAvailableException;
use OCP\IL10N;
use OCP\L10N\IFactory as IL10NFactory;
+use OCP\Util;
use Psr\Log\LoggerInterface;
class Wizard extends LDAPUtility {
@@ -1253,7 +1254,7 @@ class Wizard extends LDAPUtility {
}
// strtolower on all keys for proper comparison
- $result = \OCP\Util::mb_array_change_key_case($result);
+ $result = Util::mb_array_change_key_case($result);
$attribute = strtolower($attribute);
if (isset($result[$attribute])) {
foreach ($result[$attribute] as $key => $val) {