PHP Класс Backend\Core\Engine\Authentication

..
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
checkPassword ( string $password ) : string Check the strength of the password
cleanupOldSessions ( ) Cleanup sessions for the current user and sessions that are invalid
getAllowedActions ( ) : array
getEncryptedPassword ( string $email, string $password ) : string Returns the encrypted password for a user by giving a email/password Returns false if no user was found for this user/pass combination
getEncryptedString ( string $string, string $salt = null ) : string Returns a string encrypted like sha1(md5($salt) . md5($string)) The salt is an optional extra string you can strengthen your encryption with
getUser ( ) : User Returns the current authenticated user
isAllowedAction ( string $action = null, string $module = null ) : boolean Is the given action allowed for the current user
isAllowedModule ( string $module ) : boolean Is the given module allowed for the current user
isLoggedIn ( ) : boolean Is the current user logged in?
loginUser ( string $login, string $password ) : boolean Login the user with the given credentials.
logout ( ) Logout the current user
tearDown ( ) Reset our class to make sure no contamination from previous authentications persists. This signifies a deeper issue with this class. Solving the issue would be preferable to introducting another method. This currently only exists to serve the test.

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

Метод Описание
getAlwaysAllowed ( ) : array

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

checkPassword() публичный статический метод

Check the strength of the password
public static checkPassword ( string $password ) : string
$password string The password.
Результат string

cleanupOldSessions() публичный статический метод

Cleanup sessions for the current user and sessions that are invalid
public static cleanupOldSessions ( )

getAllowedActions() публичный статический метод

public static getAllowedActions ( ) : array
Результат array

getEncryptedPassword() публичный статический метод

Returns the encrypted password for a user by giving a email/password Returns false if no user was found for this user/pass combination
public static getEncryptedPassword ( string $email, string $password ) : string
$email string The email.
$password string The password.
Результат string

getEncryptedString() публичный статический метод

Returns a string encrypted like sha1(md5($salt) . md5($string)) The salt is an optional extra string you can strengthen your encryption with
public static getEncryptedString ( string $string, string $salt = null ) : string
$string string The string to encrypt.
$salt string The salt to use.
Результат string

getUser() публичный статический метод

Returns the current authenticated user
public static getUser ( ) : User
Результат User

isAllowedAction() публичный статический метод

Is the given action allowed for the current user
public static isAllowedAction ( string $action = null, string $module = null ) : boolean
$action string The action to check for.
$module string The module wherein the action is located.
Результат boolean

isAllowedModule() публичный статический метод

Is the given module allowed for the current user
public static isAllowedModule ( string $module ) : boolean
$module string The module to check for.
Результат boolean

isLoggedIn() публичный статический метод

Is the current user logged in?
public static isLoggedIn ( ) : boolean
Результат boolean

loginUser() публичный статический метод

Will return a boolean that indicates if the user is logged in.
public static loginUser ( string $login, string $password ) : boolean
$login string The users login.
$password string The password provided by the user.
Результат boolean

logout() публичный статический метод

Logout the current user
public static logout ( )

tearDown() публичный статический метод

Reset our class to make sure no contamination from previous authentications persists. This signifies a deeper issue with this class. Solving the issue would be preferable to introducting another method. This currently only exists to serve the test.
public static tearDown ( )