User_Module

+------------------------------------------------------------+ | apnscp | +------------------------------------------------------------+ | Copyright (c) Apis Networks | +------------------------------------------------------------+ | Licensed under Artistic License 2.0 | +------------------------------------------------------------+ | Author: Matt Saladna (msaladna@apisnetworks.com) | +------------------------------------------------------------+
extends Module\Skeleton\Standard implements Opcenter\Contracts\Hookable
Methods Summary
public
# __construct( )
void __construct(void)

ignore


Overrides

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( array $user , $password , $gecos = '', $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_user_home( $user = NULL )
public
# get_home( $user = NULL )
public
public
# delete_user( $user )
public
# rename_user( string $user , string $newuser )
Change username in the system
public
# flush( )
Flush account user cache
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
# find_quota_files( 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
# 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
# _verify_conf( Opcenter\Service\ConfigurationContext $ctx )
public
public
public
public
public
# _edit_user( string $user , string $usernew , array $oldpwd )
public
Methods inherited from Module\Skeleton\Standard
__construct(), set_user_parameters(), clean_user_parameters(), set_session_id(), _invoke(), __debugInfo(), getExportedFunctions(), _reset(), get_service_names(), get_services(), get_new_services(), get_active_services(), get_config(), get_service_value(), set_config_journal(), set_config(), query(), _resetModule()
Constants Summary
public array DEPENDENCY_MAP
# array ( 0 => 'siteinfo', 1 => 'apache', )
public int MIN_UID
# 1000
Constants inherited from Module\Skeleton\Standard
DEPENDENCY_MAP
Properties Summary
protected static $uid_mappings
# array ( )
Properties inherited from Module\Skeleton\Standard
$exportedFunctions, $username, $password, $domain, $user_id, $group_id, $permission_level, $session_id, $site, $site_id, $pgsql, $mysql