247e6b3bfb593438135c6e3fff68fc89a64ea545
2 /*=====================================================================*\
3 || ################################################################### ||
4 || # Bugdar [#]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');
27 $thepass = $password; // GAH register_globals
29 define('ISSO_ESCAPE_STRINGS', 1);
30 define('ISSO_CHECK_POST_REFERER', 1);
32 require_once($pathtoisso . 'kernel.php');
34 $bugsys->application
= 'Bugdar';
35 $bugsys->apppath
= $bugsys->fetch_sourcepath(getcwd());
36 $bugsys->appversion
= '[#]version[#]';
37 $bugsys->debug
= $debug;
38 $bugsys->sourcepath
= $bugsys->fetch_sourcepath($pathtoisso);
40 $bugsys->load('db_mysql');
41 $db->database
= $database;
42 $db->connect($servername, $username, $thepass, $usepconnect);
44 $bugsys->load('functions');
45 $bugsys->exec_sanitize_data();
49 // change cookie expiration to one hour
50 $funct->cookieexp
= 3600;
52 define('DEVDEBUG', $debug);
53 define('TABLE_PREFIX', $tableprefix);
54 define('COOKIE_PREFIX', $cookieprefix);
56 unset($database, $servername, $username, $password, $thepass, $usepconnect, $tableprefix, $cookieprefix);
58 require_once('./includes/functions_datastore.php');
59 require_once('./includes/functions.php');
61 // ###################################################################
63 $bugsys->options
= array();
64 $bugsys->userinfo
= array();
65 $bugsys->datastore
= array();
67 // ###################################################################
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 $bugsys->userinfo
= $userinfo;
97 $funct->cookie(COOKIE_PREFIX
. 'userid', $bugsys->userinfo
['userid']);
98 $funct->cookie(COOKIE_PREFIX
. 'authkey', $bugsys->userinfo
['authkey']);
104 $funct->cookie(COOKIE_PREFIX
. 'userid');
105 $funct->cookie(COOKIE_PREFIX
. 'authkey');
106 $bugsys->userinfo
= array(
112 'permissions' => $bugsys->datastore
['usergroup'][1]['permissions'],
113 'displaytitle' => $bugsys->datastore
['usergroup'][1]['displaytitle'],
117 // ###################################################################
118 // initialize localization system
119 $bugsys->load('localize');
121 require_once('./includes/language.php');
123 $LANGDATA = fetch_user_language();
124 $lang->init_with_table(fetch_strings($LANGDATA['id']));
126 $stylevar['lang'] = $LANGDATA['code'];
127 $stylevar['lang_dir'] = $LANGDATA['direction'];
128 $stylevar['charset'] = $LANGDATA['charset'];
130 // ###################################################################
131 // initialize the date system
132 $bugsys->load('date');
133 $datef->usertz
= $bugsys->userinfo
['timezone'];
134 $datef->fetch_offset();
136 // ###################################################################
138 $bugsys->load('mail');
139 $mail->from
= $bugsys->options
['webmasteremail'];
140 $mail->fromname
= $lang->string('Bugdar Notification');
142 // ###################################################################
145 require_once('./includes/permissions.php');
147 /*=====================================================================*\
148 || ###################################################################
151 || ###################################################################
152 \*=====================================================================*/