Skip to content

Commit 7c966c9

Browse files
committed
refactor: modernize session management and token validation
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
1 parent 93e7593 commit 7c966c9

2 files changed

Lines changed: 477 additions & 200 deletions

File tree

lib/Db/UserMapper.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,4 +169,22 @@ public function getOrCreate(int $providerId, string $sub, bool $id4me = false):
169169
$user->setUserId($userId);
170170
return $this->insert($user);
171171
}
172+
173+
/**
174+
* Count the total number of users provisioned by the OIDC backend.
175+
*
176+
* @return int the number of rows in the user_oidc table
177+
*/
178+
public function countUsers(): int {
179+
$qb = $this->db->getQueryBuilder();
180+
181+
$qb->selectAlias($qb->func()->count('*'), 'user_count')
182+
->from($this->getTableName());
183+
184+
$result = $qb->executeQuery();
185+
$count = $result->fetchOne();
186+
$result->closeCursor();
187+
188+
return (int)$count;
189+
}
172190
}

0 commit comments

Comments
 (0)