Overview

Namespaces

  • Core
    • Auth
    • Exceptions
    • Helpers
    • Providers
  • Kernel
    • Dispatch
    • Providers
  • None
  • Vendor
    • ExampleVendor

Classes

  • AuthenticateController
  • PasswordModel
  • Overview
  • Namespace
  • Class
  • Download

Class AuthenticateController

Class AuthenticateController contains functions for user (de)authentication.

Core\ParentController
Extended by Core\Auth\AuthenticateController

Direct known subclasses

LoginController
Namespace: Core\Auth
Package: Core
Hooks:
('on_userauth', ['user' => $user]) // Called just after the login session has been created \Core\AuthenticateController::login
('on_userdeauth', ['user' => Session::getUser()]) // Called just before destroying the login session. \Core\AuthenticateController::deauthenticateUser

Located at app/Kernel/Auth/AuthenticateController.php
Methods summary
public
# __construct( )

Every Controller that extends ParentController must explicitly

Every Controller that extends ParentController must explicitly

Overrides

Core\ParentController::__construct()
public static Core\Auth\AuthenticateController
# singleton( )

Returns a AuthenticateController instance, creating it if it did not exist.

Returns a AuthenticateController instance, creating it if it did not exist.

Returns

Core\Auth\AuthenticateController

Overrides

Core\ParentController::singleton()
public Core\Auth\PasswordModel
# getModel( )

Returns the instance of the model for this controller

Returns the instance of the model for this controller

Returns

Core\Auth\PasswordModel

Overrides

Core\ParentController::getModel()
public
# login( string $username = '', string $password = '' )

Performs an authentication request for a user with 'username' and 'password' post vars If the credentials are not correct, AuthenticateController->authenticateUser throws the user accordingly

Performs an authentication request for a user with 'username' and 'password' post vars If the credentials are not correct, AuthenticateController->authenticateUser throws the user accordingly

Parameters

$username
(Optional) if $username is
$password

Returns

array $user The authenticated user (on success) or FALSE on fail
public
# logout( )

Logs a user out. That is, sets the current user with ROLE_USER privileges and redirects them to the Home path.

Logs a user out. That is, sets the current user with ROLE_USER privileges and redirects them to the Home path.

protected mixed
# authenticateUser( string $username, string $password )

Checks against the database or the config file (depending on configuration) if the credentials are correct.

Checks against the database or the config file (depending on configuration) if the credentials are correct.

Parameters

$username
$password

Returns

mixed
$user on success. On fail redirects accordingly.
protected AuthenticateController;
# deauthenticateUser( )

Deauthenticates the current user by setting ROLE_USER privileges.

Deauthenticates the current user by setting ROLE_USER privileges.

Returns

AuthenticateController;
Methods inherited from Core\ParentController
add(), addFooter(), addHeader(), addJSVar(), addScript(), addStyle(), asset(), cache(), compressWithMinify(), get(), getGet(), getPost(), header(), json(), minimize(), minimizeURL(), path(), redirect(), setFavicon(), setTitle(), show(), url()
Properties summary
protected Core\Auth\PasswordModel $model

The instance of the model

The instance of the model

#
protected Kernel\Providers\Permission $permission

The instance of the Permission class. Used for (de)authentication.

The instance of the Permission class. Used for (de)authentication.

#
Properties inherited from Core\ParentController
$ajax, $config, $hooks, $path, $templatePath, $vars, $viewPath
Ribosome API documentation generated by ApiGen