usergroup.ajax.php 768 B

123456789101112131415161718192021222324252627
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * Responses to AJAX calls.
  5. */
  6. require_once __DIR__.'/../global.inc.php';
  7. $action = isset($_REQUEST['a']) ? $_REQUEST['a'] : '';
  8. $isAllowedToEdit = api_is_allowed_to_edit();
  9. switch ($action) {
  10. case 'delete_user_in_usergroup':
  11. if ($isAllowedToEdit) {
  12. $userGroup = new UserGroup();
  13. $userId = isset($_REQUEST['id']) ? $_REQUEST['id'] : 0;
  14. $userIdList = explode(',', $userId);
  15. $groupId = isset($_REQUEST['group_id']) ? $_REQUEST['group_id'] : 0;
  16. foreach ($userIdList as $userId) {
  17. $userGroup->delete_user_rel_group($userId, $groupId);
  18. }
  19. }
  20. break;
  21. default:
  22. echo '';
  23. break;
  24. }
  25. exit;