From 44cefd4a597c5ebcf60e1621eb735800f51db667 Mon Sep 17 00:00:00 2001 From: Raphael Jackstadt Date: Thu, 11 Sep 2014 23:10:58 +0200 Subject: [PATCH] Fixes --- application/libraries/Aauth.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/application/libraries/Aauth.php b/application/libraries/Aauth.php index 90d12d43..685cb357 100644 --- a/application/libraries/Aauth.php +++ b/application/libraries/Aauth.php @@ -955,6 +955,12 @@ public function update_group($group_par, $group_name) { public function delete_group($group_par) { $group_id = $this->get_group_id($group_par); + + $this->CI->db->where('id',$group_id); + $query = $this->CI->db->get($this->config_vars['groups']); + if ($query->num_rows() == 0){ + return false; + } // bug fixed // now users are deleted from user_to_group table @@ -1174,11 +1180,11 @@ public function delete_perm($perm_par) { $perm_id = $this->get_perm_id($perm_par); // deletes from perm_to_gropup table - $this->CI->db->where('pern_id', $perm_id); + $this->CI->db->where('perm_id', $perm_id); $this->CI->db->delete($this->config_vars['perm_to_group']); // deletes from perm_to_user table - $this->CI->db->where('pern_id', $perm_id); + $this->CI->db->where('perm_id', $perm_id); $this->CI->db->delete($this->config_vars['perm_to_group']); // deletes from permission table @@ -1253,7 +1259,7 @@ public function is_group_allowed($perm_par, $group_par=false){ // if is not login if (!$this->is_loggedin()){return false;} - $group_pars = $this->list_groups( $this->CI->session->userdata('id') ); + $group_pars = $this->get_user_groups(); foreach ($group_pars as $g ){ if($this->is_group_allowed($perm_id, $g -> id)){ @@ -1697,7 +1703,7 @@ public function set_user_var( $key, $value, $user_id = false ) { } // if var not set, set - if ( ! $this->get_user_var($key,$user_id) ) { + if ($this->get_user_var($key,$user_id) ===false) { $data = array( 'key' => $key,