From d025313e317417d6fbba9adf061252f71eca798e Mon Sep 17 00:00:00 2001 From: tswagger Date: Sat, 14 Mar 2015 16:09:10 -0500 Subject: [PATCH] Fixed an issue with is_allowed Fixed an issue with is_allowed that would cause it to return true if the permission name passed in did not exist and the user had access to permission ID 1. Changed get_perm_id() to return NULL instead of FALSE. This fixed the above issue. --- application/libraries/Aauth.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/application/libraries/Aauth.php b/application/libraries/Aauth.php index 5c5d54d..d789e04 100644 --- a/application/libraries/Aauth.php +++ b/application/libraries/Aauth.php @@ -1087,7 +1087,7 @@ class Aauth { if( ! $group_id ) { - $this->error( $this->CI->lang->line('group_exist') ); + $this->error( $this->CI->lang->line('no_group') ); return false; } @@ -1485,7 +1485,7 @@ class Aauth { * Get permission id * Get permission id from permisison name or id * @param int|string $perm_par Permission id or name to get - * @return int Permission id + * @return int Permission id or NULL if perm does not exist */ public function get_perm_id($perm_par) { @@ -1495,7 +1495,7 @@ class Aauth { $query = $this->CI->db->get($this->config_vars['perms']); if ($query->num_rows() == 0) - return false; + return NULL; $row = $query->row(); return $row->id;