/** * Delete all users from group */ function deleteUsersFromGroup($gid) { # get all users $users = getAllUsers(); # check if $gid in array foreach ($users as $u) { $g = json_decode($u['groups'], true); $go = $g; $g = parseUserGroups($g); if (sizeof($g) > 0) { foreach ($g as $gr) { if (in_array($gid, $gr)) { unset($go[$gid]); $ng = json_encode($go); updateUserGroups($u['id'], $ng); } } } } # return return $out; }
# local or ldap? if ($user['domainUser'] == "0") { print ' <td>' . _('Local user') . '</td>' . "\n"; } else { if ($settings['domainAuth'] == "2") { print ' <td>' . _('LDAP user') . '</td>' . "\n"; } else { print ' <td>' . _('Domain user') . '</td>' . "\n"; } } # groups if ($user['role'] == "Administrator") { print ' <td>' . _('All groups') . '</td>' . "\n"; } else { $groups = json_decode($user['groups'], true); $gr = parseUserGroups($groups); print ' <td>'; if (sizeof($gr) > 0) { foreach ($gr as $group) { print $group['g_name'] . "<br>"; } } print ' </td>' . "\n"; } # custom if (sizeof($custom) > 0) { foreach ($custom as $field) { print "<td>"; //booleans if ($field['type'] == "tinyint(1)") { if ($user[$field['name']] == "0") {