forked from bcit-ci/CodeIgniter
-
Notifications
You must be signed in to change notification settings - Fork 0
Active User library
Derek Jones edited this page Jul 5, 2012
·
6 revisions
Category:Libraries::Authentication
Download File:AU.zip
The user authorization system that handles login and registration of users. It uses a configuration database table to store user information and stores minimal information in the session. Work correct in CI 1.6.3
- Login/logout/change password functionality.
- Registration, with/without e-mail activation.
- Check page permission for user, user group or user role.
- Reset forgotten password and generate new password (send on e-mail).
- Auto-login via cookie or flash session - until browser window open.
- Support for multiple languages. (Now only English and Russian).
- Use Template Parser Class.
- Use CAPTCHA plugin.
- Admin panel for manage users, groups and roles.
- Auto-create tables, if it not exist in database.
- Non replace you files.
- Check for line in "system/application/config/autoload.php"
$autoload['libraries'] = array('database', 'session');
$autoload['helper'] = array('url');
-
Then check settings in "system/application/config/auconfig.php"
-
Create (if need) file "system/application/config/email.php" and insert you REAL setting:
<?php
$config['protocol'] = 'smtp';
$config['smtp_host'] = 'smtp.provider.com';
$config['smtp_user'] = '';
$config['smtp_pass'] = '';
?>
- In main controller insert line:
$this->load->library('aulib'); // load AU library
echo $this->aulib->getLoginLink(); // show login/logoff
echo $this->aulib->getManagerLink(); // show back-end link (if need)
- Check permission for page: You can use function:
isLogged() // is user logged
isGroup($group_name) // is user in specified group
isRole($role_name) // is user have specified role
denyAccess() // show deny access page
For example:
if ( !$this->aulib->isRole('admin') )
$this->aulib->denyAccess();