Browse Source

Merge remote-tracking branch 'upstream/master'

develop
Steve 10 years ago
parent
commit
325d9e6183
  1. 3
      README.md
  2. 68
      application/config/aauth.php
  3. 11
      application/libraries/Aauth.php

3
README.md

@ -1,3 +1,6 @@
![CodeIgniter-Aauth-Logo](https://cloud.githubusercontent.com/assets/2417212/8925689/add409ea-34be-11e5-8e50-845da8f5b1b0.png)
***
Aauth is a User Authorization Library for CodeIgniter 2.x and 3.x, which aims to make easy some essential jobs such as login, permissions and access operations. Despite its ease of use, it has also very advanced features like private messages, groupping, access management, and public access.

68
application/config/aauth.php

@ -68,54 +68,54 @@ defined('BASEPATH') OR exit('No direct script access allowed');
$config_aauth = array();
$config_aauth["default"] = array(
['no_permission'] = FALSE,
'no_permission' => FALSE,
['admin_group'] = 'admin',
['default_group'] = 'default',
['public_group'] = 'public',
'admin_group' => 'admin',
'default_group' => 'default',
'public_group' => 'public',
['db_profile'] = 'default',
'db_profile' => 'default',
['users'] = 'aauth_users',
['groups'] = 'aauth_groups',
['user_to_group'] = 'aauth_user_to_group',
['perms'] = 'aauth_perms',
['perm_to_group'] = 'aauth_perm_to_group',
['perm_to_user'] = 'aauth_perm_to_user',
['pms'] = 'aauth_pms',
['system_variables'] = 'aauth_system_variables',
['user_variables'] = 'aauth_user_variables',
'users' => 'aauth_users',
'groups' => 'aauth_groups',
'user_to_group' => 'aauth_user_to_group',
'perms' => 'aauth_perms',
'perm_to_group' => 'aauth_perm_to_group',
'perm_to_user' => 'aauth_perm_to_user',
'pms' => 'aauth_pms',
'system_variables' => 'aauth_system_variables',
'user_variables' => 'aauth_user_variables',
['remember'] = ' +3 days',
'remember' => ' +3 days',
['max'] = 13,
['min'] = 5,
'max' => 13,
'min' => 5,
['valid_chars'] = array(),
'valid_chars' => array(),
['ddos_protection'] = true,
'ddos_protection' => true,
['recaptcha_active'] = false,
['recaptcha_login_attempts'] = 4,
['recaptcha_siteKey'] = '',
['recaptcha_secret'] = '',
'recaptcha_active' => false,
'recaptcha_login_attempts' => 4,
'recaptcha_siteKey' => '',
'recaptcha_secret' => '',
['totp_active'] = false,
['totp_only_on_ip_change'] = false,
['totp_reset_over_reset_password'] = false,
'totp_active' => false,
'totp_only_on_ip_change' => false,
'totp_reset_over_reset_password' => false,
['max_login_attempt'] = 10,
'max_login_attempt' => 10,
['login_with_name'] = false,
'login_with_name' => false,
['use_cookies'] = true,
'use_cookies' => true,
['email'] = 'admin@admin.com',
['name'] = 'Emre Akay',
'email' => 'admin@admin.com',
'name' => 'Emre Akay',
['verification'] = false,
['verification_link'] = '/account/verification/',
['reset_password_link'] = '/account/reset_password/'
'verification' => false,
'verification_link' => '/account/verification/',
'reset_password_link' => '/account/reset_password/'
);
$config['aauth'] = $config_aauth['default'];

11
application/libraries/Aauth.php

@ -13,7 +13,7 @@
*
* @copyright 2014-2015 Emre Akay
*
* @version 2.4.2
* @version 2.4.4
*
* @license LGPL
* @license http://opensource.org/licenses/LGPL-3.0 Lesser GNU Public License
@ -1463,12 +1463,17 @@ class Aauth {
*/
public function is_allowed($perm_par, $user_id=FALSE){
$perm_id = $this->get_perm_id($perm_par);
if( $user_id == FALSE){
$user_id = $this->CI->session->userdata('id');
}
if($this->is_admin($user_id))
{
return true;
}
$perm_id = $this->get_perm_id($perm_par);
$query = $this->aauth_db->where('perm_id', $perm_id);
$query = $this->aauth_db->where('user_id', $user_id);
$query = $this->aauth_db->get( $this->config_vars['perm_to_user'] );

Loading…
Cancel
Save