Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: Remove now unused methods from User manager
Signed-off-by: Côme Chilliet <[email protected]>
  • Loading branch information
come-nc committed Mar 31, 2025
commit 107c18dff2ef4ca9b3cd871493dd8c52b8b0000b
47 changes: 0 additions & 47 deletions lib/private/User/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -488,23 +488,6 @@ public function countUsers() {
return $userCountStatistics;
}

/**
* returns how many users per backend exist in the requested groups (if supported by backend)
*
* @param IGroup[] $groups an array of gid to search in
* @return int
*/
public function countUsersOfGroups(array $groups) {
$users = [];
foreach ($groups as $group) {
$usersIds = array_map(function ($user) {
return $user->getUID();
}, $group->getUsers());
$users = array_merge($users, $usersIds);
}
return count(array_unique($users));
}

/**
* returns how many users per backend exist in the requested groups (if supported by backend)
*
Expand Down Expand Up @@ -592,36 +575,6 @@ public function countDisabledUsers(): int {
return $count;
}

/**
* returns how many users are disabled in the requested groups
*
* @param array $groups groupids to search
* @return int
* @since 14.0.0
*/
public function countDisabledUsersOfGroups(array $groups): int {
$queryBuilder = \OC::$server->getDatabaseConnection()->getQueryBuilder();
$queryBuilder->select($queryBuilder->createFunction('COUNT(DISTINCT ' . $queryBuilder->getColumnName('uid') . ')'))
->from('preferences', 'p')
->innerJoin('p', 'group_user', 'g', $queryBuilder->expr()->eq('p.userid', 'g.uid'))
->where($queryBuilder->expr()->eq('appid', $queryBuilder->createNamedParameter('core')))
->andWhere($queryBuilder->expr()->eq('configkey', $queryBuilder->createNamedParameter('enabled')))
->andWhere($queryBuilder->expr()->eq('configvalue', $queryBuilder->createNamedParameter('false'), IQueryBuilder::PARAM_STR))
->andWhere($queryBuilder->expr()->in('gid', $queryBuilder->createNamedParameter($groups, IQueryBuilder::PARAM_STR_ARRAY)));

$result = $queryBuilder->execute();
$count = $result->fetchOne();
$result->closeCursor();

if ($count !== false) {
$count = (int)$count;
} else {
$count = 0;
}

return $count;
}

/**
* returns how many users have logged in once
*
Expand Down