PHP Class Backend\Core\Engine\Authentication

..
Datei anzeigen Open project: forkcms/forkcms Class Usage Examples

Public Methods

Method Description
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.

Private Methods

Method Description
getAlwaysAllowed ( ) : array

Method Details

checkPassword() public static method

Check the strength of the password
public static checkPassword ( string $password ) : string
$password string The password.
return string

cleanupOldSessions() public static method

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

getAllowedActions() public static method

public static getAllowedActions ( ) : array
return array

getEncryptedPassword() public static method

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.
return string

getEncryptedString() public static method

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.
return string

getUser() public static method

Returns the current authenticated user
public static getUser ( ) : User
return User

isAllowedAction() public static method

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.
return boolean

isAllowedModule() public static method

Is the given module allowed for the current user
public static isAllowedModule ( string $module ) : boolean
$module string The module to check for.
return boolean

isLoggedIn() public static method

Is the current user logged in?
public static isLoggedIn ( ) : boolean
return boolean

loginUser() public static method

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.
return boolean

logout() public static method

Logout the current user
public static logout ( )

tearDown() public static method

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 ( )