Revision 1440
Added by Luisehahne over 14 years ago
| class.wb.php | ||
|---|---|---|
| 40 | 40 |
} |
| 41 | 41 |
|
| 42 | 42 |
/* **************** |
| 43 |
* check if one or more group_ids are in both group_lists |
|
| 44 |
* |
|
| 45 |
* @access public |
|
| 46 |
* @param mixed $groups_list1: an array or a coma seperated list of group-ids |
|
| 47 |
* @param mixed $groups_list2: an array or a coma seperated list of group-ids |
|
| 48 |
* @param array &$matches: an array-var whitch will return possible matches |
|
| 49 |
* @return bool: true there is a match, otherwise false |
|
| 50 |
*/ |
|
| 51 |
function is_group_match( $groups_list1 = '', $groups_list2 = '', &$matches = null ) |
|
| 52 |
{
|
|
| 53 |
if( $groups_list1 == '' ) { return false; }
|
|
| 54 |
if( $groups_list2 == '' ) { return false; }
|
|
| 55 |
if( !is_array($groups_list1) ) |
|
| 56 |
{
|
|
| 57 |
$groups_list1 = explode(',', $groups_list1);
|
|
| 58 |
} |
|
| 59 |
if( !is_array($groups_list2) ) |
|
| 60 |
{
|
|
| 61 |
$groups_list2 = explode(',', $groups_list2);
|
|
| 62 |
} |
|
| 63 |
$matches = array_intersect( $groups_list1, $groups_list2); |
|
| 64 |
return ( sizeof($matches) != 0 ); |
|
| 65 |
} |
|
| 66 |
/* **************** |
|
| 43 | 67 |
* check if current user is member of at least one of given groups |
| 44 | 68 |
* ADMIN (uid=1) always is treated like a member of any groups |
| 45 | 69 |
* |
Also available in: Unified diff
add missing methode is_group_match in class.wb.php