6d06b15aa4510690247a726b158796fb11072e45
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
30 define('ISSO_ESCAPE_STRINGS', 1);
31 define('ISSO_CHECK_POST_REFERER', 1);
33 require_once($pathtoisso . 'kernel.php');
35 $bugsys->application
= 'Bugdar';
36 $bugsys->apppath
= $bugsys->fetch_sourcepath(getcwd());
37 $bugsys->appversion
= '[#]version[#]';
38 $bugsys->debug
= $debug;
39 $bugsys->sourcepath
= $bugsys->fetch_sourcepath($pathtoisso);
41 $bugsys->load('db_mysql');
42 $db->database
= $database;
43 $db->connect($servername, $username, $thepass, $usepconnect);
45 $bugsys->load('functions');
46 $bugsys->exec_sanitize_data();
50 // change cookie expiration to one hour
51 $funct->cookieexp
= 3600;
53 define('DEVDEBUG', $debug);
54 define('TABLE_PREFIX', $tableprefix);
55 define('COOKIE_PREFIX', $cookieprefix);
57 unset($database, $servername, $theuser, $password, $thepass, $usepconnect, $tableprefix, $cookieprefix);
59 require_once('./includes/functions_datastore.php');
60 require_once('./includes/functions.php');
62 // ###################################################################
64 $bugsys->options
= array();
65 $bugsys->userinfo
= array();
66 $bugsys->datastore
= array();
68 // ###################################################################
70 header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
71 header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
72 header("Cache-Control: no-store, no-cache, must-revalidate");
73 header("Cache-Control: post-check=0, pre-check=0", false
);
74 header("Pragma: no-cache");
76 // ###################################################################
77 // populate our caches
78 $datastoretemp = $db->query("SELECT * FROM " . TABLE_PREFIX
. "datastore");
79 while ($store = $db->fetch_array($datastoretemp))
81 $bugsys->datastore
["$store[title]"] = unserialize($store['data']);
83 $bugsys->options
= $bugsys->datastore
['setting'];
84 unset($bugsys->datastore
['setting']);
86 // ###################################################################
88 $userid = intval($bugsys->in
[COOKIE_PREFIX
. 'userid']);
92 $userinfo = $db->query_first("SELECT * FROM " . TABLE_PREFIX
. "user WHERE userid = $userid");
93 if (is_array($userinfo) AND $bugsys->in
[COOKIE_PREFIX
. 'authkey'] == $userinfo['authkey'])
95 $userinfo['permissions'] = (int)$bugsys->datastore
['usergroup']["$userinfo[usergroupid]"]['permissions'];
96 $userinfo['displaytitle'] = $bugsys->datastore
['usergroup']["$userinfo[usergroupid]"]['displaytitle'];
97 $bugsys->userinfo
= $userinfo;
98 $funct->cookie(COOKIE_PREFIX
. 'userid', $bugsys->userinfo
['userid']);
99 $funct->cookie(COOKIE_PREFIX
. 'authkey', $bugsys->userinfo
['authkey']);
105 $funct->cookie(COOKIE_PREFIX
. 'userid');
106 $funct->cookie(COOKIE_PREFIX
. 'authkey');
107 $bugsys->userinfo
= array(
113 'permissions' => $bugsys->datastore
['usergroup'][1]['permissions'],
114 'displaytitle' => $bugsys->datastore
['usergroup'][1]['displaytitle'],
118 // ###################################################################
119 // initialize localization system
120 $bugsys->load('localize');
122 require_once('./includes/language.php');
124 $LANGDATA = fetch_user_language();
125 $lang->init_with_table(fetch_strings($LANGDATA['id']));
127 $stylevar['lang'] = $LANGDATA['code'];
128 $stylevar['lang_dir'] = $LANGDATA['direction'];
129 $stylevar['charset'] = $LANGDATA['charset'];
131 // ###################################################################
132 // initialize the date system
133 $bugsys->load('date');
134 $datef->usertz
= $bugsys->userinfo
['timezone'];
135 $datef->fetch_offset();
137 // ###################################################################
139 $bugsys->load('mail');
140 $mail->from
= $bugsys->options
['webmasteremail'];
141 $mail->fromname
= $lang->string('Bugdar Notification');
143 // ###################################################################
146 require_once('./includes/permissions.php');
148 /*=====================================================================*\
149 || ###################################################################
152 || ###################################################################
153 \*=====================================================================*/