PHP 클래스 Kimai_Auth_Abstract

The order of the functions is closely related to the order they are called. First it is checked if automatic login is possible with this method. If so it is tried via the performAutoLogin function. When a user provides credentials the authenticate function is called.
저자: sl
저자: Kevin Papst
파일 보기 프로젝트 열기: kimai/kimai 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$database Kimai_Database_Mysql
$kga Kimai_Config

공개 메소드들

메소드 설명
__construct ( Kimai_Database_Mysql $database = null, Kimai_Config $kga = null )
authenticate ( string $username, string $plainPassword, integer &$userId ) : boolean Authenticate a combination of username and password. Both is given as the user wrote it into the input fields.
autoLoginPossible ( ) : boolean Decides whether this authentication method should be used to authenticate users before they have provided any credentials.
getDefaultGlobalRole ( ) : integer Return an ID of a global role to which users should be added, if they authenticated but are not known to Kimai.
getDefaultGroups ( ) : array Return a map from group IDs to membership role IDs to which users should be added, if they authenticated but are not known to Kimai.
performAutoLogin ( integer &$userId ) : boolean Try to authenticate the user before he sees the login page.
setDatabase ( Kimai_Database_Mysql $database )
setKga ( Kimai_Config $kga )

보호된 메소드들

메소드 설명
getDatabase ( ) : Kimai_Database_Mysql
getKga ( ) : Kimai_Config
setConfig ( $key, $value ) Set one config value.

메소드 상세

__construct() 공개 메소드

public __construct ( Kimai_Database_Mysql $database = null, Kimai_Config $kga = null )
$database Kimai_Database_Mysql
$kga Kimai_Config

authenticate() 추상적인 공개 메소드

Authenticate a combination of username and password. Both is given as the user wrote it into the input fields.
abstract public authenticate ( string $username, string $plainPassword, integer &$userId ) : boolean
$username string name of the user who wants to authenticate
$plainPassword string password in plaintext the user has provided
$userId integer user id. If none exists it will be false
리턴 boolean either true if the credentials were correct, or false otherwise

autoLoginPossible() 공개 메소드

This allows users to be logged in automatically. Mostly used with SSO (single sign on) solutions.
public autoLoginPossible ( ) : boolean
리턴 boolean true if this authentication method can login users without credentials, false otherwise

getDatabase() 보호된 메소드

protected getDatabase ( ) : Kimai_Database_Mysql
리턴 Kimai_Database_Mysql

getDefaultGlobalRole() 공개 메소드

The default implementation uses the first role or, if present, a role called 'User'.
public getDefaultGlobalRole ( ) : integer
리턴 integer global role ID

getDefaultGroups() 공개 메소드

The default implementation uses the second group and and a membership role named 'User', otherwise the first one it can find.
public getDefaultGroups ( ) : array
리턴 array id of the group to add the user to

getKga() 보호된 메소드

protected getKga ( ) : Kimai_Config
리턴 Kimai_Config

performAutoLogin() 공개 메소드

Try to authenticate the user before he sees the login page.
public performAutoLogin ( integer &$userId ) : boolean
$userId integer user id. If none exists it will be false
리턴 boolean either true if the user could be authenticated or false otherwise

setConfig() 보호된 메소드

By default it uses instance properties.
protected setConfig ( $key, $value )
$key
$value

setDatabase() 공개 메소드

public setDatabase ( Kimai_Database_Mysql $database )
$database Kimai_Database_Mysql

setKga() 공개 메소드

public setKga ( Kimai_Config $kga )
$kga Kimai_Config

프로퍼티 상세

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

protected Kimai_Database_Mysql $database
리턴 Kimai_Database_Mysql

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

protected Kimai_Config $kga
리턴 Kimai_Config