diff --git a/apps/user_ldap/lib/User_Proxy.php b/apps/user_ldap/lib/User_Proxy.php index 934bed7d45047..9fcd9548f735e 100644 --- a/apps/user_ldap/lib/User_Proxy.php +++ b/apps/user_ldap/lib/User_Proxy.php @@ -415,12 +415,7 @@ public function countUsers() { */ public function countMappedUsers(): int { $this->setup(); - - $users = 0; - foreach ($this->backends as $backend) { - $users += $backend->countMappedUsers(); - } - return $users; + return $this->refBackend?->countMappedUsers() ?? 0; } /**