<?php
/**
 * Projects Redirector
 *
 * Copyright 1999-2001 (c) VA Linux Systems
 * The rest Copyright 2002-2004 (c) GForge Team
 * http://gforge.org/
 *
 * This file is part of GForge.
 *
 * GForge 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 License, or
 * (at your option) any later version.
 *
 * GForge 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 GForge; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

require_once 'env.inc.php';
require_once $gfwww.'include/pre.php';    

//
//	IMPORTANT NOTE!!
//	Setting up the $project object is all being 
//	handled in the logger now
//	This was done so the logger would accurately record these pages
//

//
//	test to see if the logger was successful in setting up the objects
//
if (!$group_id || !$project) {
	exit_error("Invalid Project","Invalid Project");
} else {
	$subpage = getStringFromRequest('subpage');

	if ($subpage == "admin") {
		session_redirect(util_make_url("/project/admin/?group_id=$group_id"));
		exit();
	} else if ($subpage == "files" || $subpage == "download" || $subpage == "dl") {
		if (getStringFromRequest('subpage2') == "release") {
			session_redirect(util_make_url("/frs/admin/qrs.php?group_id=$group_id"));
		} else {
			session_redirect(util_make_url("/frs/?group_id=$group_id"));
		}
		exit();
	} else if ($subpage == "cvs") {
		header("Location: ".account_group_cvsweb_url($project->getUnixName()));
		exit();
	}  else {
		//show the project summary page
		include $gfwww.'include/project_home.php';
	}
}

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

?>
