application = 'BugStrike'; $bugsys->apppath = $bugsys->fetch_sourcepath(getcwd()); $bugsys->appversion = '[#]version[#]'; $bugsys->debug = $debug; $bugsys->sourcepath = $bugsys->fetch_sourcepath($pathtoisso); $bugsys->load('db_mysql'); $db->database = $database; $db->connect($servername, $username, $password, $usepconnect); $bugsys->load('functions'); $bugsys->exec_sanitize_data(); $bugsys->load('xml'); // change cookie expiration to one hour $funct->cookieexp = 3600; 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'); // ################################################################### // init the big three $bugsys->options = array(); $bugsys->userinfo = array(); $bugsys->datastore = array(); // ################################################################### // populate our caches $datastoretemp = $db->query("SELECT * FROM " . TABLE_PREFIX . "datastore"); while ($store = $db->fetch_array($datastoretemp)) { $bugsys->datastore["$store[title]"] = unserialize($store['data']); } $bugsys->options = $bugsys->datastore['setting']; unset($bugsys->datastore['setting']); // ################################################################### // load userinfo $userid = intval($bugsys->in[COOKIE_PREFIX . 'userid']); if ($userid) { $userinfo = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "user WHERE userid = $userid"); if (is_array($userinfo) AND $bugsys->in[COOKIE_PREFIX . 'authkey'] == $userinfo['authkey']) { $userinfo['permissions'] = (int)$bugsys->datastore['usergroup']["$userinfo[usergroupid]"]['permissions']; $userinfo['displaytitle'] = $bugsys->datastore['usergroup']["$userinfo[usergroupid]"]['displaytitle']; fetch_user_display_name($userinfo); $userinfo['mdisplayname'] = $bugsys->datastore['usergroup']["$userinfo[usergroupid]"]['opentag'] . $userinfo['displayname'] . $bugsys->datastore['usergroup']["$userinfo[usergroupid]"]['closetag']; $bugsys->userinfo = $userinfo; $funct->cookie(COOKIE_PREFIX . 'userid', $bugsys->userinfo['userid']); $funct->cookie(COOKIE_PREFIX . 'authkey', $bugsys->userinfo['authkey']); } } if (!$userinfo) { $funct->cookie(COOKIE_PREFIX . 'userid'); $funct->cookie(COOKIE_PREFIX . 'authkey'); $bugsys->userinfo = array( 'usergroupid' => 1, 'userid' => 0, 'email' => '', 'displayname' => '', 'showcolours' => 1, 'permissions' => $bugsys->datastore['usergroup'][1]['permissions'], 'displaytitle' => $bugsys->datastore['usergroup'][1]['displaytitle'], 'mdisplayname' => $bugsys->datastore['usergroup'][1]['opentag'] . '' . $bugsys->datastore['usergroup'][1]['closetag'] ); } // ################################################################### // initialize localization system $bugsys->load('localize'); require_once('./includes/language.php'); $LANGDATA = fetch_user_language(); $lang->init_with_table(fetch_strings($LANGDATA['id'])); $stylevar['lang'] = $LANGDATA['code']; $stylevar['charset'] = $LANGDATA['charset']; // ################################################################### // initialize the date system $bugsys->load('date'); $datef->usertz = $bugsys->userinfo['timezone']; $datef->fetch_offset(); // ################################################################### // mail system $bugsys->load('mail'); $mail->from = $bugsys->options['webmasteremail']; $mail->fromname = $lang->string('BugStrike Notification'); // ################################################################### // Initialize usergroup system $_PERMISSION = array( 'canviewbugs' => 1, // can view bugs 'cansearch' => 2, // can use the search 'cansubscribe' => 4, // can email subscribe 'canvote' => 8, // can vote on bugs 'cansubmitbugs' => 16, // can submit new bugs 'canpostcomments' => 32, // can post new comments 'cangetattach' => 64, // can dl attachments 'canputattach' => 128, // can ul attachments 'caneditown' => 256, // can edit own bugs 'caneditother' => 512, // can edit others' bugs 'caneditownreply' => 1024, // can edit own comments 'canassign' => 2048, // can assign bug 'canchangestatus' => 4096, // can change bug status 'canadminpanel' => 8192, // can view admin panel 'canadminbugs' => 16384, // can administrate bug functions 'canadminversions' => 32768, // can admin version info 'canadminusers' => 65536, // can admin users 'canadmingroups' => 131072, // can admin permission masks 'canadmintools' => 262144, // can use admin tools 'canadminfields' => 524288, // can admin custom bug fields 'canbeassignedto' => 1048576, // can be assigned bugs, 'caneditattach' => 2097152, // can edit attachments 'canviewhidden' => 4194304, // can see hidden bugs 'caneditotherreply' => 8388608 // can edit other peoples' comments ); foreach ($_PERMISSION AS $name => $maskvalue) { define(strtoupper($name), $maskvalue); } /*=====================================================================*\ || ################################################################### || # $HeadURL$ || # $Id$ || ################################################################### \*=====================================================================*/ ?>