-
Notifications
You must be signed in to change notification settings - Fork 0
Active User library
Category:Libraries::Authentication
Download File:AU.zip
[h3]Introduction[/h3] 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
[h3]Features[/h3]
- 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).
- Admin panel for manage users, groups and roles.
- Auto-create tables, if it not exist in database.
- Non replace you files.
[h3]Requires and installation:[/h3]
-
Check for line in "system/application/config/autoload.php" [code]$autoload['libraries'] = array('database', 'session'); $autoload['helper'] = array('url'); [/code]
-
Then check settings in "system/application/config/auconfig.php"
-
Create (if need) file "system/application/config/email.php" and insert you REAL setting: [code]<?php $config['protocol'] = 'smtp'; $config['smtp_host'] = 'smtp.provider.com';
$config['smtp_user'] = ''; $config['smtp_pass'] = ''; ?>[/code] -
In main controller insert line: [code]$this->load->library('aulib'); // load AU library echo $this->aulib->getLoginLink(); // show login/logoff echo $this->aulib->getManagerLink(); // show back-end link (if need) [/code]
-
Check permission for page: You can use function: [code]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 [/code]
For example:
[code]if ( !$this->aulib->isRole('admin') ) $this->aulib->denyAccess();[/code]