[ Index ]
 

Code source de Horde 3.1.3

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/lib/Horde/Auth/ -> sql.php (sommaire)

(pas de description)

Poids: 457 lignes (17 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

Auth_sql:: (10 méthodes):
  Auth_sql()
  _authenticate()
  addUser()
  updateUser()
  resetPassword()
  removeUser()
  listUsers()
  exists()
  _comparePasswords()
  _connect()


Classe: Auth_sql  - X-Ref

The Auth_sql class provides a SQL implementation of the Horde
authentication system.

Required parameters:<pre>
'phptype'      The database type (ie. 'pgsql', 'mysql', etc.).</pre>

Optional parameters:<pre>
'encryption'             The encryption to use to store the password in
the table (e.g. plain, crypt, md5-hex,
md5-base64, smd5, sha, ssha, aprmd5).
DEFAULT: 'md5-hex'
'show_encryption'        Whether or not to prepend the encryption in the
password field.
DEFAULT: 'false'
'password_field'         The name of the password field in the auth table.
DEFAULT: 'user_pass'
'table'                  The name of the SQL table to use in 'database'.
DEFAULT: 'horde_users'
'username_field'         The name of the username field in the auth table.
DEFAULT: 'user_uid'
'soft_expiration_field'  The name of the field containing a date after
which the system will request the user change his
or her password.
DEFAULT: none
'hard_expiration_field'  The name of the field containing a date after
which the account is no longer valid and the user
will not be able to log in at all.
DEFAULT: none</pre>

Required by some database implementations:<pre>
'hostspec'     The hostname of the database server.
'protocol'     The communication protocol ('tcp', 'unix', etc.).
'database'     The name of the database.
'username'     The username with which to connect to the database.
'password'     The password associated with 'username'.
'options'      Additional options to pass to the database.
'port'         The port on which to connect to the database.
'tty'          The TTY on which to connect to the database.</pre>

The table structure for the Auth system is in
scripts/sql/horde_users.sql.

$Horde: framework/Auth/Auth/sql.php,v 1.69.10.19 2006/08/14 02:48:48 chuck Exp $

Copyright 1999-2006 Chuck Hagenbuch <chuck@horde.org>

See the enclosed file COPYING for license information (LGPL). If you
did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.

Auth_sql($params = array()   X-Ref
Constructs a new SQL authentication object.

param: array $params  A hash containing connection parameters.

_authenticate($userId, $credentials)   X-Ref
Find out if a set of login credentials are valid.

param: string $userId      The userId to check.
param: array $credentials  The credentials to use.
return: boolean  Whether or not the credentials are valid.

addUser($userId, $credentials)   X-Ref
Add a set of authentication credentials.

param: string $userId      The userId to add.
param: array $credentials  The credentials to add.
return: mixed  True on success or a PEAR_Error object on failure.

updateUser($oldID, $newID, $credentials)   X-Ref
Update a set of authentication credentials.

param: string $oldID        The old userId.
param: string $newID        The new userId.
param: array  $credentials  The new credentials
return: mixed  True on success or a PEAR_Error object on failure.

resetPassword($user_id)   X-Ref
Reset a user's password. Used for example when the user does not
remember the existing password.

param: string $user_id  The user id for which to reset the password.
return: mixed  The new password on success or a PEAR_Error object on

removeUser($userId)   X-Ref
Delete a set of authentication credentials.

param: string $userId  The userId to delete.
return: boolean        Success or failure.

listUsers()   X-Ref
List all users in the system.

return: mixed  The array of userIds, or false on failure/unsupported.

exists($userId)   X-Ref
Checks if a userId exists in the sistem.

return: boolean  Whether or not the userId already exists.

_comparePasswords($encrypted, $plaintext)   X-Ref
Compare an encrypted password to a plaintext string to see if
they match.

param: string $encrypted  The crypted password to compare against.
param: string $plaintext  The plaintext password to verify.
return: boolean  True if matched, false otherwise.

_connect()   X-Ref
Attempts to open a connection to the SQL server.

return: mixed  True on success or a PEAR_Error object on failure.



Généré le : Sun Feb 25 18:01:28 2007 par Balluche grâce à PHPXref 0.7