Skip to content

Commit

Permalink
chore: Move magic number into a documented const
Browse files Browse the repository at this point in the history
Signed-off-by: Côme Chilliet <[email protected]>
  • Loading branch information
come-nc authored and backportbot[bot] committed Mar 10, 2025
1 parent e3e3458 commit f64c37e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apps/settings/lib/Controller/UsersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@

#[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,
Expand Down Expand Up @@ -150,7 +152,7 @@ public function usersList(): TemplateResponse {
}, 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) {
Expand Down

0 comments on commit f64c37e

Please sign in to comment.