Skip to content

Active User library

World Wide Web Server edited this page Jul 4, 2012 · 6 revisions

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).
  • 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.

[h3]Requires and installation:[/h3]

  1. Check for line in "system/application/config/autoload.php" [code]$autoload['libraries'] = array('database', 'session'); $autoload['helper'] = array('url'); [/code]

  2. Then check settings in "system/application/config/auconfig.php"

  3. 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]

  4. 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]

  5. 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]

Clone this wiki locally