Location: PHPKode > projects > BugIn and Ticketing System > bugin-0.65/index.php
<?php
header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT");    // Date in the past
header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); 
					      // always modified 
header ("Cache-Control: no-cache, must-revalidate");  // HTTP/1.1
header ("Pragma: no-cache");			  // HTTP/1.0

       # session lifetime is 90 days.  Good luck keeping your browser open that long!
ini_set("session.gc_maxlifetime", 60*60*24*90);

$meta = "";
$bodyOptions = "";

function unquoteValues($input) {
	if (is_array($input)) {
		$fixedValue = array();
		while (list($key, $value) = each($input)) {
			$fixedValue[$key] = unquoteValues($value);
		}
	}
	else {
		$fixedValue = stripslashes($input);
	}
	return $fixedValue;
}

$buginVersion = "v0.65-RC1";
//Grab major/minors out of phpversion().
ereg("([0-9]{1,2}.[0-9]{1,2}).([0-9]{1,2})", phpversion(), $phpVersion);

if ($phpVersion[1] < 4.1)
{
	exit("ERROR: BugIn {$buginVersion} requires PHP version 4.1.0 or above, you are running {$phpVersion[1]}.{$phpVersion[2]}, please upgrade.<br><a href=http://www.php.net/downloads.php>http://www.php.net/downloads.php</a>");
}
// Stupid REGISTER_GLOBAL_VARIABLES clearinghouse...
while (list($key, $reqValue) = @each($_REQUEST)) {
	if (isset($$key)) {
		unset($$key);
	}
	if (get_magic_quotes_gpc()) {
		$_REQUEST[$key] = unquoteValues($reqValue);
	}
}


require_once("conf/config.inc.php");

if ($bugDatabase) {

	// Begin the session.
	session_start();
	setcookie(session_name(), session_id(), 0);
	if (isset($_SESSION['debug'])) {
		$options['debug'] = $_SESSION['debug']['debug'];
		$options['norefresh'] = $_SESSION['debug']['norefresh'];
		if ($options['debug'])
			$bugDatabase->db->debug = 1;

	}

	// Try and mask the session name with a randomly
	// generated cookie name

	if (isset($_REQUEST['area'])) {
		$area = basename($_REQUEST['area']);
	}

	if (isset($_REQUEST['mod']))
		$mod = validateMod($_REQUEST['mod'], $area);

	require_once($options['buginLibBase']."/auth.inc.php");
	if (isset($userinfo['lang'])) {
		$language = $bugDatabase->lists['lang'][$userinfo['lang']]['name'];
	}
	else {
		$language = $bugDatabase->lists['lang'][$options['defaultLanguage']]['name'];
	}
	require_once("{$options['buginBase']}conf/lang/lang.{$language}.php");

	// Include the additional config files....
	require($options['buginBase']."/conf/list.inc.php");
	if (file_exists($options['buginBase']."/conf/list.local.inc.php")) {
		include($options['buginBase']."/conf/list.local.inc.php");
	}

	// For pre-header information.
	require($options['buginIncBase']."/pre/{$area}.pre.inc.php");
	require($options['buginBase']."/conf/titles.inc.php");
	require($options['buginIncBase']."/template/header.inc.php");

	if ($area != 'template/footer')
		require($options['buginIncBase']."/{$area}.inc.php");
	require($options['buginIncBase']."/template/footer.inc.php");
}
else {
	// Error in the DB.  aaargh
	$loginError = "The DB server seems to be down or inaccessable.";
	include $options['buginIncBase']."/template/header.inc.php";
	include $options['buginIncBase']."/error.inc.php";
	include $options['buginIncBase']."/template/footer.inc.php";
}

?>
Return current item: BugIn and Ticketing System