Skip to content

Commit

Permalink
moved $perm_id after the if's conditions for more performance
Browse files Browse the repository at this point in the history
  • Loading branch information
REJack committed Oct 27, 2015
1 parent f51e1b4 commit f42e546
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions application/libraries/Aauth.php
Original file line number Diff line number Diff line change
Expand Up @@ -1463,8 +1463,6 @@ public function delete_perm($perm_par) {
*/
public function is_allowed($perm_par, $user_id=FALSE){

$perm_id = $this->get_perm_id($perm_par);

if( $user_id == FALSE){
$user_id = $this->CI->session->userdata('id');
}
Expand All @@ -1473,6 +1471,8 @@ public function is_allowed($perm_par, $user_id=FALSE){
{
return true;
}

$perm_id = $this->get_perm_id($perm_par);

$query = $this->aauth_db->where('perm_id', $perm_id);
$query = $this->aauth_db->where('user_id', $user_id);
Expand Down

0 comments on commit f42e546

Please sign in to comment.