PHP Class Piwik\Plugins\Login\SessionInitializer

If a user is authenticated, a browser cookie is created so the user will be remembered until the cookie is destroyed. Plugins can override SessionInitializer behavior by extending this class and overriding methods. In order for these changes to have effect, however, an instance of the derived class must be used by the Login/Controller.
Afficher le fichier Open project: piwik/piwik Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( API | null $usersManagerAPI = null, string | null $authCookieName = null, integer | null $authCookieValidTime = null, string | null $authCookiePath = null ) Constructor.
getHashTokenAuth ( string $login, string $token_auth ) : string Accessor to compute the hashed authentication token.
initSession ( Piwik\Auth $auth, boolean $rememberMe ) Authenticates the user and, if successful, initializes an authenticated session.

Méthodes protégées

Méthode Description
doAuthenticateSession ( Piwik\Auth $auth ) : Piwik\AuthResult Authenticates the user.
getAuthCookie ( boolean $rememberMe ) : Piwik\Cookie Returns a Cookie instance that manages the browser cookie used to store session information.
processFailedSession ( boolean $rememberMe ) Executed when the session could not authenticate.
processSuccessfulSession ( Piwik\AuthResult $authResult, boolean $rememberMe ) Executed when the session was successfully authenticated.
regenerateSessionId ( )

Method Details

__construct() public méthode

Constructor.
public __construct ( API | null $usersManagerAPI = null, string | null $authCookieName = null, integer | null $authCookieValidTime = null, string | null $authCookiePath = null )
$usersManagerAPI Piwik\Plugins\UsersManager\API | null
$authCookieName string | null
$authCookieValidTime integer | null
$authCookiePath string | null

doAuthenticateSession() protected méthode

Derived classes can override this method to customize authentication logic or impose extra requirements on the user trying to login.
protected doAuthenticateSession ( Piwik\Auth $auth ) : Piwik\AuthResult
$auth Piwik\Auth The Auth implementation to use when authenticating.
Résultat Piwik\AuthResult

getAuthCookie() protected méthode

Returns a Cookie instance that manages the browser cookie used to store session information.
protected getAuthCookie ( boolean $rememberMe ) : Piwik\Cookie
$rememberMe boolean Whether the authenticated session should be remembered after the browser is closed or not.
Résultat Piwik\Cookie

getHashTokenAuth() public static méthode

Accessor to compute the hashed authentication token.
public static getHashTokenAuth ( string $login, string $token_auth ) : string
$login string user login
$token_auth string authentication token
Résultat string hashed authentication token

initSession() public méthode

Authenticates the user and, if successful, initializes an authenticated session.
public initSession ( Piwik\Auth $auth, boolean $rememberMe )
$auth Piwik\Auth The Auth implementation to use.
$rememberMe boolean Whether the authenticated session should be remembered after the browser is closed or not.

processFailedSession() protected méthode

Executed when the session could not authenticate.
protected processFailedSession ( boolean $rememberMe )
$rememberMe boolean Whether the authenticated session should be remembered after the browser is closed or not.

processSuccessfulSession() protected méthode

Executed when the session was successfully authenticated.
protected processSuccessfulSession ( Piwik\AuthResult $authResult, boolean $rememberMe )
$authResult Piwik\AuthResult The successful authentication result.
$rememberMe boolean Whether the authenticated session should be remembered after the browser is closed or not.

regenerateSessionId() protected méthode

protected regenerateSessionId ( )