user.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * Clean URls for the Social Network.
  5. *
  6. * The idea is to access to the user info more easily:
  7. * http://campus.chamilo.org/admin instead of
  8. * http://campus.chamilo.org/main/social/profile.php?1
  9. * To use this you should rename the htaccess to .htaccess and check your
  10. * virtualhost configuration
  11. *
  12. * More improvements will come in next versions of Chamilo maybe in the 1.8.8
  13. *
  14. * @package chamilo.main
  15. */
  16. $cidReset = true;
  17. require_once 'main/inc/global.inc.php';
  18. /**
  19. * Access permissions check.
  20. */
  21. //api_block_anonymous_users();
  22. /**
  23. * Treat URL arguments.
  24. */
  25. $array_keys = array_keys($_GET);
  26. if (empty($array_keys)) {
  27. // we cant find your friend
  28. header('Location: whoisonline.php');
  29. exit;
  30. }
  31. $username = substr($array_keys[0], 0, 20); // max len of an username
  32. $friend_id = UserManager::get_user_id_from_username($username);
  33. if (!$friend_id) {
  34. // we cant find your friend
  35. header('Location: whoisonline.php');
  36. exit;
  37. }
  38. Display::display_header(get_lang('UserInfo'));
  39. echo SocialManager::display_individual_user($friend_id);
  40. Display::display_footer();