2 /*=====================================================================*\
3 || ################################################################### ||
4 || # BugStrike [#]version[#]
5 || # --------------------------------------------------------------- # ||
6 || # Copyright ©2002-[#]year[#] by Iris Studios, Inc. All Rights Reserved. # ||
7 || # This file may not be reproduced in any way without permission. # ||
8 || # --------------------------------------------------------------- # ||
9 || # User License Agreement at http://www.iris-studios.com/license/ # ||
10 || ################################################################### ||
11 \*=====================================================================*/
13 error_reporting(E_ALL
& ~E_NOTICE
);
15 // ###################################################################
16 // initialize the database
18 define('ISSO_MT_START', microtime());
20 if (!file_exists('./includes/config.php'))
22 echo 'includes/config.php needs to be present!';
26 require_once('./includes/config.php');
28 define('ISSO_ESCAPE_STRINGS', 1);
29 define('ISSO_CHECK_POST_REFERER', 1);
31 require_once($pathtoisso . 'kernel.php');
33 $bugsys->application
= 'BugStrike';
34 $bugsys->apppath
= $bugsys->fetch_sourcepath(getcwd());
35 $bugsys->appversion
= '[#]version[#]';
36 $bugsys->debug
= $debug;
37 $bugsys->sourcepath
= $bugsys->fetch_sourcepath($pathtoisso);
39 $bugsys->load('db_mysql');
40 $db->database
= $database;
41 $db->connect($servername, $username, $password, $usepconnect);
43 $bugsys->load('functions');
44 $bugsys->exec_sanitize_data();
48 // change cookie expiration to one hour
49 $funct->cookieexp
= 3600;
51 define('DEVDEBUG', $debug);
52 define('TABLE_PREFIX', $tableprefix);
53 define('COOKIE_PREFIX', $cookieprefix);
55 unset($database, $servername, $username, $password, $usepconnect, $tableprefix, $cookieprefix);
57 require_once('./includes/functions_datastore.php');
58 require_once('./includes/functions.php');
60 // ###################################################################
62 $bugsys->options
= array();
63 $bugsys->userinfo
= array();
64 $bugsys->datastore
= array();
66 // ###################################################################
69 header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
70 header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
71 header("Cache-Control: no-store, no-cache, must-revalidate");
72 header("Cache-Control: post-check=0, pre-check=0", false
);
73 header("Pragma: no-cache");
75 // ###################################################################
76 // populate our caches
77 $datastoretemp = $db->query("SELECT * FROM " . TABLE_PREFIX
. "datastore");
78 while ($store = $db->fetch_array($datastoretemp))
80 $bugsys->datastore
["$store[title]"] = unserialize($store['data']);
82 $bugsys->options
= $bugsys->datastore
['setting'];
83 unset($bugsys->datastore
['setting']);
85 // ###################################################################
87 $userid = intval($bugsys->in
[COOKIE_PREFIX
. 'userid']);
91 $userinfo = $db->query_first("SELECT * FROM " . TABLE_PREFIX
. "user WHERE userid = $userid");
92 if (is_array($userinfo) AND $bugsys->in
[COOKIE_PREFIX
. 'authkey'] == $userinfo['authkey'])
94 $userinfo['permissions'] = (int)$bugsys->datastore
['usergroup']["$userinfo[usergroupid]"]['permissions'];
95 $userinfo['displaytitle'] = $bugsys->datastore
['usergroup']["$userinfo[usergroupid]"]['displaytitle'];
96 fetch_user_display_name($userinfo);
97 $userinfo['mdisplayname'] = $bugsys->datastore
['usergroup']["$userinfo[usergroupid]"]['opentag'] . $userinfo['displayname'] . $bugsys->datastore
['usergroup']["$userinfo[usergroupid]"]['closetag'];
98 $bugsys->userinfo
= $userinfo;
99 $funct->cookie(COOKIE_PREFIX
. 'userid', $bugsys->userinfo
['userid']);
100 $funct->cookie(COOKIE_PREFIX
. 'authkey', $bugsys->userinfo
['authkey']);
106 $funct->cookie(COOKIE_PREFIX
. 'userid');
107 $funct->cookie(COOKIE_PREFIX
. 'authkey');
108 $bugsys->userinfo
= array(
114 'permissions' => $bugsys->datastore
['usergroup'][1]['permissions'],
115 'displaytitle' => $bugsys->datastore
['usergroup'][1]['displaytitle'],
116 'mdisplayname' => $bugsys->datastore
['usergroup'][1]['opentag'] . '' . $bugsys->datastore
['usergroup'][1]['closetag']
120 // ###################################################################
121 // initialize localization system
122 $bugsys->load('localize');
124 require_once('./includes/language.php');
126 $LANGDATA = fetch_user_language();
127 $lang->init_with_table(fetch_strings($LANGDATA['id']));
129 $stylevar['lang'] = $LANGDATA['code'];
130 $stylevar['charset'] = $LANGDATA['charset'];
132 // ###################################################################
133 // initialize the date system
134 $bugsys->load('date');
135 $datef->usertz
= $bugsys->userinfo
['timezone'];
136 $datef->fetch_offset();
138 // ###################################################################
140 $bugsys->load('mail');
141 $mail->from
= $bugsys->options
['webmasteremail'];
142 $mail->fromname
= $lang->string('BugStrike Notification');
144 // ###################################################################
147 require_once('./includes/permissions.php');
149 /*=====================================================================*\
150 || ###################################################################
153 || ###################################################################
154 \*=====================================================================*/