PHP 클래스 Horde_Auth_Sql, horde

The table structure for the Auth system needs to be created with the shipped migration scripts. See "horde-db-migrate-component --help" for details.
저자: Chuck Hagenbuch ([email protected])
상속: extends Horde_Auth_Base
파일 보기 프로젝트 열기: horde/horde 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_capabilities array An array of capabilities, so that the driver can report which operations it supports and which it doesn't.
$_db Horde_Db_Adapter Handle for the current database connection.

공개 메소드들

메소드 설명
__construct ( array $params = [] ) Constructor
addUser ( string $userId, array $credentials ) Add a set of authentication credentials.
exists ( string $userId ) : boolean Checks if a userId exists in the system.
listUsers ( boolean $sort = false ) : array List all users in the system.
removeUser ( string $userId ) Delete a set of authentication credentials.
resetPassword ( string $userId ) : string Reset a user's password. Used for example when the user does not remember the existing password.
updateUser ( string $oldID, string $newID, array $credentials ) Update a set of authentication credentials.

보호된 메소드들

메소드 설명
_authenticate ( string $userId, array $credentials ) Find out if a set of login credentials are valid.
_comparePasswords ( string $encrypted, string $plaintext ) : boolean Compare an encrypted password to a plaintext string to see if they match.

비공개 메소드들

메소드 설명
_calc_expiration ( string $type ) : integer Calculate a timestamp and return it along with the field name

메소드 상세

__construct() 공개 메소드

Constructor
public __construct ( array $params = [] )
$params array Parameters: 'db' - (Horde_Db_Adapter) [REQUIRED] Database object.
'encryption' - (string) 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'
'hard_expiration_field' - (string) 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
'password_field' - (string) The name of the password field in the auth
                   table.
                   DEFAULT: 'user_pass'
'show_encryption' - (boolean) Whether or not to prepend the encryption
                    in the password field.
                    DEFAULT: false
'soft_expiration_field' - (string) The name of the field containing a
                          date after which the system will request the
                          user change his or her password.
                          DEFAULT: none
'table' - (string) The name of the SQL table to use in 'database'.
          DEFAULT: 'horde_users'
'username_field' - (string) The name of the username field in the auth
                   table.
                   DEFAULT: 'user_uid'

_authenticate() 보호된 메소드

Find out if a set of login credentials are valid.
protected _authenticate ( string $userId, array $credentials )
$userId string The userId to check.
$credentials array The credentials to use.

_comparePasswords() 보호된 메소드

Compare an encrypted password to a plaintext string to see if they match.
protected _comparePasswords ( string $encrypted, string $plaintext ) : boolean
$encrypted string The crypted password to compare against.
$plaintext string The plaintext password to verify.
리턴 boolean True if matched, false otherwise.

addUser() 공개 메소드

Add a set of authentication credentials.
public addUser ( string $userId, array $credentials )
$userId string The userId to add.
$credentials array The credentials to add.

exists() 공개 메소드

Checks if a userId exists in the system.
public exists ( string $userId ) : boolean
$userId string User ID for which to check
리턴 boolean Whether or not the userId already exists.

listUsers() 공개 메소드

List all users in the system.
public listUsers ( boolean $sort = false ) : array
$sort boolean Sort the users?
리턴 array The array of userIds.

removeUser() 공개 메소드

Delete a set of authentication credentials.
public removeUser ( string $userId )
$userId string The userId to delete.

resetPassword() 공개 메소드

Reset a user's password. Used for example when the user does not remember the existing password.
public resetPassword ( string $userId ) : string
$userId string The user id for which to reset the password.
리턴 string The new password on success.

updateUser() 공개 메소드

Update a set of authentication credentials.
public updateUser ( string $oldID, string $newID, array $credentials )
$oldID string The old userId.
$newID string The new userId.
$credentials array The new credentials

프로퍼티 상세

$_capabilities 보호되어 있는 프로퍼티

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

$_db 보호되어 있는 프로퍼티

Handle for the current database connection.
protected Horde_Db_Adapter $_db
리턴 Horde_Db_Adapter