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->load('mail'); $bugsys->exec_sanitize_data(); // 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); define('LOG_TIME', time()); 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']); //$mail->from = $bugsys->options['webmasteremail']; //$mail->fromname = 'BugStrike Notification'; // ################################################################### // 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' => '', 'permissions' => $bugsys->datastore['usergroup'][1]['permissions'], 'displaytitle' => $bugsys->datastore['usergroup'][1]['displaytitle'], 'mdisplayname' => $bugsys->datastore['usergroup'][1]['opentag'] . '' . $bugsys->datastore['usergroup'][1]['closetag'] ); } // ################################################################### // load language information require_once('./includes/class_language.php'); $bugsys->lang =& lang::init(); // ################################################################### // initialize the date system $bugsys->load('date'); $datef->usertz = $bugsys->userinfo['timezone']; $datef->fetch_offset(); // ################################################################### // 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 comments 'caneditothers' => 512, // can edit others' comments 'caneditinfo' => 1024, // can edit bug info -- works in conjunction with canedit(own|others) '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 ); foreach ($_PERMISSION AS $name => $maskvalue) { define(strtoupper($name), $maskvalue); } /*=====================================================================*\ || ################################################################### || # $HeadURL$ || # $Id$ || ################################################################### \*=====================================================================*/ ?>