forked from chamilo/chamilo-lms
-
Notifications
You must be signed in to change notification settings - Fork 1
/
user.php
49 lines (44 loc) · 1.22 KB
/
user.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
/* For licensing terms, see /license.txt */
/**
* Clean URls for the Social Network
*
* The idea is to access to the user info more easily:
* http://campus.chamilo.org/admin instead of
* http://campus.chamilo.org/main/social/profile.php?1
* To use this you should rename the htaccess to .htaccess and check your
* virtualhost configuration
*
* More improvements will come in next versions of Chamilo maybe in the 1.8.8
* @package chamilo.main
*/
/**
* Variables definitions and inclusions
*/
// name of the language file that needs to be included
$language_file = array('index','registration','messages','userInfo');
$cidReset = true;
require_once 'main/inc/global.inc.php';
/**
* Access permissions check
*/
api_block_anonymous_users();
/**
* Treat URL arguments
*/
$array_keys = array_keys($_GET);
if (!empty($array_keys)) {
$username = substr($array_keys[0],0,20); // max len of an username
$friend_id = UserManager::get_user_id_from_username($username);
if ($friend_id) {
SocialManager::display_individual_user($friend_id);
} else {
// we cant find your friend
header('Location: whoisonline.php');
exit;
}
} else {
// we cant find your friend
header('Location: whoisonline.php');
exit;
}