Свойство | Тип | Описание | |
---|---|---|---|
$_capabilities | array | An array of capabilities, so that the driver can report which operations it supports and which it doesn't. | |
$_exclude | array | List of users that should be excluded from being listed/handled in any way by this driver. | |
$_fplock | resource | Filehandle for lockfile. | |
$_groups | array | Array of groups and members. | |
$_locked | boolean | Locking state. | |
$_users | array | Hash list of users. |
Метод | Описание | |
---|---|---|
__construct ( array $params = [] ) | Constructor. | |
__destruct ( ) | Writes changes to passwd file and unlocks it. Takes no arguments and has no return value. Called on script shutdown. | |
addUser ( string $userId, array $credentials ) | Add a set of authentication credentials. | |
hasCapability ( string $capability ) : boolean | Queries the current Auth object to find out if it supports the given capability. | |
listUsers ( boolean $sort = false ) : array | Lists all users in the system. | |
removeUser ( string $userId ) | Delete a set of authentication credentials. | |
resetPassword ( string $userId ) : string | Reset a user's password. Used for example when the user does not remember the existing password. | |
updateUser ( string $oldID, string $newID, array $credentials ) | Update a set of authentication credentials. |
Метод | Описание | |
---|---|---|
_authenticate ( string $userId, array $credentials ) | Find out if a set of login credentials are valid. | |
_comparePasswords ( string $encrypted, string $plaintext ) : boolean | Compare an encrypted password to a plaintext string to see if they match. | |
_read ( ) | Read and, if requested, lock the password file. |
public __construct ( array $params = [] ) | ||
$params | array | Connection parameters:
'encryption' - (string) The encryption to use to store the password in the table (e.g. plain, crypt, md5-hex, md5-base64, smd5, sha, ssha, aprmd5). DEFAULT: 'crypt-des' 'filename' - (string) [REQUIRED] The passwd file to use. 'lock' - (boolean) Should we lock the passwd file? The password file cannot be changed (add, edit, or delete users) unless this is true. DEFAULT: false 'show_encryption' - (boolean) Whether or not to prepend the encryption in the password field. DEFAULT: false |
public __destruct ( ) |
protected _authenticate ( string $userId, array $credentials ) | ||
$userId | string | The userId to check. |
$credentials | array | An array of login credentials. |
public hasCapability ( string $capability ) : boolean | ||
$capability | string | The capability to test for. |
Результат | boolean | Whether or not the capability is supported. |
public removeUser ( string $userId ) | ||
$userId | string | The userId to delete. |
public resetPassword ( string $userId ) : string | ||
$userId | string | The user id for which to reset the password. |
Результат | string | The new password. |
protected array $_capabilities | ||
Результат | array |
protected array $_exclude | ||
Результат | array |
protected resource $_fplock | ||
Результат | resource |