[ Index ]
 

Code source de Horde 3.1.3

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

title

Body

[fermer]

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

The parameter name for the logout reason.

Poids: 1302 lignes (43 kb)
Inclus ou requis: 2 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

Auth:: (42 méthodes):
  getDriver()
  authenticate()
  getCryptedPassword()
  getSalt()
  genRandomPassword()
  addUser()
  updateUser()
  removeUser()
  removeUserData()
  listUsers()
  exists()
  transparent()
  isAuthenticated()
  getAuth()
  isPasswordChangeRequested()
  getBareAuth()
  getAuthDomain()
  getCredential()
  setCredential()
  setAuth()
  clearAuth()
  isAdmin()
  addHook()
  removeHook()
  hasCapability()
  getLoginScreen()
  getParam()
  getProvider()
  getLogoutReason()
  getLogoutReasonString()
  addLogoutParameters()
  _getLoginScreen()
  _authenticate()
  _setAuthError()
  _getAuthError()
  _getDriverByParam()
  _checkSessionIP()
  _checkBrowserString()
  _toAPRMD5()
  _bin()
  factory()
  singleton()


Classe: Auth  - X-Ref

The Auth:: class provides a common abstracted interface into the various
backends for the Horde authentication system.

$Horde: framework/Auth/Auth.php,v 1.142.10.23 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.

getDriver()   X-Ref
Returns the name of the concrete Auth implementation.

return: string  The Auth implementation name.

authenticate($userId, $credentials, $login = true, $realm = null)   X-Ref
Finds out if a set of login credentials are valid, and if requested,
mark the user as logged in in the current session.

param: string $userId      The userId to check.
param: array $credentials  The credentials to check.
param: boolean $login      Whether to log the user in. If false, we'll
param: string $realm       The authentication realm to check.
return: boolean  Whether or not the credentials are valid.

getCryptedPassword($plaintext, $salt = '',$encryption = 'md5-hex', $show_encrypt = false)   X-Ref
Formats a password using the current encryption.

param: string $plaintext      The plaintext password to encrypt.
param: string $salt           The salt to use to encrypt the password.
param: string $encryption     The kind of pasword encryption to use.
param: boolean $show_encrypt  Some password systems prepend the kind of
return: string  The encrypted password.

getSalt($encryption = 'md5-hex', $seed = '', $plaintext = '')   X-Ref
Returns a salt for the appropriate kind of password encryption.
Optionally takes a seed and a plaintext password, to extract the seed
of an existing password, or for encryption types that use the plaintext
in the generation of the salt.

