@@ -1507,11 +1507,11 @@ public function remove_member_from_all($user_id) {
1507
1507
$ this ->aauth_db ->where ('user_id ' , $ user_id );
1508
1508
return $ this ->aauth_db ->delete ($ this ->config_vars ['user_to_group ' ]);
1509
1509
}
1510
- //tested
1510
+
1511
1511
/**
1512
1512
* Is member
1513
1513
* 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
1515
1515
* @param int|bool $user_id User id, if not given current user
1516
1516
* @return bool
1517
1517
*/
@@ -1522,10 +1522,19 @@ public function is_member( $group_par, $user_id = false ) {
1522
1522
$ user_id = $ this ->CI ->session ->userdata ('id ' );
1523
1523
}
1524
1524
1525
- $ group_id = $ this ->get_group_id ( $ group_par );
1525
+ $ this ->aauth_db -> where ( ' user_id ' , $ user_id );
1526
1526
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
+
1529
1538
$ query = $ this ->aauth_db ->get ($ this ->config_vars ['user_to_group ' ]);
1530
1539
1531
1540
$ row = $ query ->row ();
@@ -2661,7 +2670,7 @@ public function generate_recaptcha_field(){
2661
2670
return $ content ;
2662
2671
}
2663
2672
2664
- public function update_user_totp_secret ($ user_id = false , $ secret ) {
2673
+ public function update_user_totp_secret ($ user_id , $ secret ) {
2665
2674
2666
2675
if ($ user_id == false )
2667
2676
$ user_id = $ this ->CI ->session ->userdata ('id ' );
0 commit comments