PHP Class 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.
Author: sl
Author: Kevin Papst
Afficher le fichier Open project: kimai/kimai Class Usage Examples

Protected Properties

Свойство Type Description
$database Kimai_Database_Mysql
$kga Kimai_Config

Méthodes publiques

Méthode Description
__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 )

Méthodes protégées

Méthode Description
getDatabase ( ) : Kimai_Database_Mysql
getKga ( ) : Kimai_Config
setConfig ( $key, $value ) Set one config value.

Method Details

__construct() public méthode

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

authenticate() abstract public méthode

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
Résultat boolean either true if the credentials were correct, or false otherwise

autoLoginPossible() public méthode

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

getDatabase() protected méthode

protected getDatabase ( ) : Kimai_Database_Mysql
Résultat Kimai_Database_Mysql

getDefaultGlobalRole() public méthode

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

getDefaultGroups() public méthode

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

getKga() protected méthode

protected getKga ( ) : Kimai_Config
Résultat Kimai_Config

performAutoLogin() public méthode

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
Résultat boolean either true if the user could be authenticated or false otherwise

setConfig() protected méthode

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

setDatabase() public méthode

public setDatabase ( Kimai_Database_Mysql $database )
$database Kimai_Database_Mysql

setKga() public méthode

public setKga ( Kimai_Config $kga )
$kga Kimai_Config

Property Details

$database protected_oe property

protected Kimai_Database_Mysql $database
Résultat Kimai_Database_Mysql

$kga protected_oe property

protected Kimai_Config $kga
Résultat Kimai_Config