param: string $encryption  The kind of pasword encryption to use.
param: string $seed        The seed to get the salt from (probably a
param: string $plaintext   The plaintext password that we're generating
return: string  The generated or extracted salt.

genRandomPassword()   X-Ref
Generates a random, hopefully pronounceable, password. This can be used
when resetting automatically a user's password.

return: string A random password

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

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

updateUser($oldID, $newID, $credentials)   X-Ref
Updates 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.

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

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

removeUserData($userId)   X-Ref
Calls all applications' removeUser API methods.

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

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

return: mixed  The array of userIds, or a PEAR_Error object on failure.

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

param: string $userId User ID for which to check
return: boolean  Whether or not $userId already exists.

transparent()   X-Ref
Automatic authentication: Finds out if the client matches an allowed IP
block.

return: boolean  Whether or not the client is allowed.

isAuthenticated($realm = null)   X-Ref
Checks if there is a session with valid auth information. for the
specified user. If there isn't, but the configured Auth driver supports
transparent authentication, then we try that.

param: string $realm  The authentication realm to check.
return: boolean  Whether or not the user is authenticated.

getAuth()   X-Ref
Returns the currently logged in user, if there is one.

return: mixed  The userId of the current user, or false if no user is

isPasswordChangeRequested()   X-Ref
Return whether the authentication backend requested a password change.

return: boolean Whether the backend requested a password change.

getBareAuth()   X-Ref
Returns the curently logged-in user without any domain information
(e.g., bob@example.com would be returned as 'bob').

return: mixed  The user ID of the current user, or false if no user

getAuthDomain()   X-Ref
Returns the domain of currently logged-in user (e.g., bob@example.com
would be returned as 'example.com').

return: mixed  The domain suffix of the current user, or false.

getCredential($credential)   X-Ref
Returns the requested credential for the currently logged in user, if
present.

param: string $credential  The credential to retrieve.
return: mixed  The requested credential, or false if no user is

setCredential($credential, $value)   X-Ref
Sets the requested credential for the currently logged in user.

param: string $credential  The credential to set.
param: string $value       The value to set the credential to.

setAuth($userId, $credentials, $realm = null, $changeRequested = false)   X-Ref
Sets a variable in the session saying that authorization has succeeded,
note which userId was authorized, and note when the login took place.

If a user name hook was defined in the configuration, it gets applied
to the userId at this point.

param: string $userId            The userId who has been authorized.
param: array $credentials        The credentials of the user.
param: string $realm             The authentication realm to use.
param: boolean $changeRequested  Whether to request that the user change

clearAuth($realm = null)   X-Ref
Clears any authentication tokens in the current session.

param: string $realm  The authentication realm to clear.

isAdmin($permission = null, $permlevel = null, $user = null)   X-Ref
Is the current user an administrator?

param: string $permission  Allow users with this permission admin access
param: integer $permlevel  The level of permissions to check for
param: string $user        The user to check. Defaults to Auth::getAuth().
return: boolean  Whether or not this is an admin user.

addHook($userId)   X-Ref
Applies a hook defined by the function _username_hook_frombackend() to
the given user name if this function exists and user hooks are enabled.

This method should be called if a backend's user name needs to be
converted to a (unique) Horde user name.

param: string $userId  The original user name.
return: string  The user name with the hook applied to it.

removeHook($userId)   X-Ref
Applies a hook defined by the function _username_hook_tobackend() to
the given user name if this function exists and user hooks are enabled.

This method should be called if a Horde user name needs to be converted
to a backend's user name or displayed to the user.

param: string $userId  The Horde user name.
return: string  The user name with the hook applied to it.

hasCapability($capability)   X-Ref
Queries the current Auth object to find out if it supports the given
capability.

param: string $capability  The capability to test for.
return: boolean  Whether or not the capability is supported.

getLoginScreen($app = 'horde', $url = '')   X-Ref
Returns the URI of the login screen for the current authentication
method.

param: string $app  The application to use.
param: string $url  The URL to redirect to after login.
return: string  The login screen URI.

getParam($param)   X-Ref
Returns the named parameter for the current auth driver.

param: string $param  The parameter to fetch.
return: string  The parameter's value.

getProvider($driver = null, $params = null)   X-Ref
Returns the name of the authentication provider.

param: string $driver  Used by recursive calls when untangling composite
param: array  $params  Used by recursive calls when untangling composite
return: string  The name of the driver currently providing

getLogoutReason()   X-Ref
Returns the logout reason.

return: string One of the logout reasons (see the AUTH_LOGOUT_*

getLogoutReasonString()   X-Ref
Returns the status string to use for logout messages.

return: string  The logout reason string.

addLogoutParameters($url, $reason = null, $msg = null)   X-Ref
Generates the correct parameters to pass to the given logout URL.

If no reason/msg is passed in, use the current global authentication
error message.

param: string $url     The URL to redirect to.
param: string $reason  The reason for logout.
param: string $msg     If reason is AUTH_REASON_MESSAGE, the message to
return: string The formatted URL

_getLoginScreen($app = 'horde', $url = '')   X-Ref
Returns the URI of the login screen for this authentication object.

param: string $app  The application to use.
param: string $url  The URL to redirect to after login.
return: string  The login screen URI.

_authenticate()   X-Ref
Authentication stub.

return: boolean  False.

_setAuthError($type, $msg = null)   X-Ref
Sets the error message for an invalid authentication.

param: string $type  The type of error (AUTH_REASON constant).
param: string $msg   The error message/reason for invalid

_getAuthError()   X-Ref
Returns the error type for an invalid authentication or false on error.

return: mixed Error type or false on error

_getDriverByParam($name, $params, $driverparams = array()   X-Ref
Returns the appropriate authentication driver, if any, selecting by the
specified parameter.

param: string $name          The parameter name.
param: array $params         The parameter list.
param: string $driverparams  A list of parameters to pass to the driver.
return: mixed Return value or called user func or null if unavailable

_checkSessionIP()   X-Ref
Pas de description

_checkBrowserString()   X-Ref
Performs check on session to see if browser string has changed since
the last access.

return: boolean  True if browser string is the same, false if the

_toAPRMD5($value, $count)   X-Ref
Converts to allowed 64 characters for APRMD5 passwords.

param: string  $value
param: integer $count
return: string  $value converted to the 64 MD5 characters.

_bin($hex)   X-Ref
Converts hexadecimal string to binary data.

param: string $hex  Hex data.
return: string  Binary data.

factory($driver, $params = null)   X-Ref
Attempts to return a concrete Auth instance based on $driver.

param: mixed $driver  The type of concrete Auth subclass to return. This
param: array $params  A hash containing any additional configuration or
return: Auth  The newly created concrete Auth instance, or false on an

singleton($driver, $params = null)   X-Ref
Attempts to return a reference to a concrete Auth instance based on
$driver. It will only create a new instance if no Auth instance with
the same parameters currently exists.

This should be used if multiple authentication sources (and, thus,
multiple Auth instances) are required.

This method must be invoked as: $var = &Auth::singleton()

param: string $driver  The type of concrete Auth subclass to return.
param: array $params   A hash containing any additional configuration or
return: Auth  The concrete Auth reference, or false on an error.



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