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. * @package chamilo.main
  14. */
  15. $cidReset = true;
  16. require_once 'main/inc/global.inc.php';
  17. /**
  18. * Access permissions check
  19. */
  20. //api_block_anonymous_users();
  21. /**
  22. * Treat URL arguments
  23. */
  24. $array_keys = array_keys($_GET);
  25. if (empty($array_keys)) {
  26. // we cant find your friend
  27. header('Location: whoisonline.php');
  28. exit;
  29. }
  30. $username = substr($array_keys[0], 0, 20); // max len of an username
  31. $friend_id = UserManager::get_user_id_from_username($username);
  32. if (!$friend_id) {
  33. // we cant find your friend
  34. header('Location: whoisonline.php');
  35. exit;
  36. }
  37. Display::display_header(get_lang('UserInfo'));
  38. echo SocialManager::display_individual_user($friend_id);
  39. Display::display_footer();