session.ajax.php 771 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * Responses to AJAX calls
  5. */
  6. $language_file[] = 'admin';
  7. require_once '../global.inc.php';
  8. $action = $_REQUEST['a'];
  9. switch ($action) {
  10. case 'get_user_sessions':
  11. if (api_is_platform_admin()) {
  12. $user_id = intval($_POST['user_id']);
  13. $list_sessions = SessionManager::get_sessions_by_user($user_id, true);
  14. if (!empty($list_sessions)) {
  15. foreach ($list_sessions as $session_item) {
  16. echo $session_item['session_name'].'<br />';
  17. }
  18. } else {
  19. echo get_lang('NoSessionsForThisUser');
  20. }
  21. unset($list_sessions);
  22. }
  23. break;
  24. default:
  25. echo '';
  26. }
  27. exit;