setAppPath(getcwd());
$bugsys->setApplication('Bugdar');
$bugsys->setAppVersion(BUGDAR_VERSION);
if (!file_exists('./includes/config.php'))
{
echo 'includes/config.php needs to be present!';
exit;
}
require_once('./includes/config.php');
$bugsys->setDebug($debug);
define('ISSO_DB_LAYER', 'db_mysql');
$bugsys->load('db_mysql', 'db', true);
$db->connect($servername, $username, $password, $database, $usepconnect);
if ($utf8)
{
$db->query("SET NAMES utf8");
}
// needed for API validation
$bugsys->load('functions', 'funct');
define('DEVDEBUG', $debug);
define('TABLE_PREFIX', $tableprefix);
define('COOKIE_PREFIX', $cookieprefix);
unset($database, $servername, $username, $password, $usepconnect, $tableprefix, $cookieprefix);
require_once('./includes/functions_datastore.php');
require_once('./includes/functions.php');
require_once('./includes/language.php');
require_once('./includes/permissions.php');
// ###################################################################
// init the big three
bugdar::$options = array();
bugdar::$userinfo = array();
bugdar::$datastore = array();
// ###################################################################
$bugsys->versions = array(
'1.0.0' => 1,
'1.0.1' => 2,
'1.1.0 Beta 1' => 3,
'1.1.0 Beta 2' => 4,
'1.1.0 Release Candidate 1' => 5,
'1.1.0' => 6,
'1.1.1' => 7,
'1.1.2' => 8,
'1.1.3' => 9,
'1.1.4' => 10,
'1.1.5' => 11,
'1.2.0 Beta 1' => 12,
'1.2.0 Beta 2' => 13,
'1.2.0 Beta 3' => 14,
'1.2.0 Release Candidate 1' => 15,
'1.2.0' => 16,
'1.2.1' => 17,
'1.2.2' => -1
);
// ###################################################################
$bugsys->load('installer', null);
$input->inputClean('mark', TYPE_UINT);
if ($input->in['mark'] == STOP_MARK)
{
if (!preg_match('#^upgrade([0-9]*)\.php$#i', ACTIVE_SITE, $matches))
{
define('STOP_LINK', 'Go to the Administrative Control Panel');
}
else
{
$temp = array_values($bugsys->versions);
if ($temp["$matches[1]"] != -1)
{
header("Location: upgrade.php");
}
else
{
define('STOP_LINK', 'Go to the Administrative Control Panel');
}
}
}
/*=====================================================================*\
|| ###################################################################
|| # $HeadURL$
|| # $Id$
|| ###################################################################
\*=====================================================================*/
?>