PHP Class AuthComponent, miniPHP

Authenticate & Authorize the current user.
Author: Omar El Gabry ([email protected])
Inheritance: extends Component
Afficher le fichier Open project: omarelgabry/miniphp Class Usage Examples

Protected Properties

Свойство Type Description
$config array Default configurations

Méthodes publiques

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

Private Methods

Méthode Description
_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.

Method Details

authenticate() public méthode

authenticate the user using the defined methods in $config
public authenticate ( ) : boolean
Résultat boolean

authorize() public méthode

authorize the user using the defined methods in $config
public authorize ( ) : boolean
Résultat boolean

isLoggedIn() public méthode

Is user is already logged in via session or cookie?
public isLoggedIn ( ) : boolean
Résultat boolean

startup() public méthode

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

unauthenticated() public méthode

Handles unauthenticated access attempt.
public unauthenticated ( )

unauthorized() public méthode

Handles unauthorized access attempt.
public unauthorized ( )

Property Details

$config protected_oe property

Default configurations
protected array $config
Résultat array