PHP Class Piwik\Plugins\Login\Controller

Inheritance: extends piwik\plugin\Controller
Show file Open project: piwik/piwik Class Usage Examples

Protected Properties

Property Type Description
$auth Auth
$passwordResetter PasswordResetter
$sessionInitializer SessionInitializer

Public Methods

Method Description
__construct ( PasswordResetter $passwordResetter = null, AuthInterface $auth = null, $sessionInitializer = null ) Constructor.
ajaxNoAccess ( string $errorMessage ) : string Error message shown when an AJAX request has no access
clearSession ( ) : void Clear session information
confirmResetPassword ( ) Password reset confirmation action. Finishes the password reset process.
index ( ) : string Default action
login ( string $messageNoAccess = null, boolean $infoMessage = false ) : string Login form
logme ( ) : void Form-less login
logout ( ) : void Logout current user
resetPassword ( ) Reset password action. Stores new password as hash and sends email to confirm use.
resetPasswordSuccess ( ) The action used after a password is successfully reset. Displays the login screen with an extra message. A separate action is used instead of returning the HTML in confirmResetPassword so the resetToken won't be in the URL.

Protected Methods

Method Description
authenticateAndRedirect ( string $login, string $password, boolean $rememberMe, string $urlToRedirect = false, boolean $passwordHashed = false ) : string Authenticate user and password. Redirect if successful.
configureView ( View $view ) Configure common view properties
getMessageExceptionNoAccess ( )
getMessageExceptionNoAccessWhenInsecureConnectionMayBeUsed ( ) : string The Session cookie is set to a secure cookie, when SSL is mis-configured, it can cause the PHP session cookie ID to change on each page view.
resetPasswordFirstStep ( Piwik\QuickForm2 $form ) : array Saves password reset info and sends confirmation email.

Method Details

__construct() public method

Constructor.
public __construct ( PasswordResetter $passwordResetter = null, AuthInterface $auth = null, $sessionInitializer = null )
$passwordResetter PasswordResetter
$auth AuthInterface

ajaxNoAccess() public method

Error message shown when an AJAX request has no access
public ajaxNoAccess ( string $errorMessage ) : string
$errorMessage string
return string

authenticateAndRedirect() protected method

Authenticate user and password. Redirect if successful.
protected authenticateAndRedirect ( string $login, string $password, boolean $rememberMe, string $urlToRedirect = false, boolean $passwordHashed = false ) : string
$login string user name
$password string plain-text or hashed password
$rememberMe boolean Remember me?
$urlToRedirect string URL to redirect to, if successfully authenticated
$passwordHashed boolean indicates if $password is hashed
return string failure message if unable to authenticate

clearSession() public static method

Clear session information
public static clearSession ( ) : void
return void

configureView() protected method

Configure common view properties
protected configureView ( View $view )
$view Piwik\View

confirmResetPassword() public method

Users visit this action from a link supplied in an email.

getMessageExceptionNoAccess() protected method

getMessageExceptionNoAccessWhenInsecureConnectionMayBeUsed() protected method

Indicate to user how to solve this particular use case by forcing secure connections.

index() public method

Default action
public index ( ) : string
return string

login() public method

Login form
public login ( string $messageNoAccess = null, boolean $infoMessage = false ) : string
$messageNoAccess string Access error message
$infoMessage boolean
return string

logme() public method

Form-less login
See also: how to use it on http://piwik.org/faq/how-to/#faq_30
public logme ( ) : void
return void

logout() public method

Logout current user
public logout ( ) : void
return void

resetPassword() public method

Reset password action. Stores new password as hash and sends email to confirm use.
public resetPassword ( )

resetPasswordFirstStep() protected method

Saves password reset info and sends confirmation email.
protected resetPasswordFirstStep ( Piwik\QuickForm2 $form ) : array
$form Piwik\QuickForm2
return array Error message(s) if an error occurs.

resetPasswordSuccess() public method

The action used after a password is successfully reset. Displays the login screen with an extra message. A separate action is used instead of returning the HTML in confirmResetPassword so the resetToken won't be in the URL.

Property Details

$auth protected property

protected Auth,Piwik\Plugins\Login $auth
return Auth

$passwordResetter protected property

protected PasswordResetter,Piwik\Plugins\Login $passwordResetter
return PasswordResetter

$sessionInitializer protected property

protected SessionInitializer,Piwik\Plugins\Login $sessionInitializer
return SessionInitializer