Skip to content

Commit

Permalink
Merge pull request #264 from emulsion-io/master
Browse files Browse the repository at this point in the history
fix : PHP 8.0.x
  • Loading branch information
emreakay authored May 25, 2022
2 parents 1489af6 + fd89cad commit dcef4b2
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions application/libraries/Aauth.php
Original file line number Diff line number Diff line change
Expand Up @@ -1507,11 +1507,11 @@ public function remove_member_from_all($user_id) {
$this->aauth_db->where('user_id', $user_id);
return $this->aauth_db->delete($this->config_vars['user_to_group']);
}
//tested

/**
* Is member
* Check if current user is a member of a group
* @param int|string $group_par Group id or name to check
* @param int|string $group_par Group id or name to check, use pipe | for check multiple groups same time
* @param int|bool $user_id User id, if not given current user
* @return bool
*/
Expand All @@ -1522,10 +1522,19 @@ public function is_member( $group_par, $user_id = false ) {
$user_id = $this->CI->session->userdata('id');
}

$group_id = $this->get_group_id($group_par);
$this->aauth_db->where('user_id', $user_id);

$query = $this->aauth_db->where('user_id', $user_id);
$query = $this->aauth_db->where('group_id', $group_id);
$groups_par = explode('|', $group_par);
if(count($groups_par) > 1){
foreach ($groups_par as $key => $group_par) {
$group_id = $this->get_group_id($group_par);
$this->aauth_db->or_where('group_id', $group_id);
}
} else {
$group_id = $this->get_group_id($group_par);
$this->aauth_db->where('group_id', $group_id);
}

$query = $this->aauth_db->get($this->config_vars['user_to_group']);

$row = $query->row();
Expand Down Expand Up @@ -2661,7 +2670,7 @@ public function generate_recaptcha_field(){
return $content;
}

public function update_user_totp_secret($user_id = false, $secret) {
public function update_user_totp_secret($user_id, $secret) {

if ($user_id == false)
$user_id = $this->CI->session->userdata('id');
Expand Down

0 comments on commit dcef4b2

Please sign in to comment.