Skip to content

Commit ccabc9f

Browse files
committed
fixed return insert_id with pre-caching in create_group & create_perm
1 parent 72a18bc commit ccabc9f

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

application/libraries/Aauth.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1292,8 +1292,9 @@ public function create_group($group_name, $definition = '') {
12921292
'definition'=> $definition
12931293
);
12941294
$this->aauth_db->insert($this->config_vars['groups'], $data);
1295+
$group_id = $this->aauth_db->insert_id();
12951296
$this->precache_groups();
1296-
return $this->aauth_db->insert_id();
1297+
return $group_id;
12971298
}
12981299

12991300
$this->info($this->CI->lang->line('aauth_info_group_exists'));
@@ -1678,8 +1679,9 @@ public function create_perm($perm_name, $definition='') {
16781679
'definition'=> $definition
16791680
);
16801681
$this->aauth_db->insert($this->config_vars['perms'], $data);
1682+
$perm_id = $this->aauth_db->insert_id();
16811683
$this->precache_perms();
1682-
return $this->aauth_db->insert_id();
1684+
return $perm_id;
16831685
}
16841686
$this->info($this->CI->lang->line('aauth_info_perm_exists'));
16851687
return false;

0 commit comments

Comments
 (0)