chore: Move magic number into a documented const

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
Côme Chilliet 2025-03-06 16:36:47 +01:00
parent 107c18dff2
commit 3d33ac2d34
No known key found for this signature in database
GPG key ID: A3E2F658B28C760A

View file

@ -51,6 +51,8 @@ use function in_array;
#[OpenAPI(scope: OpenAPI::SCOPE_IGNORE)]
class UsersController extends Controller {
/** Limit for counting users for subadmins, to avoid spending too much time */
private const COUNT_LIMIT_FOR_SUBADMINS = 999;
public function __construct(
string $appName,
@ -148,7 +150,7 @@ class UsersController extends Controller {
}, 0);
} else {
// User is subadmin !
[$userCount,$disabledUsers] = $this->userManager->countUsersAndDisabledUsersOfGroups($groupsInfo->getGroups(), 999);
[$userCount,$disabledUsers] = $this->userManager->countUsersAndDisabledUsersOfGroups($groupsInfo->getGroups(), self::COUNT_LIMIT_FOR_SUBADMINS);
}
if ($disabledUsers > 0) {