3 * User information page
5 * Copyright 1999-2001 (c) VA Linux Systems
6 * Copyright 2002-2004 (c) GForge Team
7 * Copyright 2010-2011, Franck Villaume - Capgemini
8 * http://fusionforge.org/
10 * This file is part of FusionForge. FusionForge is free software;
11 * you can redistribute it and/or modify it under the terms of the
12 * GNU General Public License as published by the Free Software
13 * Foundation; either version 2 of the Licence, or (at your option)
16 * FusionForge is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License along
22 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 require_once 'env.inc.php';
27 require_once $gfcommon.'include/pre.php';
28 require_once $gfcommon.'include/User.class.php';
30 $normalized_urlprefix = normalized_urlprefix();
31 $pathinfo = substr_replace(getStringFromServer('REQUEST_URI'), '', 0, strlen($normalized_urlprefix)-1);
32 $expl_pathinfo = explode('/', $pathinfo);
34 if (!$expl_pathinfo[2]) {
35 exit_error(_('No User Name Provided'));
38 $default_content_type = 'text/html';
40 $default_content_type = 'text/html';
42 $content_type = util_negociate_alternate_content_types($script, $default_content_type);
44 $username = urldecode($expl_pathinfo[2]);
46 //get the user object based on the user_name in the URL
47 $user =& user_get_object_by_name($username);
49 if (!$user || !is_object($user) || $user->isError() || !$user->isActive()) {
51 exit_error(_('That user does not exist.'));
54 // if a custom content-type is selected, then redirect to plugin's rendering
55 if($content_type != $default_content_type) {
56 $hook_params = array();
57 $hook_params['username'] = $username;
58 $hook_params['accept'] = $content_type;
59 $hook_params['return'] = '';
60 plugin_hook_by_reference('content_negociated_user_home', $hook_params);
61 if($hook_params['content_type'] != ''){
62 header('Content-type: '. $hook_params['content_type']);
63 echo $hook_params['content'];
66 header('HTTP/1.1 406 Not Acceptable',true,406);
69 } else { // default HTML view
70 $user_id = $user->getID();
72 //now show the user page
73 include $gfwww.'include/user_home.php';
79 // c-file-style: "bsd"