Lines Matching defs:groups

545  * @param array $groups List of groups the user is in
553 function auth_ismanager($user = null, $groups = null, $adminonly = false, $recache = false)
571 if (is_null($groups)) {
574 $groups = (array) $USERINFO['grps'];
576 $groups = $auth->getUserData($user);
577 $groups = $groups ? $groups['grps'] : [];
583 $cachekey = serialize([$user, $adminonly, $groups]);
586 $ok = auth_isMember($conf['superuser'], $user, $groups);
590 $ok = auth_isMember($conf['manager'], $user, $groups);
607 * @param array $groups List of groups the user is in
614 function auth_isadmin($user = null, $groups = null, $recache = false)
616 return auth_ismanager($user, $groups, true, $recache);
620 * Match a user and his groups against a comma separated list of
621 * users and groups to determine membership status
625 * @param string $memberlist commaseparated list of allowed users and groups
627 * @param array $groups groups the user is member of
630 function auth_isMember($memberlist, $user, array $groups)
636 // clean user and groups
639 $groups = array_map([PhpString::class, 'strtolower'], $groups);
642 $groups = array_map([$auth, 'cleanGroup'], $groups);
656 if (in_array($member, $groups)) return true;
696 * @param array|null $groups Array of groups the user is in
699 function auth_aclcheck($id, $user, $groups)
704 'groups' => $groups
724 $groups =& $data['groups'];
736 //make sure groups is an array
737 if (!is_array($groups)) $groups = [];
740 if (auth_isadmin($user, $groups)) {
746 $groups = array_map([PhpString::class, 'strtolower'], $groups);
749 $groups = array_map([$auth, 'cleanGroup'], $groups);
751 //prepend groups with @ and nameencode
752 foreach ($groups as &$group) {
760 $groups[] = '@ALL';
763 if ($user) $groups[] = $user;
774 if (!in_array($acl[1], $groups)) {
804 if (!in_array($acl[1], $groups)) {