Skip to content

Commit dcef4b2

Browse files
authored
Merge pull request #264 from emulsion-io/master
fix : PHP 8.0.x
2 parents 1489af6 + fd89cad commit dcef4b2

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

application/libraries/Aauth.php

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1507,11 +1507,11 @@ public function remove_member_from_all($user_id) {
15071507
$this->aauth_db->where('user_id', $user_id);
15081508
return $this->aauth_db->delete($this->config_vars['user_to_group']);
15091509
}
1510-
//tested
1510+
15111511
/**
15121512
* Is member
15131513
* Check if current user is a member of a group
1514-
* @param int|string $group_par Group id or name to check
1514+
* @param int|string $group_par Group id or name to check, use pipe | for check multiple groups same time
15151515
* @param int|bool $user_id User id, if not given current user
15161516
* @return bool
15171517
*/
@@ -1522,10 +1522,19 @@ public function is_member( $group_par, $user_id = false ) {
15221522
$user_id = $this->CI->session->userdata('id');
15231523
}
15241524

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

1527-
$query = $this->aauth_db->where('user_id', $user_id);
1528-
$query = $this->aauth_db->where('group_id', $group_id);
1527+
$groups_par = explode('|', $group_par);
1528+
if(count($groups_par) > 1){
1529+
foreach ($groups_par as $key => $group_par) {
1530+
$group_id = $this->get_group_id($group_par);
1531+
$this->aauth_db->or_where('group_id', $group_id);
1532+
}
1533+
} else {
1534+
$group_id = $this->get_group_id($group_par);
1535+
$this->aauth_db->where('group_id', $group_id);
1536+
}
1537+
15291538
$query = $this->aauth_db->get($this->config_vars['user_to_group']);
15301539

15311540
$row = $query->row();
@@ -2661,7 +2670,7 @@ public function generate_recaptcha_field(){
26612670
return $content;
26622671
}
26632672

2664-
public function update_user_totp_secret($user_id = false, $secret) {
2673+
public function update_user_totp_secret($user_id, $secret) {
26652674

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

0 commit comments

Comments
 (0)