Public Member Functions |
| init () |
| allow ($user, $pass=null) |
| setModel ($model, $login_field='email', $password_field='password') |
| addEncryptionHook ($model) |
| destroy () |
| get ($property=null, $default=null) |
| getAll () |
| allowPage ($page) |
| getAllowedPages () |
| isPageAllowed ($page) |
| usePasswordEncryption ($method) |
| encryptPassword ($password, $salt=null) |
| check () |
| addInfo ($key, $val=null) |
| isLoggedIn () |
| verifyCredintials ($user, $password) |
| verifyCredentials ($user, $password) |
| memorizeURL () |
| getURL () |
| loginRedirect () |
| loggedIn ($user=null, $pass=null) |
| memorizeModel () |
| loginByID ($id) |
| loginBy ($field, $value) |
| login ($user) |
| logout () |
| createForm ($page) |
| showLoginForm () |
| processLogin () |
Data Fields |
| $info = false |
| $form = null |
| $login_field = 'email' |
| $password_field = 'password' |
Protected Attributes |
| $password_encryption = null |
| $allowed_pages = array() |
Detailed Description
A basic authentication class. Include inside your API or on a page. You may have multiple Auth instances. Supports 3rd party plugins.
http://agiletoolkit.org/doc/auth
Member Function Documentation
Adds a hook to specified model which will encrypt password before save. Do not call on api->auth->model, because that model already has the hook
Add additional info to be stored in user session.
Reimplemented in SQLAuth.
allow |
( |
$ |
user, |
|
|
$ |
pass = null |
|
) |
| |
Create an array model and specify it for authentication as a quick way to get authentication working
Specify page or array of pages which will exclude authentication. Add your registration page here or page containing terms and conditions
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.
check() returns true if user have just logged in and will return "null" for requests when user continues to use his session. Use that to perform some calculation on log-in
Creates log-in form. Override if you want to use your own form. If you need to change template used by a log-in form, add template/default/page/login.html
Removes object from parent and prevents it from renedring
Reimplemented from AbstractObject.
Manually encrypt password
get |
( |
$ |
property = null , |
|
|
$ |
default = null |
|
) |
| |
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
Return originalally requested URL.
Initialize object. Always call parent
This method is called for initialization
Reimplemented from AbstractObject.
Reimplemented in SQLAuth.
Returns if user is authenticated or not. For more info on user see auth->model
loggedIn |
( |
$ |
user = null , |
|
|
$ |
pass = null |
|
) |
| |
This function is always executed after successfull login through a normal means (login form or plugin)
It will create cache model data.
Manually Log in as specified users by using login name.
Manually Log in with specified condition
Manually Log in as specified users. Will not perform password check or redirect
Rederect to page user tried to access before authentication was requested
Store model in session data so that it can be retrieved faster
Memorize current URL. Called when the first unsuccessful check is executed.
Do not override this function.
setModel |
( |
$ |
model, |
|
|
$ |
login_field = 'email' , |
|
|
$ |
password_field = 'password' |
|
) |
| |
Do not override this function.
Specifies how password will be encrypted when stored. Some values are "sha256/salt", "md5", "rot13". If you don't call this, passwords will be stored in plain-text
This function verifies username and password. Password must be supplied in plain text. Does not affect currently logged in user
Field Documentation
$allowed_pages = array() [protected] |
$password_encryption = null [protected] |
$password_field = 'password' |
The documentation for this class was generated from the following file:
- /Users/rw/Sites/atk42/atk4/lib/Auth/Basic.php