Class Auth_customsql

Description

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

Required parameters:

   'phptype'  The database type (ie. 'pgsql', 'mysql', etc.).

Required parameters: (Custom query)

 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' & '\P'
   'query_add'     Add user.                    '\L' & '\P'
   'query_getpw'   Get one user's password.     '\L'
   'query_update'  Update user.                 '\O', '\L' & '\P'
   'query_resetpassword'  Reset password.       '\L', & '\P'
   'query_remove'  Remove user.                 '\L'
   'query_list'    List user.
   'query_exists'  Check for existance of user. '\L'

Optional parameters:

   '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'

Required by some database implementations:

   '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.

$Horde: framework/Auth/Auth/customsql.php,v 1.16.10.12 2008/06/30 17:04:36 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://opensource.org/licenses/lgpl-license.php.

Located in /Auth/Auth/customsql.php (line 66)

Auth
   |
   --Auth_sql
      |
      --Auth_customsql
Variable Summary
Method Summary
 Auth_customsql Auth_customsql ([array $params = array()])
 mixed addUser (string $userId, array $credentials)
 boolean exists ( $userId)
 mixed listUsers ()
 boolean removeUser (string $userId)
 mixed resetPassword (string $userId)
 mixed updateUser (string $oldId, string $newId, array $credentials)
 string _getPassword (string $userId)
Variables
array $capabilities = array('add' => true,
'update' => true,
'resetpassword' => true,
'remove' => true,
'list' => true,
'transparent' => false)
(line 74)

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


Redefinition of:
Auth_sql::$capabilities
An array of capabilities, so that the driver can report which operations it supports and which it doesn't.

Inherited Variables

Inherited from Auth_sql

Auth_sql::$_connected
Auth_sql::$_db
Auth_sql::$_write_db

Inherited from Auth

Auth::$_authCredentials
Auth::$_params
Methods
Constructor Auth_customsql (line 86)

Constructs a new SQL authentication object.

Auth_customsql Auth_customsql ([array $params = array()])
  • array $params: A hash containing connection parameters.
addUser (line 148)

Add a set of authentication credentials.

  • return: True on success or a PEAR_Error object on failure.
mixed addUser (string $userId, array $credentials)
  • string $userId: The userId to add.
  • array $credentials: The credentials to add.

Redefinition of:
Auth_sql::addUser()
Add a set of authentication credentials.
exists (line 296)

Checks if a userId exists in the system.

  • return: Whether or not the userId already exists.
boolean exists ( $userId)
  • $userId

Redefinition of:
Auth_sql::exists()
Checks if a userId exists in the system.
listUsers (line 267)

List all users in the system.

  • return: The array of userIds, or false on failure/unsupported.
mixed listUsers ()

Redefinition of:
Auth_sql::listUsers()
List all users in the system.
removeUser (line 244)

Delete a set of authentication credentials.

  • return: Success or failure.
boolean removeUser (string $userId)
  • string $userId: The userId to delete.

Redefinition of:
Auth_sql::removeUser()
Delete a set of authentication credentials.
resetPassword (line 212)

Resets a user's password. Used for example when the user does not remember the existing password.

  • return: The new password on success or a PEAR_Error object on failure.
mixed resetPassword (string $userId)
  • string $userId: The user id for which to reset the password.

Redefinition of:
Auth_sql::resetPassword()
Reset a user's password. Used for example when the user does not remember the existing password.
updateUser (line 179)

Update a set of authentication credentials.

  • return: True on success or a PEAR_Error object on failure.
mixed updateUser (string $oldId, string $newId, array $credentials)
  • string $oldId: The old userId.
  • string $newId: The new userId.
  • array $credentials: The new credentials

Redefinition of:
Auth_sql::updateUser()
Update a set of authentication credentials.
_getPassword (line 322)

Fetch $userId's current password - needed for the salt with some encryption schemes when doing authentication or updates.

  • return: current password.
string _getPassword (string $userId)
  • string $userId

Inherited Methods

Inherited From Auth_sql

 Auth_sql::Auth_sql()
 Auth_sql::addUser()
 Auth_sql::exists()
 Auth_sql::listUsers()
 Auth_sql::removeUser()
 Auth_sql::resetPassword()
 Auth_sql::updateUser()

Inherited From Auth

 Auth::addHook()
 Auth::addLogoutParameters()
 Auth::addUser()
 Auth::authenticate()
 Auth::clearAuth()
 Auth::exists()
 Auth::factory()
 Auth::genRandomPassword()
 Auth::getAuth()
 Auth::getAuthDomain()
 Auth::getBareAuth()
 Auth::getCredential()
 Auth::getCryptedPassword()
 Auth::getDriver()
 Auth::getLoginScreen()
 Auth::getLogoutReason()
 Auth::getLogoutReasonString()
 Auth::getParam()
 Auth::getProvider()
 Auth::getSalt()
 Auth::hasCapability()
 Auth::isAdmin()
 Auth::isAuthenticated()
 Auth::isPasswordChangeRequested()
 Auth::listUsers()
 Auth::readSessionData()
 Auth::removeHook()
 Auth::removeUser()
 Auth::removeUserData()
 Auth::setAuth()
 Auth::setCredential()
 Auth::singleton()
 Auth::transparent()
 Auth::updateUser()
 Auth::_authenticate()
 Auth::_isAdmin()

Documentation generated on Sun, 30 Jan 2011 05:16:11 +0000 by phpDocumentor 1.4.3