Class Auth_sql

Description

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

Required parameters:

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

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

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.

Optional values when using separate read and write servers, for example in replication settings:

   'splitread'   Boolean, whether to implement the separation or not.
   'read'        Array containing the parameters which are different for
                 the read database connection, currently supported
                 only 'hostspec' and 'port' parameters.

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

$Horde: framework/Auth/Auth/sql.php,v 1.69.10.25 2009/02/25 05:35:41 chuck Exp $

Copyright 1999-2009 The Horde Project (http://www.horde.org/)

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/sql.php (line 63)

Auth
   |
   --Auth_sql
Direct descendents
Class Description
 class Auth_customsql The Auth_customsql class provides a sql implementation of the Horde authentication system with the possibility to set custom-made queries.
 class Auth_cyrsql The Auth_cyrsql class provides a SQL implementation of the Horde authentication system for the Cyrus IMAP server. Most of the functionality is the same as for the SQL class; only what is different overrides the parent class implementations.
Variable Summary
Method Summary
 Auth_sql Auth_sql ([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)
Variables
array $capabilities = array('add' => true,
'update' => true,
'resetpassword' => true,
'remove' => true,
'list' => true,
'transparent' => false)
(line 71)

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


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

Redefined in descendants as:
boolean $_connected = false (line 98)

Boolean indicating whether or not we're connected to the SQL server.

DB $_db (line 83)

Handle for the current database connection.

DB $_write_db (line 91)

Handle for the current database connection, used for writing. Defaults to the same handle as $_db if a separate write database is not required.

Inherited Variables

Inherited from Auth

Auth::$_authCredentials
Auth::$_params
Methods
Constructor Auth_sql (line 105)

Constructs a new SQL authentication object.

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

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::addUser()
Adds a set of authentication credentials.

Redefined in descendants as:
exists (line 377)

Checks if a userId exists in the system.

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

Redefinition of:
Auth::exists()
Checks if $userId exists in the system.

Redefined in descendants as:
listUsers (line 356)

List all users in the system.

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

Redefinition of:
Auth::listUsers()
Lists all users in the system.

Redefined in descendants as:
removeUser (line 329)

Delete a set of authentication credentials.

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

Redefinition of:
Auth::removeUser()
Deletes a set of authentication credentials.

Redefined in descendants as:
resetPassword (line 292)

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

Redefined in descendants as:
updateUser (line 218)

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::updateUser()
Updates a set of authentication credentials.

Redefined in descendants as:

Inherited Methods

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:21:59 +0000 by phpDocumentor 1.4.3