Method |
Description |
|
addEncryptionHook ( Model $model ) |
Adds a hook to specified model which will encrypt password before save. |
|
addInfo ( string | array $key, mixed $val = null ) |
Add additional info to be stored in user session. |
|
allow ( string | array $user, string $pass = null ) |
Configure this Auth controller with a generic Model based on static
collection of user/password combinations. Use this method if you
only want one or few accounts to access the system. |
|
allowPage ( string | array $page ) |
Specify page or array of pages which will exclude authentication. Add your registration page here
or page containing terms and conditions. |
|
check ( ) : boolean |
Call this function to perform a check for logged in user. This will also display a login-form
and will verify user's credential. If you want to handle log-in form on your own, use
auth->isLoggedIn() to check and redirect user to a login page. |
|
createForm ( Page $page ) : Form |
Creates log-in form. |
|
destroy ( ) |
Destroy object |
|
encryptPassword ( string $password, string $salt = null ) : string | boolean |
Manually encrypt password |
|
get ( string $property = null, mixed $default = null ) : mixed |
Auth memorizes data about a logged-in user in session. You can either use this function to access
that data or $auth->model (preferred) $auth->get('username') will always point to the login field
value ofthe user regardless of how your field is named. |
|
getAll ( ) : array |
Return array of all authenticated session info |
|
getAllowedPages ( ) : array |
Return array of all allowed page names |
|
getURL ( ) : string |
Return originalally requested URL. |
|
init ( ) |
|
|
isLoggedIn ( ) : boolean |
This function determines - if user is already logged in or not. It does it by
looking at $this->info, which was loaded during init() from session. |
|
isPageAllowed ( string $page ) : boolean |
Verifies if the specified page is allowed to be accessed without
authentication. |
|
loggedIn ( string $user = null, string $pass = null ) |
This function is always executed after successfull login through a normal means (login form or plugin). |
|
login ( string $user ) |
Manually Log in as specified users by using login name. |
|
loginBy ( string $field, mixed $value ) |
Manually Log in with specified condition. |
|
loginByID ( mixed $id ) |
Manually Log in as specified users. Will not perform password check or redirect. |
|
loginRedirect ( ) |
Rederect to page user tried to access before authentication was requested. |
|
logout ( ) |
Manually log out user. |
|
memorizeModel ( ) |
Store model in session data so that it can be retrieved faster. |
|
memorizeURL ( ) |
Memorize current URL. Called when the first unsuccessful check is executed. |
|
processLogin ( ) |
Do not override this function. |
|
setModel ( string | object $model, string $login_field = 'email', string $password_field = 'password' ) : Model |
Associate model with authentication class. Username / password
check will be performed against the model in the following steps:
Model will attempt to load record where login_field matches
specified. Password is then loaded and verified using configured
encryption method. |
|
showLoginForm ( ) : Page |
Do not override this function. |
|
usePasswordEncryption ( string | callable $method = 'php' ) |
Specifies how password will be encrypted when stored. It's recommended
that you do not specify encryption method, in which case a built-in
password_hash() will be used, which is defined by PHP. |
|
verifyCredentials ( string $user, string $password ) : mixed |
This function verifies credibility of supplied authenication data. |
|