Class Horde_Auth_Sql
The Horde_Auth_Sql class provides a SQL implementation of the Horde
authentication system.
The table structure for the Auth system is in
horde/scripts/sql/horde_users.sql.
Copyright 1999-2012 Horde LLC (http://www.horde.org/)
See the enclosed file COPYING for license information (LGPL). If you did
not receive this file, http://www.horde.org/licenses/lgpl21
-
Horde_Auth_Base
-
Horde_Auth_Sql
Methods summary
public
|
#
__construct( array $params = array() )
Constructor
Parameters
- $params
- <p>Parameters:
'db' - (Horde_Db_Adapter) [REQUIRED] Database object.</p>
<pre><span class="php-quote">'encryption'</span> - (string) The encryption to <span class="php-keyword1">use</span> to store the password in
the table (e.g. plain, <span class="php-keyword2">crypt</span>, <span class="php-keyword2">md5</span>-hex, <span class="php-keyword2">md5</span>-base64, smd5,
sha, ssha, aprmd5).
<span class="php-keyword1">DEFAULT</span>: <span class="php-quote">'md5-hex'</span>
<span class="php-quote">'hard_expiration_field'</span> - (string) The name of the field containing a
<span class="php-keyword2">date</span> after which the account is no longer
valid <span class="php-keyword1">and</span> the user will not be able to <span class="php-keyword2">log</span> in
at all.
<span class="php-keyword1">DEFAULT</span>: none
<span class="php-quote">'password_field'</span> - (string) The name of the password field in the auth
table.
<span class="php-keyword1">DEFAULT</span>: <span class="php-quote">'user_pass'</span>
<span class="php-quote">'show_encryption'</span> - (boolean) Whether <span class="php-keyword1">or</span> not to prepend the encryption
in the password field.
<span class="php-keyword1">DEFAULT</span>: <span class="php-keyword1">false</span>
<span class="php-quote">'soft_expiration_field'</span> - (string) The name of the field containing a
<span class="php-keyword2">date</span> after which the <span class="php-keyword2">system</span> will request the
user change his <span class="php-keyword1">or</span> her password.
<span class="php-keyword1">DEFAULT</span>: none
<span class="php-quote">'table'</span> - (string) The name of the SQL table to <span class="php-keyword1">use</span> in <span class="php-quote">'database'</span>.
<span class="php-keyword1">DEFAULT</span>: <span class="php-quote">'horde_users'</span>
<span class="php-quote">'username_field'</span> - (string) The name of the username field in the auth
table.
<span class="php-keyword1">DEFAULT</span>: <span class="php-quote">'user_uid'</span></pre>
Throws
InvalidArgumentException
Overrides
|
public
|
#
addUser( string $userId, array $credentials )
Add a set of authentication credentials.
Add a set of authentication credentials.
Parameters
- $userId
- The userId to add.
- $credentials
- The credentials to add.
Throws
Overrides
|
public
|
#
updateUser( string $oldID, string $newID, array $credentials )
Update a set of authentication credentials.
Update a set of authentication credentials.
Parameters
- $oldID
- The old userId.
- $newID
- The new userId.
- $credentials
- The new credentials
Throws
Overrides
|
public
string
|
#
resetPassword( string $userId )
Reset a user's password. Used for example when the user does not
remember the existing password.
Reset a user's password. Used for example when the user does not
remember the existing password.
Parameters
- $userId
- The user id for which to reset the password.
Returns
string The new password on success.
Throws
Overrides
|
public
|
#
removeUser( string $userId )
Delete a set of authentication credentials.
Delete a set of authentication credentials.
Parameters
- $userId
- The userId to delete.
Throws
Overrides
|
public
array
|
#
listUsers( mixed $sort = false )
List all users in the system.
List all users in the system.
Returns
array The array of userIds.
Throws
Overrides
|
public
boolean
|
#
exists( string $userId )
Checks if a userId exists in the system.
Checks if a userId exists in the system.
Parameters
- $userId
- User ID for which to check
Returns
boolean Whether or not the userId already exists.
Overrides
|
Methods inherited from Horde_Auth_Base
authenticate(),
getCredential(),
getError(),
getParam(),
hasCapability(),
isLocked(),
lockUser(),
setCredential(),
setError(),
transparent(),
unlockUser(),
validateAuth()
|