Methods |
public
|
change_quota(string $user, integer $diskquota, integer $filequota = 0): bool
Change disk and file count quotas for a given user
Change disk and file count quotas for a given user
Parameters
$diskquota |
disk quota provided in megabytes
|
$filequota |
file count limit
|
|
#
|
public
|
exists($user): bool
Checks for existence of user
Checks for existence of user
|
#
|
public
|
get_uid_from_username($username)
|
#
|
public
|
getpwnam(string $user = null): array
Perform getpwnam() lookup on virtual account
Perform getpwnam() lookup on virtual account
name: username
uid: uid
gid: gid
gecos: gecos field
home: home directory
shell: shell
|
#
|
public
|
add_user($user, $password, string $gecos = '', int $quota = 0, array $options = [])
Add user
|
#
|
public
|
add($user, $password, string $gecos = '', int $quota = 0, array $options = []): bool
Add new user to account
Parameters
$quota |
storage quota in MB
|
|
#
|
public
|
get_users(): array
Get users belonging to account
Get users belonging to account
Finds all applicable users created and returns an array consisting
of their information from /etc/passwd. Indexed by username.
The following indexes are provided:
uid: user id
gid: group id (which will be the same as the uid of the site admin)
home: home directory of the user
shell: path to the shell used by the user
|
#
|
public
|
get_shells(): array
Get shells valid for account
Get shells valid for account
/bin/false blocks access via PAM controlled services
|
#
|
public
|
flush(): bool
Flush account user cache
|
#
|
public
|
get_user_home($user = null)
|
#
|
public
|
get_home($user = null)
|
#
|
public
|
get_user_count(): array
|
#
|
public
|
rename_user(string $user, string $newuser): bool
Change username in the system
Change username in the system
|
#
|
public
|
usermod_driver(string $user, array $attributes): bool
usermod driver
usermod driver
Possible attribute keys
gecos: gecos/comment field
home: home directory
username: new username DANGEROUS
passwd: password encrypted via crypt()
pw_expire: number of days after which the password expires
pw_disable: date on which the account will expire (YYYY-MM-DD)
shell: user shell
pw_lock: lock/unlock password
pw_unlock
move_home: move home directory
Parameters
$attributes |
new attributes to set
|
|
#
|
public
|
get_quota_history(string $mUser, int $mBegin = 0, int $mEnd = null): array|bool
array get_quota_history(string[, int = 0[, int = 0]])
array get_quota_history(string[, int = 0[, int = 0]])
|
#
|
public
|
get_quota($users = null): array
Fetch storage and file quotas from the underlying quota subsystem
Fetch storage and file quotas from the underlying quota subsystem
qused: disk space used in KB
qsoft: soft limit on disk space in KB
qhard: hard limit on disk space in KB
fused: files used
fsoft: soft limit on files
fhard: hard limit on files
Multi-user lookups returns a hash, while a
single-user lookup returns a single quota record
|
#
|
public
|
change_gecos(string $user, string $gecos = null): bool
Change a user's gecos field
Change a user's gecos field
Updates the gecos field in /etc/passwd
If called by admin, change_gecos() takes two parameters:
$user and $gecos. Users only need to supply one parameter,
the new gecos value.
Parameters
$user |
target user or gecos field if called by user
|
$gecos |
gecos field supplied
|
|
#
|
public
|
get_username_from_uid($uid)
|
#
|
public
|
resolve_uid(int $uid): array
Resolve a uid to site/username combo
Resolve a uid to site/username combo
|
#
|
public
|
generate_quota_list(
string $user = '',
string $base = '/{home,usr/local,var/www,var/lib,var/log,tmp}',
bool $sort = true,
): bool|string
Generate a list of files contributing towards the account quota
Generate a list of files contributing towards the account quota
Upon successful generation, the list is stored under ~/filelist-<PANEL_BRAND>.txt
Parameters
$user |
restrict search to user
|
$base |
glob-style directories to inspect
|
$sort |
sort by size
|
|
#
|
public
|
sgroupdel(string $group): bool
Remove a supplemental group
Remove a supplemental group
|
#
|
public
|
sgroups(): array
List supplemental groups
|
#
|
public
|
sgroupadd(string $group): bool
Add a supplemental group
|
#
|
public
|
_verify_conf(ConfigurationContext $ctx): bool
|
#
|
public
|
_create()
|
#
|
public
|
_delete()
|
#
|
public
|
_delete_user(string $user)
|
#
|
public
|
enrollment(string $user): array|false
Get list of services for which user is enabled
Get list of services for which user is enabled
|
#
|
public
|
erase_quota_history(string $user, int $until = -1): bool
Remove historical quota data
Remove historical quota data
Parameters
$until |
erase records until this timestamp
|
|
#
|
public
|
delete_user($user, bool $force = false)
|
#
|
public
|
delete(string $user, bool $force = false): bool
Delete user
Parameters
$user |
username to delete
|
$force |
bypass sanity checks
|
|
#
|
public
|
_edit()
|
#
|
public
|
_edit_user(string $user, string $usernew, array $oldpwd)
|
#
|
public
|
_create_user(string $user)
|
#
|