<?php
/**
 * Projects Redirector
 *
 * Copyright 1999-2001 (c) VA Linux Systems
 * The rest Copyright 2002-2004 (c) GForge Team
 * http://gforge.org/
 *
 * @version   $Id: projects,v 1.4 2011/08/23 16:04:38 jisrael Exp $
 *
 * 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
 */

/*
   * Change log
   * name    changeID   date      	comment
   * ------- ---------- --------  	----------------------------------------------------------------
   * jisrael [#5712]    20110811	use global constant $sys_community_group_id newly created in /etc/gforge/local.inc
   *									instead of 'if ($group_id == 6)'
*/

require_once('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 {
	// Divert to Biosite.rdf request
	if ( stripos($subpage,'biosite')  !== false) {
		require('www/include/biosite.php');
		exit();
	}
	if ($subpage == "admin") {
		session_redirect("/project/admin/?group_id=$group_id");
		exit();
	} else if ($subpage == "files" || $subpage == "download" || $subpage == "dl") {
		if ($subpage2 == "release") {
			session_redirect("/frs/admin/qrs.php?group_id=$group_id");
		} else {
			session_redirect("/frs/?group_id=$group_id");
		}
		exit();
	} else if ($subpage == "cvs") {
		header("Location: ".account_group_cvsweb_url($project->getUnixName()));
		exit();
	} else if ($group_id == $sys_community_group_id){
		//Judi 8.22.2011 - #5712 use global constant $sys_community_group_id instead of hardcoded 6 in line above
		include('community_home.php');
	} else {
		//show the project summary page
		include('project_home.php');
	}
}

?>