events.ajax.php 738 B

123456789101112131415161718192021222324252627
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. // @deprecated
  4. require_once __DIR__.'/../global.inc.php';
  5. $id = isset($_REQUEST['id']) ? $_REQUEST['id'] : null;
  6. $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : null;
  7. $event_name = isset($_REQUEST['eventName']) ? $_REQUEST['eventName'] : null;
  8. api_protect_admin_script();
  9. switch ($action) {
  10. case 'getEventTypes':
  11. $events = Event::get_all_event_types();
  12. echo json_encode($events);
  13. break;
  14. case 'getUsers':
  15. $users = UserManager::get_user_list();
  16. echo json_encode($users);
  17. break;
  18. case 'get_event_users':
  19. $users = Event::get_event_users($event_name);
  20. echo json_encode($users);
  21. break;
  22. }
  23. exit;