[ Index ]
 

Code source de Horde 3.1.3

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

title

Body

[fermer]

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

(pas de description)

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

Définit 1 class

Auth_customsql:: (7 méthodes):
  Auth_customsql()
  _authenticate()
  addUser()
  updateUser()
  resetPassword()
  removeUser()
  listUsers()


Classe: Auth_customsql  - X-Ref

The Auth_customsql class provides a sql implementation of the Horde
authentication system with the possibility to set custom-made queries.

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

Required parameters: (Custom query)<pre>
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'

'query_auth'    Authenticate the user.       '\L' & '\N'
'query_add'     Add user.                    '\L' & '\N'
'query_update'  Update user.                 '\O', '\L' & '\N'
'query_resetpassword'  Reset password.       '\L', & '\P'
'query_remove'  Remove user.                 '\L'
'query_list'    List user.                   '\L'</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).
DEFAULT: 'md5-hex'
'show_encryption'  Whether or not to prepend the encryption in the
password field.
DEFAULT: 'false'</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>


$Horde: framework/Auth/Auth/customsql.php,v 1.16.10.8 2005/11/30 00:03:39 jan Exp $

Copyright 2002 Ronnie Garcia <ronnie@mk2.net>

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_customsql($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
Resets 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.



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