<?php
/**
 * User information page
 *
 * Copyright 1999-2001 (c) VA Linux Systems
 * Copyright 2002-2004 (c) GForge Team
 * Copyright 2010 (c) Franck Villaume - Capgemini
 * http://fusionforge.org/
 *
 * This file is part of FusionForge. FusionForge is free software;
 * you can redistribute it and/or modify it under the terms of the
 * GNU General Public License as published by the Free Software
 * Foundation; either version 2 of the Licence, or (at your option)
 * any later version.
 *
 * FusionForge is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */

require_once 'env.inc.php';
require_once $gfcommon.'include/pre.php';    
require_once $gfcommon.'include/User.class.php';    

$normalized_urlprefix = normalized_urlprefix();
$pathinfo = substr_replace(getStringFromServer('REQUEST_URI'), '', 0, strlen($normalized_urlprefix)-1);
$expl_pathinfo = explode('/', $pathinfo);

if (!$expl_pathinfo[2]) {
	exit_error(_('No User Name Provided'));
}

//get the user object based on the user_name in the URL
$user =& user_get_object_by_name( urldecode($expl_pathinfo[2]) );

if (!$user || !is_object($user) || $user->isError() || !$user->isActive()) {

	exit_error(_('That user does not exist.'));

} else {

	$user_id = $user->getID();

	//now show the user page
	include $gfwww.'include/user_home.php';

}

// Local Variables:
// mode: php
// c-file-style: "bsd"
// End:

?>
