User_Module

User-specific functions and user creation
extends Module\Skeleton\Standard implements Opcenter\Contracts\Hookable
Methods Summary
public
# change_quota( string $user , int $diskquota , int $filequota = 0 )
Change disk and file count quotas for a given user
public
# exists( string $user )
Checks for existence of user
public
# get_uid_from_username( $username )
public
# getpwnam( string $user = NULL )
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 = array ( ) )
Add user

Deprecated


public
# add( $user , $password , string $gecos = '', int $quota = 0, array $options = array ( ) )
public
# get_users( )
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( )
Get shells valid for account /bin/false blocks access via PAM controlled services
public
# flush( )
Flush account user cache
public
# get_user_home( $user = NULL )
public
# get_home( $user = NULL )
public
public
# rename_user( string $user , string $newuser )
Change username in the system
public
# usermod_driver( string $user , array $attributes )
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

private


public
# get_quota_history( string $mUser , int $mBegin = 0, int $mEnd = NULL )
array get_quota_history(string[, int = 0[, int = 0]])
public
# get_quota( mixed $users = NULL )
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

see

public
# change_gecos( string $user , string $gecos = NULL )
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.
public
public
# generate_quota_list( string $user = '', string $base = '/{home,usr/local,var/www,var/lib,var/log}', bool $sort = true )
Generate a list of files contributing towards the account quota Upon successful generation, the list is stored under ~/filelist-<PANEL_BRAND>.txt
public
# sgroupdel( string $group )
Remove a supplemental group
public
# sgroups( )
List supplemental groups
public
# sgroupadd( string $group )
Add a supplemental group
public
# _verify_conf( Opcenter\Service\ConfigurationContext $ctx )
public
public
public
public
# enrollment( string $user )
Get list of services for which user is enabled
public
# erase_quota_history( string $user , int $until = -1 )
Remove historical quota data
public
# delete_user( $user )

Deprecated


public
# delete( $user )
public
public
# _edit_user( string $user , string $usernew , array $oldpwd )
public
Methods inherited from Module\Skeleton\Standard
__construct(), setUserParameters(), autoloadModule(), __wakeup(), _invoke(), __debugInfo(), getExportedFunctions(), _reset(), cleanUserParameters(), query()
Constants Summary
public array DEPENDENCY_MAP
# array ( 0 => 'siteinfo', 1 => 'apache', )
public int MIN_UID
# 1000
public int VIRT_MIN_UID
# 20000
public int USER_MAXLEN
# 32
Constants inherited from Module\Skeleton\Standard
DEPENDENCY_MAP
Properties Summary
protected $uid_mappings

# array ( )
protected $exportedFunctions

# array ( '*' => 2, 'flush' => 3, 'get_user_home' => 15, 'get_home' => 15, 'get_users' => 3, 'change_gecos' => 3, 'get_uid_from_username' => 3, 'get_username_from_uid' => 15, 'exists' => 3, 'get_quota' => 3, 'getpwnam' => 3, )
Properties inherited from Module\Skeleton\Standard
$exportedFunctions, $username, $password, $domain, $user_id, $group_id, $permission_level, $session_id, $site, $site_id