Browse Source

Merge pull request #91 from REJack/master

added perm/group exists checks in allow_user & allow_group (fix for #90 allow_user and allow_group problem)
develop
Emre Akay 10 years ago
parent
commit
7e92f7c706
  1. 4
      application/language/english/aauth_lang.php
  2. 13
      application/libraries/Aauth.php

4
application/language/english/aauth_lang.php

@ -25,8 +25,8 @@ $lang['aauth_error_email_invalid'] = 'Invalid e-mail address';
$lang['aauth_error_password_invalid'] = 'Invalid password';
$lang['aauth_error_username_invalid'] = 'Invalid Username';
$lang['aauth_error_username_required'] = 'Username required';
$lang['aauth_error_totp_code_required'] = 'TOTP Code required';
$lang['aauth_error_totp_code_invalid'] = 'Invalid TOTP Code';
$lang['aauth_error_totp_code_required'] = 'Authentication Code required';
$lang['aauth_error_totp_code_invalid'] = 'Invalid Authentication Code';
// Account update errors

13
application/libraries/Aauth.php

@ -1555,6 +1555,10 @@ class Aauth {
$perm_id = $this->get_perm_id($perm_par);
if( ! $perm_id) {
return FALSE;
}
$query = $this->aauth_db->where('user_id',$user_id);
$query = $this->aauth_db->where('perm_id',$perm_id);
$query = $this->aauth_db->get($this->config_vars['perm_to_user']);
@ -1601,8 +1605,17 @@ class Aauth {
public function allow_group($group_par, $perm_par) {
$perm_id = $this->get_perm_id($perm_par);
if( ! $perm_id) {
return FALSE;
}
$group_id = $this->get_group_id($group_par);
if( ! $group_id) {
return FALSE;
}
$query = $this->aauth_db->where('group_id',$group_id);
$query = $this->aauth_db->where('perm_id',$perm_id);
$query = $this->aauth_db->get($this->config_vars['perm_to_group']);

Loading…
Cancel
Save