PHP Класс AuthComponent, miniPHP

Authenticate & Authorize the current user.
Автор: Omar El Gabry ([email protected])
Наследование: extends Component
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$config array Default configurations

Открытые методы

Метод Описание
authenticate ( ) : boolean authenticate the user using the defined methods in $config
authorize ( ) : boolean authorize the user using the defined methods in $config
isLoggedIn ( ) : boolean Is user is already logged in via session or cookie?
startup ( ) Auth startup All authentication and authorization checking are done in this method
unauthenticated ( ) Handles unauthenticated access attempt.
unauthorized ( ) Handles unauthorized access attempt.

Приватные методы

Метод Описание
_ControllerAuthorize ( array $config ) : boolean Is user authorized for the requested Controller & Action method?
_UserAuthenticate ( array $config ) : boolean Is user authenticated? It checks for: - concurrent session - user credentials in session & cookies - cookies theft and manipulations - session Hijacking and fixation.
check ( array $config, string $type ) : boolean check for authentication or authorization
concurentSession ( )
loggedIn ( ) : boolean Checks if user is logged in or not.

Описание методов

authenticate() публичный Метод

authenticate the user using the defined methods in $config
public authenticate ( ) : boolean
Результат boolean

authorize() публичный Метод

authorize the user using the defined methods in $config
public authorize ( ) : boolean
Результат boolean

isLoggedIn() публичный Метод

Is user is already logged in via session or cookie?
public isLoggedIn ( ) : boolean
Результат boolean

startup() публичный Метод

Auth startup All authentication and authorization checking are done in this method
public startup ( )

unauthenticated() публичный Метод

Handles unauthenticated access attempt.
public unauthenticated ( )

unauthorized() публичный Метод

Handles unauthorized access attempt.
public unauthorized ( )

Описание свойств

$config защищенное свойство

Default configurations
protected array $config
Результат array