UserRepository
interface UserRepository (View source)
Persistence for user accounts, their permission template and the zones they own.
Named without the Interface suffix for historical reasons.
Methods
Find a user by username
Update a user's password
Get a user by ID
Get a user's full name by ID
Get the full names of all owners of a zone, comma-separated
Check if a user owns a zone directly or via group membership
Get all permissions for a specific user
Check if a user has admin permissions
Get a paginated list of users with zone counts
Get all users with the number of zones each one owns
Get detailed user list with template, group, and MFA info
Get total count of users in the system
Delete a user by ID
Get zones owned by a user
Transfer zone ownership from one user to another
Count total number of uberusers (super admins) in the system
Check if a specific user is an uberuser
Whether removing or demoting this user would leave no active uberuser.
Check whether a permission template grants the uberuser permission
Resolve every permission id carrying a given name
Create a new user
Get a user by username
Get a user by email
Count how many users share the given email address.
Update a user's information
Assign permission template to a user
Check if a permission template exists
Details
User|null
findByUsername(string $username)
Find a user by username
bool
updatePassword(int $userId, string $hashedPassword)
Update a user's password
array|null
getUserById(int $userId)
Get a user by ID
string|null
getFullNameById(int $userId)
Get a user's full name by ID
string
getZoneOwnerFullNames(int $domainId)
Get the full names of all owners of a zone, comma-separated
bool
userOwnsZone(int $userId, int $domainId)
Check if a user owns a zone directly or via group membership
array
getUserPermissions(int $userId)
Get all permissions for a specific user
bool
hasAdminPermission(int $userId)
Check if a user has admin permissions
array
getUsersList(int $offset, int $limit)
Get a paginated list of users with zone counts
array
getUsersWithZoneCounts()
Get all users with the number of zones each one owns
array
getUserDetailList(bool $ldapUse, int|null $restrictToUserId, int|null $specific = null, int|null $limit = null, int|null $offset = null, string|null $search = null)
Get detailed user list with template, group, and MFA info
int
getTotalUserCount(int|null $restrictToUserId = null, string|null $search = null)
Get total count of users in the system
bool
deleteUser(int $userId)
Delete a user by ID
array
getUserZones(int $userId)
Get zones owned by a user
bool
transferUserZones(int $fromUserId, int $toUserId)
Transfer zone ownership from one user to another
int
countUberusers()
Count total number of uberusers (super admins) in the system
bool
isUberuser(int $userId)
Check if a specific user is an uberuser
bool
isLastUberuser(int $userId)
Whether removing or demoting this user would leave no active uberuser.
bool
templateGrantsUberuser(int $permTemplId)
Check whether a permission template grants the uberuser permission
array
getPermissionIdsByName(string $name)
Resolve every permission id carrying a given name
perm_items.name has no unique constraint, so a name can map to several rows and all of them grant the permission.
int|null
createUser(array $userData)
Create a new user
array|null
getUserByUsername(string $username)
Get a user by username
array|null
getUserByEmail(string $email)
Get a user by email
int
countUsersByEmail(string $email)
Count how many users share the given email address.
bool
updateUser(int $userId, array $userData)
Update a user's information
bool
assignPermissionTemplate(int $userId, int $permTemplId)
Assign permission template to a user
bool
permissionTemplateExists(int $permTemplId, string|null $templateType = null)
Check if a permission template exists