PHP Class Horde_Auth_Customsql, horde

Author: Ronnie Garcia ([email protected])
Author: Chuck Hagenbuch ([email protected])
Author: Joel Vandal ([email protected])
Inheritance: extends Horde_Auth_Sql
Mostrar archivo Open project: horde/horde

Protected Properties

Property Type Description
$_capabilities array An array of capabilities, so that the driver can report which operations it supports and which it doesn't.

Public Methods

Method Description
__construct ( array $params = [] ) Constructor.
addUser ( string $userId, array $credentials ) Add a set of authentication credentials.
exists ( string $userId ) : boolean Checks if a userId exists in the system.
listUsers ( boolean $sort = false ) : array Lists all users in the system.
removeUser ( string $userId ) Delete a set of authentication credentials.
resetPassword ( string $userId ) : string Resets 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.

Protected Methods

Method Description
_authenticate ( string $userId, array $credentials ) Find out if a set of login credentials are valid.
_getPassword ( string $userId ) : string Fetch $userId's current password - needed for the salt with some encryption schemes when doing authentication or updates.

Method Details

__construct() public method

Some special tokens can be used in the SQL query. They are replaced at the query stage: '\L' will be replaced by the user's login '\P' will be replaced by the user's password. '\O' will be replaced by the old user's login (required for update) Eg: "SELECT * FROM users WHERE uid = \L AND passwd = \P AND billing = 'paid'"
public __construct ( array $params = [] )
$params array Configuration parameters: - query_auth: (string) Authenticate the user. ('\L' & '\P') - query_add: (string) Add user. ('\L' & '\P') - query_getpw: (string) Get one user's password. ('\L') - query_update: (string) Update user. ('\O', '\L' & '\P') - query_resetpassword: (string) Reset password. ('\L', & '\P') - query_remove: (string) Remove user. ('\L') - query_list: (string) List user. - query_exists: (string) Check for existance of user. ('\L')

_authenticate() protected method

Find out if a set of login credentials are valid.
protected _authenticate ( string $userId, array $credentials )
$userId string The userId to check.
$credentials array The credentials to use.

_getPassword() protected method

Fetch $userId's current password - needed for the salt with some encryption schemes when doing authentication or updates.
protected _getPassword ( string $userId ) : string
$userId string The userId to query.
return string $userId's current password.

addUser() public method

Add a set of authentication credentials.
public addUser ( string $userId, array $credentials )
$userId string The userId to add.
$credentials array The credentials to add.

exists() public method

Checks if a userId exists in the system.
public exists ( string $userId ) : boolean
$userId string User ID for which to check
return boolean Whether or not the userId already exists.

listUsers() public method

Lists all users in the system.
public listUsers ( boolean $sort = false ) : array
$sort boolean Sort the users?
return array The array of userIds.

removeUser() public method

Delete a set of authentication credentials.
public removeUser ( string $userId )
$userId string The userId to delete.

resetPassword() public method

Resets a user's password. Used for example when the user does not remember the existing password.
public resetPassword ( string $userId ) : string
$userId string The user id for which to reset the password.
return string The new password on success.

updateUser() public method

Update a set of authentication credentials.
public updateUser ( string $oldId, string $newId, array $credentials )
$oldId string The old userId.
$newId string The new userId.
$credentials array The new credentials

Property Details

$_capabilities protected_oe property

An array of capabilities, so that the driver can report which operations it supports and which it doesn't.
protected array $_capabilities
return array