Skip to content

Commit

Permalink
fixed return insert_id with pre-caching in create_group & create_perm
Browse files Browse the repository at this point in the history
  • Loading branch information
REJack committed Feb 21, 2020
1 parent 72a18bc commit ccabc9f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions application/libraries/Aauth.php
Original file line number Diff line number Diff line change
Expand Up @@ -1292,8 +1292,9 @@ public function create_group($group_name, $definition = '') {
'definition'=> $definition
);
$this->aauth_db->insert($this->config_vars['groups'], $data);
$group_id = $this->aauth_db->insert_id();
$this->precache_groups();
return $this->aauth_db->insert_id();
return $group_id;
}

$this->info($this->CI->lang->line('aauth_info_group_exists'));
Expand Down Expand Up @@ -1678,8 +1679,9 @@ public function create_perm($perm_name, $definition='') {
'definition'=> $definition
);
$this->aauth_db->insert($this->config_vars['perms'], $data);
$perm_id = $this->aauth_db->insert_id();
$this->precache_perms();
return $this->aauth_db->insert_id();
return $perm_id;
}
$this->info($this->CI->lang->line('aauth_info_perm_exists'));
return false;
Expand Down

0 comments on commit ccabc9f

Please sign in to comment.