OpenMediaVault  3.0 (Erasmus)
The open network attached storage solution
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
OMV\System\User Class Reference

Public Member Functions

 __construct ($id)
 
 exists ()
 
 assertExists ()
 
 assertNotExists ()
 
 getName ()
 
 getUid ()
 
 getGid ()
 
 getGecos ()
 
 getHomeDirectory ()
 
 getShell ()
 
 getPassword ()
 
 getLastChanged ()
 
 getMinimum ()
 
 getMaximum ()
 
 getWarn ()
 
 getInactive ()
 
 getExpire ()
 
 getReserved ()
 
 getGroups ()
 
 getQuotas ()
 
 authenticate ($password)
 
 isSystemAccount ()
 

Static Public Member Functions

static getUsers ()
 

Protected Attributes

 $name = null
 
 $uid = null
 
 $gid = null
 
 $password = null
 
 $gecos = null
 
 $dir = null
 
 $shell = null
 
 $lastchanged = null
 
 $minimum = null
 
 $maximum = null
 
 $warn = null
 
 $inactive = null
 
 $expire = null
 
 $reserved = null
 
 $groups = null
 

Detailed Description

This class provides a simple interface to handle a system user.

Constructor & Destructor Documentation

OMV\System\User::__construct (   $id)

Constructor

Parameters
idThe name or UID of the system user.

Member Function Documentation

OMV\System\User::assertExists ( )

Assert that the system user exists.

Exceptions
OMV\System\User::assertNotExists ( )

Assert that the system user not exists.

Exceptions
OMV\System\User::authenticate (   $password)

Authenticate user via PAM. Account expiration and access hours are checked, too. Note, the calling process must have the privilege to read the user shadow file.

Parameters
passwordThe password.
Returns
TRUE if the authentication was successful, otherwise FALSE.
OMV\System\User::exists ( )

Check whether the system user exists.

Returns
TRUE if the system user exists, otherwise FALSE.
OMV\System\User::getGecos ( )

Get the comment.

Returns
The comment, otherwise FALSE.
OMV\System\User::getGid ( )

Get the users group ID.

Returns
The user group ID, otherwise FALSE.
OMV\System\User::getGroups ( )

Get the groups the user is in.

Returns
An array of groups the user is in, otherwise FALSE.
OMV\System\User::getHomeDirectory ( )

Get the home directory.

Returns
The home directory, otherwise FALSE.
OMV\System\User::getName ( )

Get the user name.

Returns
The user name.
OMV\System\User::getPassword ( )

Get the encrypted password.

Returns
The encrypted password, otherwise FALSE.
OMV\System\User::getQuotas ( )

Get the user quotas.

Returns
An array containing the quotas.
Exceptions
OMV\System\User::getShell ( )

Get the shell.

Returns
The shell, otherwise FALSE.
OMV\System\User::getUid ( )

Get the user ID.

Returns
The user ID, otherwise FALSE.
static OMV\System\User::getUsers ( )
static

Enumerate user names.

Returns
An array of user names.
Exceptions
OMV\System\User::isSystemAccount ( )

Check if the given user is a system account.

Returns
TRUE if the user is a system account, otherwise FALSE.

The documentation for this class was generated from the following file: