diff options
author | Côme Chilliet <91878298+come-nc@users.noreply.github.com> | 2022-12-20 16:48:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-20 16:48:07 +0100 |
commit | f6ff717b56ac9fa69e60991e982dfdd4c26a95f3 (patch) | |
tree | e2095fcda4ff53d33a91bfd983d8f9d78a83a89e /apps/user_ldap/lib/User_Proxy.php | |
parent | 1db0ddee3beb1c41016388cd3d11cf0232f6030d (diff) | |
parent | 341dda1de618ee76a1e617cc4c15267c120d32c3 (diff) | |
download | nextcloud-server-f6ff717b56ac9fa69e60991e982dfdd4c26a95f3.tar.gz nextcloud-server-f6ff717b56ac9fa69e60991e982dfdd4c26a95f3.zip |
Merge pull request #34772 from nextcloud/fix/clean-ldap-access-factory-usage
Make sure to use AccessFactory to create Access instances and use DI
Diffstat (limited to 'apps/user_ldap/lib/User_Proxy.php')
-rw-r--r-- | apps/user_ldap/lib/User_Proxy.php | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/apps/user_ldap/lib/User_Proxy.php b/apps/user_ldap/lib/User_Proxy.php index b98fa8da0ff..b07c632eeeb 100644 --- a/apps/user_ldap/lib/User_Proxy.php +++ b/apps/user_ldap/lib/User_Proxy.php @@ -41,8 +41,9 @@ use OCP\User\Backend\ICountUsersBackend; use OCP\UserInterface; class User_Proxy extends Proxy implements IUserBackend, UserInterface, IUserLDAP, ICountUsersBackend, ICountMappedUsersBackend { + /** @var array<string,User_LDAP> */ private $backends = []; - /** @var User_LDAP */ + /** @var ?User_LDAP */ private $refBackend = null; private bool $isSetUp = false; @@ -55,12 +56,13 @@ class User_Proxy extends Proxy implements IUserBackend, UserInterface, IUserLDAP public function __construct( Helper $helper, ILDAPWrapper $ldap, + AccessFactory $accessFactory, IConfig $ocConfig, INotificationManager $notificationManager, IUserSession $userSession, UserPluginManager $userPluginManager ) { - parent::__construct($ldap); + parent::__construct($ldap, $accessFactory); $this->helper = $helper; $this->ocConfig = $ocConfig; $this->notificationManager = $notificationManager; @@ -377,7 +379,7 @@ class User_Proxy extends Proxy implements IUserBackend, UserInterface, IUserLDAP /** * Count the number of users * - * @return int|bool + * @return int|false */ public function countUsers() { $this->setup(); @@ -386,7 +388,7 @@ class User_Proxy extends Proxy implements IUserBackend, UserInterface, IUserLDAP foreach ($this->backends as $backend) { $backendUsers = $backend->countUsers(); if ($backendUsers !== false) { - $users += $backendUsers; + $users = (int)$users + $backendUsers; } } return $users; |