interface UserAdminInterface (View source)

Account administration: listing, creating, updating and deleting users and moving their zones.

Methods

string
getZoneOwnerFullNames(int $domainId)

Get the full names of all owners of a zone, comma-separated

array
getUsersList(int $offset, int $limit, string|null $search = null, array $sort = [])

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, int|null $sharedTemplateHeir = null)

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

bool
setZoneLimit(int $userId, int|null $limit)

Set the user's own zone limit; null removes it so the configured default applies

void
lockForZoneLimit(int $userId)

Lock the user's row until the open transaction ends, so zone limit checks for this user run one at a time

int|null
createUser(CreateUserCommand $user)

Create a new user

bool
updateUser(int $userId, UpdateUserCommand $changes)

Update a user's information

int
createProvisionedUser(array $userData)

Insert a user created from an external identity (LDAP, OIDC or SAML).

void
updateProvisionedUser(int $userId, array $fields)

Update the identity and template columns that external provisioning owns.

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

Details

string getZoneOwnerFullNames(int $domainId)

Get the full names of all owners of a zone, comma-separated

Parameters

int $domainId

Domain/zone ID

Return Value

string

Comma-separated owner full names, empty string if none

array getUsersList(int $offset, int $limit, string|null $search = null, array $sort = [])

Get a paginated list of users with zone counts

Parameters

int $offset

Starting offset for pagination

int $limit

Maximum number of users to return

string|null $search

Case-insensitive substring filter on username, full name, email or description

array $sort

Sort keys (id, username, fullname or email); empty sorts by id

Return Value

array

Array of user data with zone counts

array getUsersWithZoneCounts()

Get all users with the number of zones each one owns

Return Value

array

Array of user rows [id, username, fullname, email, description, active, numdomains]

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

Parameters

bool $ldapUse

Whether the LDAP column should be included

int|null $restrictToUserId

Return only this user (for users without view-others permission)

int|null $specific

User ID to fetch (overrides the restriction)

int|null $limit

Number of records to return (optional)

int|null $offset

Starting offset (optional)

string|null $search

Filter on username, full name, email or description

Return Value

array

Array of user details

int getTotalUserCount(int|null $restrictToUserId = null, string|null $search = null)

Get total count of users in the system

Parameters

int|null $restrictToUserId

Count only this user (for users without view-others permission)

string|null $search

Filter on username, full name, email or description

Return Value

int

Total number of users

bool deleteUser(int $userId, int|null $sharedTemplateHeir = null)

Delete a user by ID

Parameters

int $userId

User ID to delete

int|null $sharedTemplateHeir

Gets the user's templates that are shared with groups; without one they are deleted too

Return Value

bool

True if the user was deleted successfully

array getUserZones(int $userId)

Get zones owned by a user

Parameters

int $userId

User ID

Return Value

array

Array of zone data owned by the user

bool transferUserZones(int $fromUserId, int $toUserId)

Transfer zone ownership from one user to another

Parameters

int $fromUserId

Source user ID

int $toUserId

Target user ID

Return Value

bool

True if zones were transferred successfully

bool setZoneLimit(int $userId, int|null $limit)

Set the user's own zone limit; null removes it so the configured default applies

Parameters

int $userId
int|null $limit

Return Value

bool

void lockForZoneLimit(int $userId)

Lock the user's row until the open transaction ends, so zone limit checks for this user run one at a time

Parameters

int $userId

Return Value

void

int|null createUser(CreateUserCommand $user)

Create a new user

Parameters

CreateUserCommand $user

The row to write, with the password already in its stored form

Return Value

int|null

User ID if created successfully, null otherwise

bool updateUser(int $userId, UpdateUserCommand $changes)

Update a user's information

Parameters

int $userId

User ID to update

UpdateUserCommand $changes

The fields to write (null ones stay), the password already in its stored form

Return Value

bool

True if updated successfully, false otherwise

int createProvisionedUser(array $userData)

Insert a user created from an external identity (LDAP, OIDC or SAML).

Parameters

array $userData

Return Value

int

The new user id

Exceptions

RuntimeException

void updateProvisionedUser(int $userId, array $fields)

Update the identity and template columns that external provisioning owns.

Parameters

int $userId
array $fields

Column => value, limited to fullname, email, auth_method, perm_templ and perm_templ_source

Return Value

void

bool assignPermissionTemplate(int $userId, int $permTemplId)

Assign permission template to a user

Parameters

int $userId

User ID

int $permTemplId

Permission template ID

Return Value

bool

True if assignment was successful

bool permissionTemplateExists(int $permTemplId, string|null $templateType = null)

Check if a permission template exists

Parameters

int $permTemplId

Permission template ID

string|null $templateType

Optional template_type filter ('user' or 'group')

Return Value

bool

True if the permission template exists (and matches type when set)