From 910ad5d5f5ea6d7919f9390dbcfe3dea403e6792 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Wed, 25 Jun 2008 11:36:06 -0400 Subject: [PATCH] Change the big three $bugsys arrays to be a bugdar class --- admin/global.php | 6 +- admin/index.php | 8 +-- admin/language.php | 2 +- admin/setting.php | 60 +++++++++---------- admin/user.php | 8 +-- admin/usergroup.php | 4 +- attachment.php | 10 ++-- docs/populate.php | 22 +++---- editcomment.php | 6 +- editreport.php | 16 ++--- explain.php | 14 ++--- favorite.php | 10 ++-- global.php | 2 +- help.php | 4 +- includes/class_logging.php | 2 +- includes/class_message_reporter.php | 2 +- includes/class_sort.php | 2 +- includes/functions.php | 66 ++++++++++----------- includes/functions_datastore.php | 30 +++++----- includes/functions_product.php | 14 ++--- includes/init.php | 36 ++++++----- includes/language.php | 16 ++--- index.php | 6 +- install/global.php | 6 +- locale/en_US/emails/accountapproved.xml.tpl | 4 +- locale/en_US/emails/activateaccount.xml.tpl | 6 +- locale/en_US/emails/passwordreset.xml.tpl | 6 +- locale/en_US/emails/welcome.xml.tpl | 4 +- login.php | 6 +- newreport.php | 40 ++++++------- register.php | 26 ++++---- search.php | 56 ++++++++--------- showhistory.php | 8 +-- showreport.php | 52 ++++++++-------- syndicate.php | 14 ++--- templates/explain_automation.tpl | 2 +- templates/explain_product.tpl | 2 +- templates/favorites.tpl | 2 +- templates/header.tpl | 10 ++-- templates/login.tpl | 2 +- templates/lostpassword.tpl | 2 +- templates/newreport.tpl | 4 +- templates/passwordreset.tpl | 2 +- templates/quicksearch.tpl | 2 +- templates/register.tpl | 2 +- templates/search.tpl | 4 +- templates/search_results.tpl | 2 +- templates/search_save.tpl | 2 +- templates/search_update.tpl | 4 +- templates/std_error.tpl | 2 +- templates/std_message.tpl | 2 +- templates/std_redirect.tpl | 2 +- templates/trackerhome.tpl | 2 +- templates/trackerhome_bits.tpl | 2 +- templates/userctrl.tpl | 6 +- userctrl.php | 28 ++++----- vote.php | 8 +-- 57 files changed, 336 insertions(+), 332 deletions(-) diff --git a/admin/global.php b/admin/global.php index 89eacdf..5a0894c 100755 --- a/admin/global.php +++ b/admin/global.php @@ -54,12 +54,12 @@ function admin_login() define('ISSO_PRINTER_NO_NAVIGATION', 1); - $admin->page_start(T('Login'), null, '', 'document.cplogin.' . ($bugsys->userinfo['email'] ? 'password' : 'email') . '.focus();'); + $admin->page_start(T('Login'), null, '', 'document.cplogin.' . (bugdar::$userinfo['email'] ? 'password' : 'email') . '.focus();'); $admin->form_start('../login.php', 'cplogin', false, 'cplogin'); $admin->table_start(true, '425'); $admin->table_head(T('Login to Bugdar')); - $admin->row_input(T('Email'), 'email', $bugsys->userinfo['email'], 2, 35, false, false, 'middle'); + $admin->row_input(T('Email'), 'email', bugdar::$userinfo['email'], 2, 35, false, false, 'middle'); $admin->row_input(T('Password'), 'password', '', 2, 35, false, true, 'middle'); $admin->row_submit('', T('Login')); $admin->table_end(); @@ -73,7 +73,7 @@ function admin_login() if (can_perform('canadminpanel')) { $session = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "adminsession WHERE sessionid = '" . $bugsys->input_escape(COOKIE_PREFIX . 'adminsession') . "'"); - if ($session AND $session['userid'] == $bugsys->userinfo['userid'] AND $session['dateline'] >= (TIMENOW - 3600)) + if ($session AND $session['userid'] == bugdar::$userinfo['userid'] AND $session['dateline'] >= (TIMENOW - 3600)) { // renew the cookie $funct->cookie(COOKIE_PREFIX . 'adminsession', $session['sessionid'], false); diff --git a/admin/index.php b/admin/index.php index 4375764..ea3a906 100755 --- a/admin/index.php +++ b/admin/index.php @@ -31,17 +31,17 @@ $admin->page_start(T('Home')); if (!(defined('NO_VERSION_CHECK') AND constant('NO_VERSION_CHECK') == true)) { - $check = @file_get_contents('http://www.bluestatic.org/versioncheck.php?prod=bugdar&ver=' . str_replace(' ', '-', $bugsys->options['trackerversion'])); + $check = @file_get_contents('http://www.bluestatic.org/versioncheck.php?prod=bugdar&ver=' . str_replace(' ', '-', bugdar::$options['trackerversion'])); if (strpos($check, '') !== false) { $check = $bugsys->xml->parse($check); if (isset($check['version-check']['update'])) { - $admin->page_code('
' . T('Update Avaliable') . ':
' . sprintf(T('Your installation of Bugdar is out-of-date. You are running version %1$s and the latest version is %2$s. You can download the update at Blue Static\'s website. You are strongly encouraged to apply all updates to fix bugs and any security issues (if present).'), $bugsys->options['trackerversion'], $check['version-check']['update']['value']) . '
'); + $admin->page_code('
' . T('Update Avaliable') . ':
' . sprintf(T('Your installation of Bugdar is out-of-date. You are running version %1$s and the latest version is %2$s. You can download the update at Blue Static\'s website. You are strongly encouraged to apply all updates to fix bugs and any security issues (if present).'), bugdar::$options['trackerversion'], $check['version-check']['update']['value']) . '
'); } else if (isset($check['version-check']['up-to-date'])) { - $admin->page_code('
' . T('Up-to-Date') . ':
' . sprintf(T('Your installation of Bugdar is up-to-date. You are running version %1$s.'), $bugsys->options['trackerversion']) . '
'); + $admin->page_code('
' . T('Up-to-Date') . ':
' . sprintf(T('Your installation of Bugdar is up-to-date. You are running version %1$s.'), bugdar::$options['trackerversion']) . '
'); } } } @@ -53,7 +53,7 @@ $admin->table_head(T('Welcome to the Bugdar Admin Panel')); // ------------------------------------------------------------------- $admin->row_span(T('Version Information'), 'thead'); -$admin->row_text(T('Bugdar Version'), $bugsys->options['trackerversion']); +$admin->row_text(T('Bugdar Version'), bugdar::$options['trackerversion']); $admin->row_text(T('PHP Version'), phpversion()); $mysql = $db->query_first("SELECT VERSION() AS version"); diff --git a/admin/language.php b/admin/language.php index fdad158..237a902 100644 --- a/admin/language.php +++ b/admin/language.php @@ -176,7 +176,7 @@ if ($_REQUEST['do'] == 'modify') $admin->row_multi_item(array( "$language[title]" => 'l', $language['langcode'] . ' / ' . $language['charset'] => 'c', - (($bugsys->options['defaultlanguage'] == $language['languageid']) ? '' . T('DEFAULT LANGUAGE') . ' / ' : '') . ($language['userselect'] ? T('User Selectable') : T('Private')) => 'c' + ((bugdar::$options['defaultlanguage'] == $language['languageid']) ? '' . T('DEFAULT LANGUAGE') . ' / ' : '') . ($language['userselect'] ? T('User Selectable') : T('Private')) => 'c' )); } diff --git a/admin/setting.php b/admin/setting.php index 359e278..07982d6 100755 --- a/admin/setting.php +++ b/admin/setting.php @@ -89,58 +89,58 @@ if ($_REQUEST['do'] == 'modify') { if (preg_match('#auth_(.*)\.php#', $path, $matches)) { - $admin->list_item(ucwords(str_replace('_', ' ', $matches[1])), $matches[1], ($matches[1] == $bugsys->options['authmethod'])); + $admin->list_item(ucwords(str_replace('_', ' ', $matches[1])), $matches[1], ($matches[1] == bugdar::$options['authmethod'])); } } $admin->row_list(T('The authentication class to use to validate cookie data and longins. You may need to edit the actual file for certain authentication systems.'), 'setting[authmethod]'); // allownewreg $admin->row_span(T('Allow New Registrations'), 'thead'); - $admin->row_yesno(T('If this is set to yes, then new users will be allowed to register.'), 'setting[allownewreg]', $bugsys->options['allownewreg']); + $admin->row_yesno(T('If this is set to yes, then new users will be allowed to register.'), 'setting[allownewreg]', bugdar::$options['allownewreg']); // verifyemail $admin->row_span(T('Require Activation Email'), 'thead'); - $admin->row_yesno(T('Setting this to yes will force all new users to verify their account with an email activation link.'), 'setting[verifyemail]', $bugsys->options['verifyemail']); + $admin->row_yesno(T('Setting this to yes will force all new users to verify their account with an email activation link.'), 'setting[verifyemail]', bugdar::$options['verifyemail']); // moderatenewusers $admin->row_span(T('Moderate New Users'), 'thead'); - $admin->row_yesno(T('All new users will have to be approved by the administration before being able to have normal user rights.'), 'setting[moderatenewusers]', $bugsys->options['moderatenewusers']); + $admin->row_yesno(T('All new users will have to be approved by the administration before being able to have normal user rights.'), 'setting[moderatenewusers]', bugdar::$options['moderatenewusers']); // sendwelcomemail $admin->row_span(T('Send New Use Welcome Email'), 'thead'); - $admin->row_yesno(T('Setting this option to yes will send each new verified user a welcome email.'), 'setting[sendwelcomemail]', $bugsys->options['sendwelcomemail']); + $admin->row_yesno(T('Setting this option to yes will send each new verified user a welcome email.'), 'setting[sendwelcomemail]', bugdar::$options['sendwelcomemail']); // webmasteremail $admin->row_span(T('Webmaster Email Address'), 'thead'); - $admin->row_input(T('The email address from which emails will be sent out.'), 'setting[webmasteremail]', $bugsys->options['webmasteremail']); + $admin->row_input(T('The email address from which emails will be sent out.'), 'setting[webmasteremail]', bugdar::$options['webmasteremail']); // trackertitle $admin->row_span(T('Tracker Title'), 'thead'); - $admin->row_input(T('The global name of the bug tracker. Example: Blue Static Bug Tracker'), 'setting[trackertitle]', $bugsys->options['trackertitle']); + $admin->row_input(T('The global name of the bug tracker. Example: Blue Static Bug Tracker'), 'setting[trackertitle]', bugdar::$options['trackertitle']); // trackerurl $admin->row_span(T('Tracker Base URL'), 'thead'); - $admin->row_input(T('The base URL of the tracker. This is used when creating external links to the tracker. Be sure that this does not end in a trailing slash ("/").
Example: http://www.bluestatic.org/bugs'), 'setting[trackerurl]', $bugsys->options['trackerurl']); + $admin->row_input(T('The base URL of the tracker. This is used when creating external links to the tracker. Be sure that this does not end in a trailing slash ("/").
Example: http://www.bluestatic.org/bugs'), 'setting[trackerurl]', bugdar::$options['trackerurl']); // dateformat $admin->row_span(T('Date Format'), 'thead'); - $admin->row_input(T('Set the date format used for bug report and comment information. This is based on PHP\'s date() function.'), 'setting[dateformat]', $bugsys->options['dateformat']); + $admin->row_input(T('Set the date format used for bug report and comment information. This is based on PHP\'s date() function.'), 'setting[dateformat]', bugdar::$options['dateformat']); // defaulttimezone $admin->row_span(T('Default Time Zone'), 'thead'); - $admin->row_text(T('This controls the time zone that all unregistered users view the tracker with.'), construct_option_select('setting[defaulttimezone]', $bugsys->datef->fetch_timezone_list(), $bugsys->options['defaulttimezone']), $bugsys->options['defaulttimezone']); + $admin->row_text(T('This controls the time zone that all unregistered users view the tracker with.'), construct_option_select('setting[defaulttimezone]', $bugsys->datef->fetch_timezone_list(), bugdar::$options['defaulttimezone']), bugdar::$options['defaulttimezone']); // defaultlanguage $admin->row_span(T('Default Language'), 'thead'); - $admin->row_text(T('You can set the default language that all new users (and guests) will use.'), construct_option_select('setting[defaultlanguage]', $bugsys->datastore['language'], $bugsys->options['defaultlanguage'], 'languageid', 'title'), $bugsys->options['defaultlanguage']); + $admin->row_text(T('You can set the default language that all new users (and guests) will use.'), construct_option_select('setting[defaultlanguage]', bugdar::$datastore['language'], bugdar::$options['defaultlanguage'], 'languageid', 'title'), bugdar::$options['defaultlanguage']); // syndicateditems $admin->row_span(T('Number of Syndicated Items'), 'thead'); - $admin->row_input(T('The number of bugs to be syndicated at any one time by the Atom XML feed.'), 'setting[syndicateditems]', $bugsys->options['syndicateditems']); + $admin->row_input(T('The number of bugs to be syndicated at any one time by the Atom XML feed.'), 'setting[syndicateditems]', bugdar::$options['syndicateditems']); // redirectheaders $admin->row_span(T('Use Header Redirects'), 'thead'); - $admin->row_yesno(T('Instead of displaying an intermediate page informing the user that their action was a success and a redirect is occurring, just send the user to the next screen using HTTP headers. This can save bandwidth.'), 'setting[redirectheaders]', $bugsys->options['redirectheaders']); + $admin->row_yesno(T('Instead of displaying an intermediate page informing the user that their action was a success and a redirect is occurring, just send the user to the next screen using HTTP headers. This can save bandwidth.'), 'setting[redirectheaders]', bugdar::$options['redirectheaders']); $admin->table_end(); @@ -150,31 +150,31 @@ if ($_REQUEST['do'] == 'modify') // allowhtml $admin->row_span(T('Allow HTML in Bug Reports'), 'thead'); - $admin->row_yesno(T('Set this to yes if you want to allow users to post raw HTML in their bug reports. This is very dangerous and it is not recommended.'), 'setting[allowhtml]', $bugsys->options['allowhtml']); + $admin->row_yesno(T('Set this to yes if you want to allow users to post raw HTML in their bug reports. This is very dangerous and it is not recommended.'), 'setting[allowhtml]', bugdar::$options['allowhtml']); // defaultseverity $admin->row_span(T('Default Severity'), 'thead'); - $admin->row_text(T('The default severity that is selected when creating a new bug report.'), construct_option_select('setting[defaultseverity]', $bugsys->datastore['severity'], $bugsys->options['defaultseverity'], 'severityid', 'severity')); + $admin->row_text(T('The default severity that is selected when creating a new bug report.'), construct_option_select('setting[defaultseverity]', bugdar::$datastore['severity'], bugdar::$options['defaultseverity'], 'severityid', 'severity')); // defaultpriority $admin->row_span(T('Default Priority'), 'thead'); - $admin->row_text(T('The default priority that will be selected when creating a new bug report. Depending on your permission setup, the user may not be able to set this in a new report so this will act as the value.'), construct_option_select('setting[defaultpriority]', $bugsys->datastore['priority'], $bugsys->options['defaultpriority'], 'priorityid', 'priority')); + $admin->row_text(T('The default priority that will be selected when creating a new bug report. Depending on your permission setup, the user may not be able to set this in a new report so this will act as the value.'), construct_option_select('setting[defaultpriority]', bugdar::$datastore['priority'], bugdar::$options['defaultpriority'], 'priorityid', 'priority')); // defaultstatus $admin->row_span(T('Default Status'), 'thead'); - $admin->row_text(T('The default default that is selected when creating a new bug report. If a user can not assign a status, this will be the one inserted into the database.'), construct_option_select('setting[defaultstatus]', $bugsys->datastore['status'], $bugsys->options['defaultstatus'], 'statusid', 'status')); + $admin->row_text(T('The default default that is selected when creating a new bug report. If a user can not assign a status, this will be the one inserted into the database.'), construct_option_select('setting[defaultstatus]', bugdar::$datastore['status'], bugdar::$options['defaultstatus'], 'statusid', 'status')); // defaultresolve $admin->row_span(T('Default Resolution'), 'thead'); - $admin->row_text(T('This is the default bug resolution. If a user is not able to change this field, setting this will act as the default value.'), construct_option_select('setting[defaultresolve]', $bugsys->datastore['resolution'], $bugsys->options['defaultresolve'], 'resolutionid', 'resolution')); + $admin->row_text(T('This is the default bug resolution. If a user is not able to change this field, setting this will act as the default value.'), construct_option_select('setting[defaultresolve]', bugdar::$datastore['resolution'], bugdar::$options['defaultresolve'], 'resolutionid', 'resolution')); // defaultassign $admin->row_span(T('Default Bug Assignment'), 'thead'); - $admin->row_text(T('This is the default developer new bugs will be assigned to. If a user does not have permisssion to assign bugs, this will be the default. If you don\'t want any default assignment, leave this as Not Selected.'), construct_option_select('setting[defaultassign]', $bugsys->datastore['assignto'], $bugsys->options['defaultassign'], 'userid', 'displayname', 0)); + $admin->row_text(T('This is the default developer new bugs will be assigned to. If a user does not have permisssion to assign bugs, this will be the default. If you don\'t want any default assignment, leave this as Not Selected.'), construct_option_select('setting[defaultassign]', bugdar::$datastore['assignto'], bugdar::$options['defaultassign'], 'userid', 'displayname', 0)); // defaultcomment $admin->row_span(T('Default Comment Text'), 'thead'); - $admin->row_textarea(T('If you wish to set a template for entering the initial comment of a bug report, then you may specify this here. However, the template will only take effect on the initial report/comment. Note: the template cannot be forced on the user as there is no way to validate it.'), 'setting[defaultcomment]', $bugsys->options['defaultcomment']); + $admin->row_textarea(T('If you wish to set a template for entering the initial comment of a bug report, then you may specify this here. However, the template will only take effect on the initial report/comment. Note: the template cannot be forced on the user as there is no way to validate it.'), 'setting[defaultcomment]', bugdar::$options['defaultcomment']); $admin->table_end(); @@ -184,15 +184,15 @@ if ($_REQUEST['do'] == 'modify') // hidestatuses $admin->row_span(T('Hide Statuses on Bug Listings'), 'thead'); - $admin->row_text(T('Here you can specify which statuses to hide on the bug list displays. Users have options in their controls to change this from these values, and this does not affect searches or the favorites list.'), construct_option_select('setting[hidestatuses]', $bugsys->datastore['status'], $bugsys->options['hidestatuses'], 'statusid', 'status', 0, true)); + $admin->row_text(T('Here you can specify which statuses to hide on the bug list displays. Users have options in their controls to change this from these values, and this does not affect searches or the favorites list.'), construct_option_select('setting[hidestatuses]', bugdar::$datastore['status'], bugdar::$options['hidestatuses'], 'statusid', 'status', 0, true)); // defaultsortkey $admin->row_span(T('Default Sort Column'), 'thead'); - $admin->row_text(T('Select the column to sort bugs by on listings. This is only a default setting which users can override in their preferences.'), construct_option_select('setting[defaultsortkey]', ListSorter::fetch_by_text(false, false), $bugsys->options['defaultsortkey'])); + $admin->row_text(T('Select the column to sort bugs by on listings. This is only a default setting which users can override in their preferences.'), construct_option_select('setting[defaultsortkey]', ListSorter::fetch_by_text(false, false), bugdar::$options['defaultsortkey'])); // defaultsortas $admin->row_span(T('Default Sort Direction'), 'thead'); - $admin->row_text(T('Specify the default direction to sort bugs in the selected column. This works with and follows the same rules as the Sort Column.'), construct_option_select('setting[defaultsortas]', ListSorter::fetch_as_text(false), $bugsys->options['defaultsortas'])); + $admin->row_text(T('Specify the default direction to sort bugs in the selected column. This works with and follows the same rules as the Sort Column.'), construct_option_select('setting[defaultsortas]', ListSorter::fetch_as_text(false), bugdar::$options['defaultsortas'])); // columnoptions $admin->row_span(T('Default Column Ordering Options'), 'thead'); @@ -206,15 +206,15 @@ if ($_REQUEST['do'] == 'modify') // defaultpp $admin->row_span(T('Default Per-Page Amount'), 'thead'); - $admin->row_input(T('The number of items (e.g. bugs) to be displayed on a page by default. The user will have the option of over-riding these values.'), 'setting[defaultpp]', $bugsys->options['defaultpp']); + $admin->row_input(T('The number of items (e.g. bugs) to be displayed on a page by default. The user will have the option of over-riding these values.'), 'setting[defaultpp]', bugdar::$options['defaultpp']); // maxpp $admin->row_span(T('Maximum Per-Page Value'), 'thead'); - $admin->row_input(T('To prevent your server from experiencing load problems, set the maximum per page limit. Specifying a value here will make sure any user-entered value will not be higher than this, preventing server load problems.'), 'setting[maxpp]', $bugsys->options['maxpp']); + $admin->row_input(T('To prevent your server from experiencing load problems, set the maximum per page limit. Specifying a value here will make sure any user-entered value will not be higher than this, preventing server load problems.'), 'setting[maxpp]', bugdar::$options['maxpp']); // pagelinks $admin->row_span(T('Number of Page Links'), 'thead'); - $admin->row_input(T('The number of pages that will appear in the page navigation system on either side of the current page. Set this to 0 to display all pages.'), 'setting[pagelinks]', $bugsys->options['pagelinks']); + $admin->row_input(T('The number of pages that will appear in the page navigation system on either side of the current page. Set this to 0 to display all pages.'), 'setting[pagelinks]', bugdar::$options['pagelinks']); $admin->table_end(); @@ -226,10 +226,10 @@ if ($_REQUEST['do'] == 'modify') // trackerversion $admin->row_span('Version Number', 'thead'); - $admin->row_input('Version Number', 'setting[trackerversion]', $bugsys->options['trackerversion']); + $admin->row_input('Version Number', 'setting[trackerversion]', bugdar::$options['trackerversion']); $admin->row_span('Custom Gettext Localizer', 'thead'); - $admin->row_yesno('Use the custom MOReader implementation rather than the built-in Gettext extension.', 'setting[devgettext]', $bugsys->options['devgettext']); + $admin->row_yesno('Use the custom MOReader implementation rather than the built-in Gettext extension.', 'setting[devgettext]', bugdar::$options['devgettext']); } // ################################################################### @@ -243,7 +243,7 @@ if ($_REQUEST['do'] == 'modify') // ################################################################### /** -* Helper function for the $bugsys->options['columnoptions'] setting +* Helper function for the bugdar::$options['columnoptions'] setting * * @return string Setting HTML code */ @@ -253,7 +253,7 @@ function ConstructColumnOptionsSetting() require_once('./includes/class_sort.php'); - $array = ($bugsys->options['columnoptions'] == null ? array('bugid' => 1, 'summary' => 2, 'userid' => 2, 'product' => 3, 'version' => 3, 'component' => 0, 'status' => 4, 'resolution' => 4, 'priority' => 5, 'severity' => 5, 'lastpost' => 6, 'votes' => 0) : $bugsys->options['columnoptions']); + $array = (bugdar::$options['columnoptions'] == null ? array('bugid' => 1, 'summary' => 2, 'userid' => 2, 'product' => 3, 'version' => 3, 'component' => 0, 'status' => 4, 'resolution' => 4, 'priority' => 5, 'severity' => 5, 'lastpost' => 6, 'votes' => 0) : bugdar::$options['columnoptions']); $return = ''; foreach (ListSorter::fetch_by_text(false, false) AS $column => $name) diff --git a/admin/user.php b/admin/user.php index a2d9a0e..1995f96 100644 --- a/admin/user.php +++ b/admin/user.php @@ -196,14 +196,14 @@ if ($_REQUEST['do'] == 'edit' OR $_REQUEST['do'] == 'add') $admin->row_input(T('Email'), 'email', $user->objdata['email']); $admin->row_input(($add ? T('Password') : T('Password (Leave blank for no change)')), 'password'); - foreach ($bugsys->datastore['usergroup'] AS $group) + foreach (bugdar::$datastore['usergroup'] AS $group) { $admin->list_item($group['title'], $group['usergroupid'], ($user->objdata['usergroupid'] == $group['usergroupid'])); } $admin->row_list(T('Primary Usergroup'), 'usergroupid'); $ids = explode(',', $user->objdata['groupids']); - foreach ($bugsys->datastore['usergroup'] AS $id => $group) + foreach (bugdar::$datastore['usergroup'] AS $id => $group) { if ($id == $user->objdata['usergroupid']) { @@ -216,7 +216,7 @@ if ($_REQUEST['do'] == 'edit' OR $_REQUEST['do'] == 'add') $admin->row_yesno(T('Show Email Publicly'), 'showemail', $user->objdata['showemail']); $admin->row_yesno(T('Show Status Colors on Bug Listings'), 'showcolors', $user->objdata['showcolors']); - foreach ($bugsys->datastore['language'] AS $language) + foreach (bugdar::$datastore['language'] AS $language) { $admin->list_item($language['title'], $language['languageid'], ($user->objdata['languageid'] == $language['languageid'])); } @@ -229,7 +229,7 @@ if ($_REQUEST['do'] == 'edit' OR $_REQUEST['do'] == 'add') $admin->row_list(T('Timezone'), 'timezone'); $admin->row_yesno(T('Observe Daylight Savings Time (DST)'), 'usedst', $user->objdata['usedst']); - $admin->row_text(T('Hidden Statuses on Bug Listing'), construct_option_select('hidestatuses', $bugsys->datastore['status'], $user->objdata['hidestatuses'], 'statusid', 'status', 0, true)); + $admin->row_text(T('Hidden Statuses on Bug Listing'), construct_option_select('hidestatuses', bugdar::$datastore['status'], $user->objdata['hidestatuses'], 'statusid', 'status', 0, true)); $admin->row_text(T('Default Sort Order Column'), construct_option_select('defaultsortkey', ListSorter::fetch_by_text(false), $user->objdata['defaultsortkey'])); $admin->row_text(T('Default Sort Order Direction'), construct_option_select('defaultsortas', ListSorter::fetch_as_text(false), $user->objdata['defaultsortas'])); diff --git a/admin/usergroup.php b/admin/usergroup.php index 7cefd89..45dac27 100755 --- a/admin/usergroup.php +++ b/admin/usergroup.php @@ -334,7 +334,7 @@ if ($_POST['do'] == 'doapprove') $users = $db->query("SELECT * FROM " . TABLE_PREFIX . "user WHERE userid IN (" . implode(',', $idlist) . ")"); while ($user = $db->fetch_array($users)) { - $tpl = $template->fetch(FetchEmailPath('accountapproved.xml', $bugsys->datastore['language'][$bugsys->options['defaultlanguage']]['langcode'])); + $tpl = $template->fetch(FetchEmailPath('accountapproved.xml', bugdar::$datastore['language'][bugdar::$options['defaultlanguage']]['langcode'])); eval('$email = "' . $tpl . '";'); $email = $bugsys->xml->parse($email); $mail->setSubject($email['email']['subject']['value']); @@ -368,7 +368,7 @@ if ($_REQUEST['do'] == 'approve') { $admin->row_multi_item(array( '' . $user['email'] . '' => 'l', - $bugsys->datastore['usergroup']["$user[usergroupid]"]['title'] => 'c', + bugdar::$datastore['usergroup']["$user[usergroupid]"]['title'] => 'c', '' => 'c' )); } diff --git a/attachment.php b/attachment.php index 3406c8d..8392b48 100755 --- a/attachment.php +++ b/attachment.php @@ -109,7 +109,7 @@ if ($_POST['do'] == 'insert') $attachapi->set('mimetype', $FILE['type']); $attachapi->set('filesize', $FILE['size']); $attachapi->set('description', $bugsys->in['description']); - $attachapi->set('userid', $bugsys->userinfo['userid']); + $attachapi->set('userid', bugdar::$userinfo['userid']); // insert an attachment if (!$message->hasErrors()) @@ -141,7 +141,7 @@ if ($_POST['do'] == 'insert') { $comment = new CommentAPI($bugsys); $comment->set('bugid', $bugsys->in['bugid']); - $comment->set('userid', $bugsys->userinfo['userid']); + $comment->set('userid', bugdar::$userinfo['userid']); $comment->set('comment', $bugsys->in['comment']); $comment->set('dateline', $attachapi->values['dateline']); $comment->insert(); @@ -150,7 +150,7 @@ if ($_POST['do'] == 'insert') } // update the last post data - $db->query("UPDATE " . TABLE_PREFIX . "bug SET lastposttime = " . $attachapi->values['dateline'] . ", hiddenlastposttime = " . $attachapi->values['dateline'] . ", lastpostby = " . $bugsys->userinfo['userid'] . ", hiddenlastpostby = " . $bugsys->userinfo['userid'] . " WHERE bugid = $bug[bugid]"); + $db->query("UPDATE " . TABLE_PREFIX . "bug SET lastposttime = " . $attachapi->values['dateline'] . ", hiddenlastposttime = " . $attachapi->values['dateline'] . ", lastpostby = " . bugdar::$userinfo['userid'] . ", hiddenlastpostby = " . bugdar::$userinfo['userid'] . " WHERE bugid = $bug[bugid]"); $notif->finalize(); @@ -192,7 +192,7 @@ if ($_REQUEST['do'] == 'add') if ($_POST['do'] == 'update') { - if (!(can_perform('caneditattach', $bug['product']) OR ($attachment['userid'] == $bugsys->userinfo['userid'] AND can_perform('canputattach', $bug['product'])))) + if (!(can_perform('caneditattach', $bug['product']) OR ($attachment['userid'] == bugdar::$userinfo['userid'] AND can_perform('canputattach', $bug['product'])))) { $message->errorPermission(); } @@ -239,7 +239,7 @@ if ($_POST['do'] == 'update') if ($_REQUEST['do'] == 'edit') { - if (!(can_perform('caneditattach', $bug['product']) OR ($attachment['userid'] == $bugsys->userinfo['userid'] AND can_perform('canputattach', $bug['product'])))) + if (!(can_perform('caneditattach', $bug['product']) OR ($attachment['userid'] == bugdar::$userinfo['userid'] AND can_perform('canputattach', $bug['product'])))) { $message->errorPermission(); } diff --git a/docs/populate.php b/docs/populate.php index df0c02b..8aede92 100644 --- a/docs/populate.php +++ b/docs/populate.php @@ -9,18 +9,18 @@ for ($i = 11; $i < 111; $i++) $bug = new BugAPI($bugsys); $comment = new CommentAPI($bugsys); - $bug->set('userid', $bugsys->userinfo['userid']); - $bug->set('username', $bugsys->userinfo['displayname']); + $bug->set('userid', bugdar::$userinfo['userid']); + $bug->set('username', bugdar::$userinfo['displayname']); $bug->set('summary', 'AUTO POPULATE: ' . $i); $bug->set('severity', 1); - $comment->set('userid', $bugsys->userinfo['userid']); + $comment->set('userid', bugdar::$userinfo['userid']); $comment->set('comment', $funct->rand(100)); - $bug->set('priority', $bugsys->options['defaultpriority']); - $bug->set('status', $bugsys->options['defaultstatus']); - $bug->set('resolution', $bugsys->options['defaultresolve']); - $bug->set('assignedto', $bugsys->options['defaultassign']); + $bug->set('priority', bugdar::$options['defaultpriority']); + $bug->set('status', bugdar::$options['defaultstatus']); + $bug->set('resolution', bugdar::$options['defaultresolve']); + $bug->set('assignedto', bugdar::$options['defaultassign']); $bug->set('product', 6); $bug->set('component', 0); @@ -39,11 +39,11 @@ for ($i = 11; $i < 111; $i++) $bug->set('dateline', $comment->values['dateline']); $bug->set('initialreport', $comment->insertid); $bug->set('lastposttime', $comment->values['dateline']); - $bug->set('lastpostby', $bugsys->userinfo['userid']); - $bug->set('lastpostbyname', $bugsys->userinfo['displayname']); + $bug->set('lastpostby', bugdar::$userinfo['userid']); + $bug->set('lastpostbyname', bugdar::$userinfo['displayname']); $bug->set('hiddenlastposttime', $comment->values['dateline']); - $bug->set('hiddenlastpostby', $bugsys->userinfo['userid']); - $bug->set('hiddenlastpostbyname', $bugsys->userinfo['displayname']); + $bug->set('hiddenlastpostby', bugdar::$userinfo['userid']); + $bug->set('hiddenlastpostbyname', bugdar::$userinfo['displayname']); $bug->update(); } diff --git a/editcomment.php b/editcomment.php index 2dbf56e..dd7c0e3 100644 --- a/editcomment.php +++ b/editcomment.php @@ -123,7 +123,7 @@ if ($_REQUEST['do'] == 'delete') if ($_POST['do'] == 'update') { - if (!((can_perform('caneditownreply', $bug['product']) AND $bugsys->userinfo['userid'] == $comment['userid']) OR (can_perform('caneditotherreply', $bug['product']) AND $bugsys->userinfo['userid'] != $comment['userid']))) + if (!((can_perform('caneditownreply', $bug['product']) AND bugdar::$userinfo['userid'] == $comment['userid']) OR (can_perform('caneditotherreply', $bug['product']) AND bugdar::$userinfo['userid'] != $comment['userid']))) { $message->errorPermission(); } @@ -183,12 +183,12 @@ if ($_POST['do'] == 'update') if ($_REQUEST['do'] == 'edit') { - if (!((can_perform('caneditownreply', $bug['product']) AND $bugsys->userinfo['userid'] == $comment['userid']) OR (can_perform('caneditotherreply', $bug['product']) AND $bugsys->userinfo['userid'] != $comment['userid']))) + if (!((can_perform('caneditownreply', $bug['product']) AND bugdar::$userinfo['userid'] == $comment['userid']) OR (can_perform('caneditotherreply', $bug['product']) AND bugdar::$userinfo['userid'] != $comment['userid']))) { $message->errorPermission(); } - $comment['posttime'] = $datef->format($bugsys->options['dateformat'], $comment['dateline']); + $comment['posttime'] = $datef->format(bugdar::$options['dateformat'], $comment['dateline']); if ($comment['userid']) { $commenter = new UserAPI($bugsys); diff --git a/editreport.php b/editreport.php index fe27347..4da9a13 100644 --- a/editreport.php +++ b/editreport.php @@ -93,7 +93,7 @@ if ($_REQUEST['do'] == 'delete') if ($_POST['do'] == 'update') { - if (!((can_perform('caneditown', $bug['product']) AND $bugsys->userinfo['userid'] == $bug['userid']) OR (can_perform('caneditother', $bug['product']) AND $bugsys->userinfo['userid'] != $bug['userid'])) AND !can_perform('canpostcomments', $bug['product'])) + if (!((can_perform('caneditown', $bug['product']) AND bugdar::$userinfo['userid'] == $bug['userid']) OR (can_perform('caneditother', $bug['product']) AND bugdar::$userinfo['userid'] != $bug['userid'])) AND !can_perform('canpostcomments', $bug['product'])) { $message->errorPermission(); } @@ -146,7 +146,7 @@ if ($_POST['do'] == 'update') $comment = new CommentAPI($bugsys); $comment->set('bugid', $bugsys->in['bugid']); - $comment->set('userid', $bugsys->userinfo['userid']); + $comment->set('userid', bugdar::$userinfo['userid']); $comment->set('comment', $commenttext); $comment->set('parselinks', $bugsys->in['parselinks']); $comment->insert(); @@ -156,13 +156,13 @@ if ($_POST['do'] == 'update') $notif->send_new_comment_notice($comment->values); $bugapi->set('lastposttime', $comment->values['dateline']); - $bugapi->set('lastpostby', $bugsys->userinfo['userid']); - $bugapi->set('lastpostbyname', $bugsys->userinfo['displayname']); + $bugapi->set('lastpostby', bugdar::$userinfo['userid']); + $bugapi->set('lastpostbyname', bugdar::$userinfo['displayname']); $bugapi->set('hiddenlastposttime', $comment->values['dateline']); - $bugapi->set('hiddenlastpostby', $bugsys->userinfo['userid']); - $bugapi->set('hiddenlastpostbyname', $bugsys->userinfo['displayname']); + $bugapi->set('hiddenlastpostby', bugdar::$userinfo['userid']); + $bugapi->set('hiddenlastpostbyname', bugdar::$userinfo['displayname']); - if (!((can_perform('caneditown', $bug['product']) AND $bugsys->userinfo['userid'] == $bug['userid']) OR (can_perform('caneditother', $bug['product']) AND $bugsys->userinfo['userid'] != $bug['userid']))) + if (!((can_perform('caneditown', $bug['product']) AND bugdar::$userinfo['userid'] == $bug['userid']) OR (can_perform('caneditother', $bug['product']) AND bugdar::$userinfo['userid'] != $bug['userid']))) { $bugapi->update(); $notif->finalize(); @@ -175,7 +175,7 @@ if ($_POST['do'] == 'update') $dependencies = preg_split('#([^0-9].*?)#', $bugsys->in['dependency'], -1, PREG_SPLIT_NO_EMPTY); $dependencies = ((sizeof($dependencies) < 1) ? '' : implode(', ', $dependencies)); - if ((can_perform('caneditown', $bug['product']) AND $bugsys->userinfo['userid'] == $bug['userid']) OR (can_perform('caneditother', $bug['product']) AND $bugsys->userinfo['userid'] != $bug['userid'])) + if ((can_perform('caneditown', $bug['product']) AND bugdar::$userinfo['userid'] == $bug['userid']) OR (can_perform('caneditother', $bug['product']) AND bugdar::$userinfo['userid'] != $bug['userid'])) { $bugapi->set('summary', $bugsys->in['summary']); $bugapi->set('severity', $bugsys->in['severity']); diff --git a/explain.php b/explain.php index 1e13099..5c53d96 100644 --- a/explain.php +++ b/explain.php @@ -42,12 +42,12 @@ if (empty($_REQUEST['do'])) if ($_REQUEST['do'] == 'products') { - if (!is_array($bugsys->datastore['product'])) + if (!is_array(bugdar::$datastore['product'])) { $message->error(T('There are no products set up.')); } - foreach ($bugsys->datastore['product'] AS $product) + foreach (bugdar::$datastore['product'] AS $product) { if ($product['parentid']) { @@ -59,7 +59,7 @@ if ($_REQUEST['do'] == 'products') } } - foreach ($bugsys->datastore['version'] AS $version) + foreach (bugdar::$datastore['version'] AS $version) { $versions["$version[productid]"]["$version[versionid]"] = $version; } @@ -107,7 +107,7 @@ if ($_REQUEST['do'] == 'automations') LEFT JOIN " . TABLE_PREFIX . "bugfieldpermission AS permission ON (bugfield.fieldid = permission.fieldid) WHERE (permission.mask = 2 OR permission.mask = 1) - AND permission.usergroupid IN ({$bugsys->userinfo['usergroupid']}" . (sizeof($bugsys->userinfo['groupids']) != 0 ? ',' . implode(',', $bugsys->userinfo['groupids']) : '') . ") + AND permission.usergroupid IN ({bugdar::$userinfo['usergroupid']}" . (sizeof(bugdar::$userinfo['groupids']) != 0 ? ',' . implode(',', bugdar::$userinfo['groupids']) : '') . ") GROUP BY (bugfield.fieldid) "); while ($field = $bugsys->db->fetch_array($fields_fetch)) @@ -115,9 +115,9 @@ if ($_REQUEST['do'] == 'automations') $fields["$field[fieldid]"] = $field; } - if (is_array($bugsys->datastore['automation'])) + if (is_array(bugdar::$datastore['automation'])) { - foreach ($bugsys->datastore['automation'] AS $automation) + foreach (bugdar::$datastore['automation'] AS $automation) { $automation['fieldchanges'] = unserialize($automation['fieldchanges']); @@ -143,7 +143,7 @@ if ($_REQUEST['do'] == 'automations') foreach ($automation['fieldchanges']['builtin'] AS $name => $value) { $left = $name; - $right = $bugsys->datastore["$left"]["$value"]["$left"]; + $right = bugdar::$datastore["$left"]["$value"]["$left"]; eval('$automations .= "' . $template->fetch('explain_row') . '";'); } } diff --git a/favorite.php b/favorite.php index b9a5951..c10f6e7 100644 --- a/favorite.php +++ b/favorite.php @@ -53,14 +53,14 @@ if ($_REQUEST['do'] == 'handle') $message->errorPermission(); } - if ($db->query_first("SELECT * FROM " . TABLE_PREFIX . "favorite WHERE userid = " . $bugsys->userinfo['userid'] . " AND bugid = " . $bugsys->in['bugid'])) + if ($db->query_first("SELECT * FROM " . TABLE_PREFIX . "favorite WHERE userid = " . bugdar::$userinfo['userid'] . " AND bugid = " . $bugsys->in['bugid'])) { - $db->query("DELETE FROM " . TABLE_PREFIX . "favorite WHERE userid = " . $bugsys->userinfo['userid'] . " AND bugid = " . $bugsys->in['bugid']); + $db->query("DELETE FROM " . TABLE_PREFIX . "favorite WHERE userid = " . bugdar::$userinfo['userid'] . " AND bugid = " . $bugsys->in['bugid']); $message->redirect(T('This bug has been removed from your favorites list.'), "showreport.php?bugid=" . $bugsys->in['bugid']); } else { - $db->query("INSERT INTO " . TABLE_PREFIX . "favorite (userid, bugid) VALUES (" . $bugsys->userinfo['userid'] . ", " . $bugsys->in['bugid'] . ")"); + $db->query("INSERT INTO " . TABLE_PREFIX . "favorite (userid, bugid) VALUES (" . bugdar::$userinfo['userid'] . ", " . $bugsys->in['bugid'] . ")"); $message->redirect(T('This bug has been added to your favorites list.'), "showreport.php?bugid=" . $bugsys->in['bugid']); } } @@ -78,8 +78,8 @@ if ($_REQUEST['do'] == 'manage') SELECT favorite.bugid, bug.* FROM " . TABLE_PREFIX . "favorite AS favorite RIGHT JOIN " . TABLE_PREFIX . "bug AS bug ON (favorite.bugid = bug.bugid) - WHERE favorite.userid = " . $bugsys->userinfo['userid'] . " - AND (!bug.hidden OR (bug.hidden AND bug.product IN (" . fetch_on_bits('canviewhidden') . "))" . (can_perform('canviewownhidden') ? " OR (bug.hidden AND bug.userid = " . $bugsys->userinfo['userid'] . " AND bug.product IN (" . fetch_on_bits('canviewownhidden') . "))" : "") . ") + WHERE favorite.userid = " . bugdar::$userinfo['userid'] . " + AND (!bug.hidden OR (bug.hidden AND bug.product IN (" . fetch_on_bits('canviewhidden') . "))" . (can_perform('canviewownhidden') ? " OR (bug.hidden AND bug.userid = " . bugdar::$userinfo['userid'] . " AND bug.product IN (" . fetch_on_bits('canviewownhidden') . "))" : "") . ") "); if ($db->num_rows($favorites) < 1) diff --git a/global.php b/global.php index 20cfa8a..76fcbbf 100755 --- a/global.php +++ b/global.php @@ -35,7 +35,7 @@ BSTemplate::$templatePath = 'templates/%s.tpl'; // global template variables $datetime = $datef->format('l, F j, Y g:i A'); $year = $datef->format('Y'); -$version = $bugsys->options['trackerversion']; +$version = bugdar::$options['trackerversion']; $show = array( 'admin' => can_perform('canadminpanel'), diff --git a/help.php b/help.php index c22ba31..def80dc 100644 --- a/help.php +++ b/help.php @@ -27,14 +27,14 @@ define('SVN', '$Id$'); require_once('./global.php'); -if (!$bugsys->in['topic'] OR !isset($bugsys->datastore['help'][ $bugsys->in['topic'] ])) +if (!$bugsys->in['topic'] OR !isset(bugdar::$datastore['help'][ $bugsys->in['topic'] ])) { $topic['title'] = T('Invalid'); $topic['body'] = T('That help topic does not exist in the system.'); } else { - $topic = $bugsys->datastore['help'][ $bugsys->in['topic'] ]; + $topic = bugdar::$datastore['help'][ $bugsys->in['topic'] ]; $topic['body'] = nl2br($topic['body']); } diff --git a/includes/class_logging.php b/includes/class_logging.php index 28d7d88..8ba3822 100644 --- a/includes/class_logging.php +++ b/includes/class_logging.php @@ -205,7 +205,7 @@ class Logging (bugid, attachmentid, commentid, dateline, userid, field, original, changed) VALUES (" . $bugsys->clean($this->bugid, TYPE_UINT) . ", " . $bugsys->clean($this->attachmentid, TYPE_UINT) . ", - " . $bugsys->clean($this->commentid, TYPE_UINT) . ", " . TIMENOW . ", " . $bugsys->userinfo['userid'] . ", + " . $bugsys->clean($this->commentid, TYPE_UINT) . ", " . TIMENOW . ", " . bugdar::$userinfo['userid'] . ", '" . $bugsys->db->escape_string($field) . "', '" . $bugsys->db->escape_string($values['old']) . "', '" . $bugsys->db->escape_string($values['new']) . "' ) diff --git a/includes/class_message_reporter.php b/includes/class_message_reporter.php index 8473bb8..8ddedf9 100755 --- a/includes/class_message_reporter.php +++ b/includes/class_message_reporter.php @@ -115,7 +115,7 @@ class MessageReporter global $bugsys; global $doctype, $header, $headinclude, $footer, $focus, $show, $stylevar; - if ($bugsys->options['redirectheaders']) + if (bugdar::$options['redirectheaders']) { header("Location: $url"); exit; diff --git a/includes/class_sort.php b/includes/class_sort.php index 25d7f9e..4b02369 100644 --- a/includes/class_sort.php +++ b/includes/class_sort.php @@ -530,7 +530,7 @@ class ListSorter LEFT JOIN " . TABLE_PREFIX . "bugfieldpermission AS permission ON (bugfield.fieldid = permission.fieldid) WHERE (permission.mask = 2 OR permission.mask = 1) - AND permission.usergroupid IN ({$bugsys->userinfo['usergroupid']}" . (sizeof($bugsys->userinfo['groupids']) != 0 ? ',' . implode(',', $bugsys->userinfo['groupids']) : '') . ") + AND permission.usergroupid IN (" . bugdar::$userinfo['usergroupid'] . (sizeof(bugdar::$userinfo['groupids']) != 0 ? ',' . implode(',', bugdar::$userinfo['groupids']) : '') . ") GROUP BY (bugfield.fieldid) "); } diff --git a/includes/functions.php b/includes/functions.php index 3da78ed..73a812d 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -111,10 +111,10 @@ function can_perform($bitmask, $productid = 0, $userinfo = null) if ($userinfo == null) { - $userinfo =& $bugsys->userinfo; + $userinfo =& bugdar::$userinfo; } - $permissions =& $bugsys->datastore['permission']; + $permissions =& bugdar::$datastore['permission']; if (!isset($bugsys->permissions["$bitmask"])) { @@ -188,7 +188,7 @@ function construct_datastore_select($datastore, $labelname, $valuename, $selecte } } - foreach ($bugsys->datastore["$datastore"] AS $item) + foreach (bugdar::$datastore["$datastore"] AS $item) { $label = $item["$labelname"]; $value = $item["$valuename"]; @@ -225,7 +225,7 @@ function construct_custom_fields($bug = array(), $ignore21mask = false, $nodefau LEFT JOIN " . TABLE_PREFIX . "bugfieldpermission AS permission ON (bugfield.fieldid = permission.fieldid) WHERE (permission.mask = 2 OR permission.mask = 1) - AND permission.usergroupid IN ({$bugsys->userinfo['usergroupid']}" . (sizeof($bugsys->userinfo['groupids']) != 0 ? ',' . implode(',', $bugsys->userinfo['groupids']) : '') . ") + AND permission.usergroupid IN (" . bugdar::$userinfo['usergroupid'] . (sizeof(bugdar::$userinfo['groupids']) != 0 ? ',' . implode(',', bugdar::$userinfo['groupids']) : '') . ") GROUP BY (bugfield.fieldid) "); while ($field = $bugsys->db->fetch_array($fields_fetch)) @@ -376,7 +376,7 @@ function process_custom_fields(&$bugapi, &$msg, $errorbox = false, $searchMode = LEFT JOIN " . TABLE_PREFIX . "bugfieldpermission AS permission ON (bugfield.fieldid = permission.fieldid) WHERE permission.mask = 2 - AND permission.usergroupid IN ({$bugsys->userinfo['usergroupid']}" . (sizeof($bugsys->userinfo['groupids']) != 0 ? ',' . implode(',', $bugsys->userinfo['groupids']) : '') . ") + AND permission.usergroupid IN (" . bugdar::$userinfo['usergroupid'] . (sizeof(bugdar::$userinfo['groupids']) != 0 ? ',' . implode(',', bugdar::$userinfo['groupids']) : '') . ") GROUP BY (bugfield.fieldid) "); while ($field = $bugsys->db->fetch_array($fields)) @@ -468,7 +468,7 @@ function fetch_on_bits($mask, $userinfo = null) if ($userinfo == null) { - $userinfo =& $bugsys->userinfo; + $userinfo =& bugdar::$userinfo; } $onbits = array(); @@ -479,14 +479,14 @@ function fetch_on_bits($mask, $userinfo = null) $groups[] = $usergroupid; // product-inspecific work - if (is_array($bugsys->datastore['product'])) + if (is_array(bugdar::$datastore['product'])) { foreach ($groups AS $groupid) { // we only need to do this so long as there's no onbits array because this isn't product specific - if (sizeof($onbits) == 0 AND $bugsys->datastore['usergroup']["$groupid"]['permissions'] & $bugsys->permissions["$mask"]) + if (sizeof($onbits) == 0 AND bugdar::$datastore['usergroup']["$groupid"]['permissions'] & $bugsys->permissions["$mask"]) { - foreach ($bugsys->datastore['product'] AS $id => $product) + foreach (bugdar::$datastore['product'] AS $id => $product) { $onbits["$id"] = $id; } @@ -500,9 +500,9 @@ function fetch_on_bits($mask, $userinfo = null) // product specific work foreach ($groups AS $groupid) { - if (is_array($bugsys->datastore['permission']["$groupid"])) + if (is_array(bugdar::$datastore['permission']["$groupid"])) { - foreach ($bugsys->datastore['permission']["$groupid"] AS $productid => $bit) + foreach (bugdar::$datastore['permission']["$groupid"] AS $productid => $bit) { if ($bit & $bugsys->permissions["$mask"]) { @@ -546,7 +546,7 @@ function fetch_help_link($topic) { global $bugsys; - if (isset($bugsys->datastore['help']["$topic"])) + if (isset(bugdar::$datastore['help']["$topic"])) { eval('$temp = "' . $bugsys->template->fetch('help_link') . '";'); return $temp; @@ -586,9 +586,9 @@ function fetch_guest_user() 'email' => '', 'displayname' => '', 'showcolors' => 1, - 'permissions' => $bugsys->datastore['usergroup'][1]['permissions'], - 'displaytitle' => $bugsys->datastore['usergroup'][1]['displaytitle'], - 'timezone' => $bugsys->options['defaulttimezone'] + 'permissions' => bugdar::$datastore['usergroup'][1]['permissions'], + 'displaytitle' => bugdar::$datastore['usergroup'][1]['displaytitle'], + 'timezone' => bugdar::$options['defaulttimezone'] ); } @@ -610,7 +610,7 @@ function check_bug_permissions($bug, $userinfo = null) global $bugsys; if ($userinfo == null) { - $userinfo = $bugsys->userinfo; + $userinfo = bugdar::$userinfo; } $bugsys->debug("checking permissions for $userinfo[userid] on bug $bug[bugid]"); @@ -669,22 +669,22 @@ function ProcessBugDataForDisplay($bug, $color = '') { global $bugsys; - $bug['hiddendisplay'] = ($bug['hidden'] AND (can_perform('canviewhidden', $bug['product']) OR (can_perform('canviewownhidden') AND $bug['userid'] == $bugsys->userinfo['userid']))); + $bug['hiddendisplay'] = ($bug['hidden'] AND (can_perform('canviewhidden', $bug['product']) OR (can_perform('canviewownhidden') AND $bug['userid'] == bugdar::$userinfo['userid']))); - $bug['bgcolor'] = ($bugsys->userinfo['showcolors'] ? $bugsys->datastore['status']["$bug[status]"]['color'] : $color); - $bug['product'] = $bugsys->datastore['product']["$bug[product]"]['title']; - $bug['version'] = $bugsys->datastore['version']["$bug[version]"]['version']; - $bug['component'] = $bugsys->datastore['component']["$bug[component]"]['title']; - $bug['status'] = $bugsys->datastore['status']["$bug[status]"]['status']; - $bug['resolution'] = $bugsys->datastore['resolution']["$bug[resolution]"]['resolution']; - $bug['priority'] = $bugsys->datastore['priority']["$bug[priority]"]['priority']; - $bug['severity'] = $bugsys->datastore['severity']["$bug[severity]"]['severity']; - $bug['assignedto'] = ((empty($bug['assignedto']) OR !isset($bugsys->datastore['assignto']["$bug[assignedto]"])) ? '' : construct_user_display($bugsys->datastore['assignto']["$bug[assignedto]"])); + $bug['bgcolor'] = (bugdar::$userinfo['showcolors'] ? bugdar::$datastore['status']["$bug[status]"]['color'] : $color); + $bug['product'] = bugdar::$datastore['product']["$bug[product]"]['title']; + $bug['version'] = bugdar::$datastore['version']["$bug[version]"]['version']; + $bug['component'] = bugdar::$datastore['component']["$bug[component]"]['title']; + $bug['status'] = bugdar::$datastore['status']["$bug[status]"]['status']; + $bug['resolution'] = bugdar::$datastore['resolution']["$bug[resolution]"]['resolution']; + $bug['priority'] = bugdar::$datastore['priority']["$bug[priority]"]['priority']; + $bug['severity'] = bugdar::$datastore['severity']["$bug[severity]"]['severity']; + $bug['assignedto'] = ((empty($bug['assignedto']) OR !isset(bugdar::$datastore['assignto']["$bug[assignedto]"])) ? '' : construct_user_display(bugdar::$datastore['assignto']["$bug[assignedto]"])); $bug['lastposttime'] = ($bug['hiddendisplay'] ? $bug['hiddenlastposttime'] : $bug['lastposttime']); $bug['lastpost'] = ($bug['hiddendisplay'] ? $bug['hiddenlastpostbyname'] : $bug['lastpostbyname']); - $bug['lastposttime'] = $bugsys->datef->format($bugsys->options['dateformat'], $bug['lastposttime']); + $bug['lastposttime'] = $bugsys->datef->format(bugdar::$options['dateformat'], $bug['lastposttime']); return $bug; } @@ -701,9 +701,9 @@ function LoadPaginationFramework() global $bugsys; $bugsys->load('pagination', 'pagination', true); - $bugsys->pagination->setDefaultPerPage($bugsys->options['defaultpp']); - $bugsys->pagination->setMaxPerPage($bugsys->options['maxpp']); - $bugsys->pagination->setPageLinks($bugsys->options['pagelinks']); + $bugsys->pagination->setDefaultPerPage(bugdar::$options['defaultpp']); + $bugsys->pagination->setMaxPerPage(bugdar::$options['maxpp']); + $bugsys->pagination->setPageLinks(bugdar::$options['pagelinks']); $bugsys->pagination->setPageVar('p'); $bugsys->pagination->setPerPageVar('pp'); $bugsys->pagination->setBitProcessor('PageNavigatorBitCallback'); @@ -765,16 +765,16 @@ function FetchUserPermissions(&$user) { global $bugsys; - $perms = (int)$bugsys->datastore['usergroup']["$user[usergroupid]"]['permissions']; + $perms = (int)bugdar::$datastore['usergroup']["$user[usergroupid]"]['permissions']; if (!is_array($user['groupids'])) { - $user['groupids'] = explode(',', $bugsys->userinfo['groupids']); + $user['groupids'] = explode(',', bugdar::$userinfo['groupids']); } $user['groupids'] = BSFunctions::array_strip_empty($user['groupids']); foreach ($user['groupids'] AS $group) { - $perms |= (int)$bugsys->datastore['usergroup']["$group"]['permissions']; + $perms |= (int)bugdar::$datastore['usergroup']["$group"]['permissions']; } return $perms; diff --git a/includes/functions_datastore.php b/includes/functions_datastore.php index c51a176..13ba2ca 100755 --- a/includes/functions_datastore.php +++ b/includes/functions_datastore.php @@ -36,7 +36,7 @@ function build_languages() VALUES ('language', '" . $bugsys->escape(serialize($tempstore)) . "')" ); - $bugsys->datastore['language'] = $tempstore; + bugdar::$datastore['language'] = $tempstore; } // ####################### Start build_settings ###################### @@ -56,7 +56,7 @@ function build_settings() VALUES ('setting', '" . $bugsys->escape(serialize($options)) . "')" ); - $bugsys->datastore['setting'] = $options; + bugdar::$datastore['setting'] = $options; } // ###################### Start build_usergroups ##################### @@ -76,7 +76,7 @@ function build_usergroups() VALUES ('usergroup', '" . $bugsys->escape(serialize($groups)) . "')" ); - $bugsys->datastore['usergroup'] = $groups; + bugdar::$datastore['usergroup'] = $groups; } // ####################### Start build_statuses ###################### @@ -96,7 +96,7 @@ function build_statuses() VALUES ('status', '" . $bugsys->escape(serialize($tempstore)) . "')" ); - $bugsys->datastore['status'] = $tempstore; + bugdar::$datastore['status'] = $tempstore; } // ###################### Start build_severities ##################### @@ -116,7 +116,7 @@ function build_severities() VALUES ('severity', '" . $bugsys->escape(serialize($tempstore)) . "')" ); - $bugsys->datastore['severity'] = $tempstore; + bugdar::$datastore['severity'] = $tempstore; } // ###################### Start build_priorities ##################### @@ -136,7 +136,7 @@ function build_priorities() VALUES ('priority', '" . $bugsys->escape(serialize($tempstore)) . "')" ); - $bugsys->datastore['priority'] = $tempstore; + bugdar::$datastore['priority'] = $tempstore; } // ###################### Start build_assignedto ##################### @@ -146,7 +146,7 @@ function build_assignedto() // determine the groups that are assignable $ids = $exprs = array(); - foreach ($bugsys->datastore['usergroup'] AS $id => $group) + foreach (bugdar::$datastore['usergroup'] AS $id => $group) { if ($group['permissions'] & $bugsys->permissions['canbeassignedto']) { @@ -173,7 +173,7 @@ function build_assignedto() VALUES ('assignto', '" . $bugsys->escape(serialize($devs)) . "')" ); - $bugsys->datastore['assignto'] = $devs; + bugdar::$datastore['assignto'] = $devs; } // ##################### Start build_resolutions ##################### @@ -193,7 +193,7 @@ function build_resolutions() VALUES ('resolution', '" . $bugsys->escape(serialize($tempstore)) . "')" ); - $bugsys->datastore['resolution'] = $tempstore; + bugdar::$datastore['resolution'] = $tempstore; } // ####################### Start build_versions ###################### @@ -213,7 +213,7 @@ function build_versions() VALUES ('version', '" . $bugsys->escape(serialize($tempstore)) . "')" ); - $bugsys->datastore['version'] = $tempstore; + bugdar::$datastore['version'] = $tempstore; } // ####################### Start build_products ###################### @@ -242,8 +242,8 @@ function build_products() ('component', '" . $bugsys->escape(serialize($tempstore['component'])) . "')" ); - $bugsys->datastore['product'] = $tempstore['product']; - $bugsys->datastore['component'] = $tempstore['component']; + bugdar::$datastore['product'] = $tempstore['product']; + bugdar::$datastore['component'] = $tempstore['component']; } // ##################### Start build_permissions ##################### @@ -263,7 +263,7 @@ function build_permissions() VALUES ('permission', '" . $bugsys->escape(serialize($tempstore)) . "')" ); - $bugsys->datastore['permission'] = $tempstore; + bugdar::$datastore['permission'] = $tempstore; } // ##################### Start build_automations #################### @@ -283,7 +283,7 @@ function build_automations() VALUES ('automation', '" . $bugsys->escape(serialize($actions)) . "')" ); - $bugsys->datastore['automation'] = $actions; + bugdar::$datastore['automation'] = $actions; } // ###################### Start build_user_help ###################### @@ -311,7 +311,7 @@ function build_user_help() VALUES ('help', '" . $bugsys->escape(serialize($help)) . "')" ); - $bugsys->datastore['help'] = $help; + bugdar::$datastore['help'] = $help; } /*=====================================================================*\ diff --git a/includes/functions_product.php b/includes/functions_product.php index a6a3196..21b54f9 100644 --- a/includes/functions_product.php +++ b/includes/functions_product.php @@ -40,16 +40,16 @@ function ConstructProductSelect($action = 'canviewbugs', $select = null, $obsole // index all of the components by parent and ID $components = array(); - if (is_array($bugsys->datastore['component'])) + if (is_array(bugdar::$datastore['component'])) { - foreach ($bugsys->datastore['component'] AS $id => $prod) + foreach (bugdar::$datastore['component'] AS $id => $prod) { $components["$prod[parentid]"]["$id"] = $prod; } } // these are products - foreach ($bugsys->datastore['product'] AS $productid => $product) + foreach (bugdar::$datastore['product'] AS $productid => $product) { if (!can_perform($action, $product['productid']) OR !can_perform('canviewbugs', $product['productid'])) { @@ -90,7 +90,7 @@ function ConstructVersionSelect($productid, $select, $obsolete) { global $bugsys; - $product = $bugsys->datastore['product']["$productid"]; + $product = bugdar::$datastore['product']["$productid"]; $component = null; $build = ''; @@ -98,11 +98,11 @@ function ConstructVersionSelect($productid, $select, $obsolete) // this is a component if ($product == null) { - $component = $bugsys->datastore['component']["$productid"]; - $product = $bugsys->datastore['product']["$component[parentid]"]; + $component = bugdar::$datastore['component']["$productid"]; + $product = bugdar::$datastore['product']["$component[parentid]"]; } - foreach ($bugsys->datastore['version'] AS $versionid => $version) + foreach (bugdar::$datastore['version'] AS $versionid => $version) { if ((!$version['productid'] OR $version['productid'] == $component['productid'] OR $version['productid'] == $product['productid']) AND (!$version['obsolete'] OR ($version['obsolete'] AND $obsolete))) { diff --git a/includes/init.php b/includes/init.php index 6ad0f8a..2640ab6 100755 --- a/includes/init.php +++ b/includes/init.php @@ -71,9 +71,13 @@ require_once('./includes/language.php'); // ################################################################### // init the big three -$bugsys->options = array(); -$bugsys->userinfo = array(); -$bugsys->datastore = array(); + +class bugdar +{ + public static $options = array(); + public static $userinfo = array(); + public static $datastore = array(); +} // ################################################################### // send nocache @@ -101,11 +105,11 @@ if (!$datastoretemp) foreach ($datastoretemp as $store) { - $bugsys->datastore["$store[title]"] = unserialize($store['data']); + bugdar::$datastore["$store[title]"] = unserialize($store['data']); } -$bugsys->options = $bugsys->datastore['setting']; -$bugsys->options['columnoptions'] = unserialize($bugsys->options['columnoptions']); -unset($bugsys->datastore['setting']); +bugdar::$options = bugdar::$datastore['setting']; +bugdar::$options['columnoptions'] = unserialize(bugdar::$options['columnoptions']); +unset(bugdar::$datastore['setting']); // ################################################################### // load permissions @@ -115,7 +119,7 @@ require_once('./includes/permissions.php'); // ################################################################### // load userinfo -$authMethod = ((defined('USE_DEFAULT_AUTH_METHOD') AND constant('USE_DEFAULT_AUTH_METHOD') == 1) ? 'default' : $bugsys->options['authmethod']); +$authMethod = ((defined('USE_DEFAULT_AUTH_METHOD') AND constant('USE_DEFAULT_AUTH_METHOD') == 1) ? 'default' : bugdar::$options['authmethod']); require_once('./includes/auth/auth_' . $authMethod . '.php'); $authClass = 'Authentication' . str_replace(' ', '', ucwords(str_replace('_', ' ', $authMethod))); @@ -123,14 +127,14 @@ $bugsys->auth = $auth = new $authClass(); if ($auth->authenticateCookies()) { - $bugsys->userinfo = $auth->fetchBugdarUser(); - $bugsys->userinfo['permissions'] = FetchUserPermissions($bugsys->userinfo); - $bugsys->userinfo['displaytitle'] = $bugsys->datastore['usergroup'][ $bugsys->userinfo['usergroupid'] ]['displaytitle']; - $bugsys->userinfo['columnoptions'] = unserialize($bugsys->userinfo['columnoptions']); + bugdar::$userinfo = $auth->fetchBugdarUser(); + bugdar::$userinfo['permissions'] = FetchUserPermissions(bugdar::$userinfo); + bugdar::$userinfo['displaytitle'] = bugdar::$datastore['usergroup'][ bugdar::$userinfo['usergroupid'] ]['displaytitle']; + bugdar::$userinfo['columnoptions'] = unserialize(bugdar::$userinfo['columnoptions']); } else { - $bugsys->userinfo = fetch_guest_user(); + bugdar::$userinfo = fetch_guest_user(); } // ################################################################### @@ -145,7 +149,7 @@ $stylevar['left'] = ($language['direction'] == 'ltr' ? 'left' : 'right'); $stylevar['right'] = ($language['direction'] == 'ltr' ? 'right' : 'left'); // start gettext engine -if (!$bugsys->options['devgettext']) +if (!bugdar::$options['devgettext']) { putenv("LANG=$language[langcode]"); putenv("LANGUAGE=$language[langcode]"); @@ -166,8 +170,8 @@ else // initialize the date system require_once ISSO . '/Date.php'; $datef = BSApp::$date = new BSDate(); -$datef->setUserTimeZone($bugsys->userinfo['timezone'] + ($bugsys->userinfo['usedst'] * 1)); -BSApp::debug('user tz = ' . $bugsys->userinfo['timezone'] . '; use version = ' . $datef->usertz); +$datef->setUserTimeZone(bugdar::$userinfo['timezone'] + (bugdar::$userinfo['usedst'] * 1)); +BSApp::debug('user tz = ' . bugdar::$userinfo['timezone'] . '; use version = ' . $datef->usertz); /*=====================================================================*\ || ################################################################### diff --git a/includes/language.php b/includes/language.php index e808ca9..c99350f 100644 --- a/includes/language.php +++ b/includes/language.php @@ -44,20 +44,20 @@ function fetch_user_language() { global $bugsys; - if ($bugsys->userinfo['userid']) + if (bugdar::$userinfo['userid']) { - $languageid = $bugsys->userinfo['languageid']; - $language = $bugsys->datastore['language']["$languageid"]; + $languageid = bugdar::$userinfo['languageid']; + $language = bugdar::$datastore['language']["$languageid"]; } - if (!$languageid AND is_array($bugsys->datastore['language'])) + if (!$languageid AND is_array(bugdar::$datastore['language'])) { - foreach ($bugsys->datastore['language'] AS $language) + foreach (bugdar::$datastore['language'] AS $language) { - if ($bugsys->options['defaultlanguage'] == $language['languageid']) + if (bugdar::$options['defaultlanguage'] == $language['languageid']) { $languageid = $language['languageid']; - $language = $bugsys->datastore['language']["$languageid"]; + $language = bugdar::$datastore['language']["$languageid"]; break; } } @@ -86,7 +86,7 @@ function T($str) global $bugsys; static $mo; - if (!$bugsys->options['devgettext']) + if (!bugdar::$options['devgettext']) { return _($str); } diff --git a/index.php b/index.php index 9181c6c..a70099c 100644 --- a/index.php +++ b/index.php @@ -47,9 +47,9 @@ LoadPaginationFramework(); $count = $db->query_first(" SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "bug - WHERE (!hidden OR (hidden AND product IN (" . fetch_on_bits('canviewhidden') . "))" . (can_perform('canviewownhidden') ? " OR (hidden AND userid = " . $bugsys->userinfo['userid'] . " AND product IN (" . fetch_on_bits('canviewownhidden') . "))" : "") . ") - AND product IN (" . fetch_on_bits('canviewbugs') . ")" . (($bugsys->options['hidestatuses'] OR isset($bugsys->userinfo['hidestatuses'])) ? " - AND status NOT IN (" . ($bugsys->userinfo['hidestatuses'] != '' ? $bugsys->userinfo['hidestatuses'] : $bugsys->options['hidestatuses']) . ")" : "") + WHERE (!hidden OR (hidden AND product IN (" . fetch_on_bits('canviewhidden') . "))" . (can_perform('canviewownhidden') ? " OR (hidden AND userid = " . bugdar::$userinfo['userid'] . " AND product IN (" . fetch_on_bits('canviewownhidden') . "))" : "") . ") + AND product IN (" . fetch_on_bits('canviewbugs') . ")" . ((bugdar::$options['hidestatuses'] OR isset(bugdar::$userinfo['hidestatuses'])) ? " + AND status NOT IN (" . (bugdar::$userinfo['hidestatuses'] != '' ? bugdar::$userinfo['hidestatuses'] : bugdar::$options['hidestatuses']) . ")" : "") ); if (!$count['count']) diff --git a/install/global.php b/install/global.php index c0f2950..554bf2a 100644 --- a/install/global.php +++ b/install/global.php @@ -73,9 +73,9 @@ require_once('./includes/permissions.php'); // ################################################################### // init the big three -$bugsys->options = array(); -$bugsys->userinfo = array(); -$bugsys->datastore = array(); +bugdar::$options = array(); +bugdar::$userinfo = array(); +bugdar::$datastore = array(); // ################################################################### diff --git a/locale/en_US/emails/accountapproved.xml.tpl b/locale/en_US/emails/accountapproved.xml.tpl index d60908c..fd81c9b 100644 --- a/locale/en_US/emails/accountapproved.xml.tpl +++ b/locale/en_US/emails/accountapproved.xml.tpl @@ -1,8 +1,8 @@ - Account Approved at {$bugsys->options['trackertitle']} + Account Approved at {bugdar::$options['trackertitle']} Hi $user[displayname], -Your account was awaiting moderation at {$bugsys->options['trackertitle']}. Today, an administrator approved your registration and you are now able to use the bug tracker fully. +Your account was awaiting moderation at {bugdar::$options['trackertitle']}. Today, an administrator approved your registration and you are now able to use the bug tracker fully. If you have any questions, please don't hesitate to contact the webmaster. \ No newline at end of file diff --git a/locale/en_US/emails/activateaccount.xml.tpl b/locale/en_US/emails/activateaccount.xml.tpl index e1f2673..1ff638d 100644 --- a/locale/en_US/emails/activateaccount.xml.tpl +++ b/locale/en_US/emails/activateaccount.xml.tpl @@ -1,8 +1,8 @@ - Welcome to {$bugsys->options['trackertitle']} + Welcome to {bugdar::$options['trackertitle']} Hi {$bugsys->in['displayname']}, -Welcome to the {$bugsys->options['trackertitle']} tracker. Before you can begin posting bug reports, you'll need to activate your account. To do this, please click this link: +Welcome to the {bugdar::$options['trackertitle']} tracker. Before you can begin posting bug reports, you'll need to activate your account. To do this, please click this link: -{$bugsys->options['trackerurl']}/register.php?do=activate&userid=$userid&activator=$activationid +{bugdar::$options['trackerurl']}/register.php?do=activate&userid=$userid&activator=$activationid \ No newline at end of file diff --git a/locale/en_US/emails/passwordreset.xml.tpl b/locale/en_US/emails/passwordreset.xml.tpl index eab2f01..988f40a 100644 --- a/locale/en_US/emails/passwordreset.xml.tpl +++ b/locale/en_US/emails/passwordreset.xml.tpl @@ -1,10 +1,10 @@ - {$bugsys->options['trackertitle']} Password Reset + {bugdar::$options['trackertitle']} Password Reset Hi {$user->objdata['displayname']}, -You requested this lost password email at the {$bugsys->options['trackertitle']} bug tracker. To reset your password, simply click the link below (or paste it into your browser window exactly) and enter a new password. +You requested this lost password email at the {bugdar::$options['trackertitle']} bug tracker. To reset your password, simply click the link below (or paste it into your browser window exactly) and enter a new password. -{$bugsys->options['trackerurl']}/login.php?do=recoverpw&activator=$activator +{bugdar::$options['trackerurl']}/login.php?do=recoverpw&activator=$activator If you did not request this, do not worry as this notice will expire in 24 hours. \ No newline at end of file diff --git a/locale/en_US/emails/welcome.xml.tpl b/locale/en_US/emails/welcome.xml.tpl index 494779a..71930bd 100644 --- a/locale/en_US/emails/welcome.xml.tpl +++ b/locale/en_US/emails/welcome.xml.tpl @@ -1,8 +1,8 @@ - Welcome to {$bugsys->options['trackertitle']} + Welcome to {bugdar::$options['trackertitle']} Hi {$displayName}, -Thank you for taking the time to register at {$bugsys->options['trackertitle']}. We look forward to your contributations to making our products better. +Thank you for taking the time to register at {bugdar::$options['trackertitle']}. We look forward to your contributations to making our products better. If you have any questions, please don't hesitate to contact the webmaster. \ No newline at end of file diff --git a/login.php b/login.php index e1e54b5..c63ab96 100755 --- a/login.php +++ b/login.php @@ -37,7 +37,7 @@ APIError(array(new API_Error_Handler($message), 'user_cumulative')); // ################################################################### -if ($bugsys->userinfo['userid'] AND $_REQUEST['do'] != 'logout' AND $_POST['do'] != 'cplogin' AND $_REQUEST['do'] != 'cplogout') +if (bugdar::$userinfo['userid'] AND $_REQUEST['do'] != 'logout' AND $_POST['do'] != 'cplogin' AND $_REQUEST['do'] != 'cplogout') { $message->error(T('You are already logged in.')); } @@ -89,7 +89,7 @@ if ($_POST['do'] == 'login' OR $_POST['do'] == 'cplogin') if ($_REQUEST['do'] == 'logout') { - if ($bugsys->userinfo['userid']) + if (bugdar::$userinfo['userid']) { $db->query("DELETE FROM " . TABLE_PREFIX . "adminsession WHERE sessionid = '" . $bugsys->input_escape(COOKIE_PREFIX . 'adminsession') . "'"); $auth->clearCookies(); @@ -121,7 +121,7 @@ if ($_POST['do'] == 'sendpw') $activator = $funct->rand(25); $db->query("INSERT INTO " . TABLE_PREFIX . "passwordreset (activatorid, dateline, userid) VALUES ('" . $activator . "', " . TIMENOW . ", " . $user->objdata['userid'] . ")"); - eval('$email = "' . $template->fetch(FetchEmailPath('passwordreset.xml', $bugsys->datastore['language'][$user->objdata['languageid']]['langcode'])) . '";'); + eval('$email = "' . $template->fetch(FetchEmailPath('passwordreset.xml', bugdar::$datastore['language'][$user->objdata['languageid']]['langcode'])) . '";'); $email = $bugsys->xml->parse($email); $mail->setSubject($email['email']['subject']['value']); diff --git a/newreport.php b/newreport.php index 5255a56..541c1a7 100755 --- a/newreport.php +++ b/newreport.php @@ -58,12 +58,12 @@ if ($_POST['do'] == 'insert') $notif = new NotificationCenter(); - $bug->set('userid', $bugsys->userinfo['userid']); - $bug->set('username', $bugsys->userinfo['displayname']); + $bug->set('userid', bugdar::$userinfo['userid']); + $bug->set('username', bugdar::$userinfo['displayname']); $bug->set('summary', $bugsys->in['summary']); $bug->set('severity', $bugsys->in['severity']); - $comment->set('userid', $bugsys->userinfo['userid']); + $comment->set('userid', bugdar::$userinfo['userid']); $comment->set('comment', $bugsys->in['comment']); $comment->set('parselinks', $bugsys->in['parselinks']); @@ -71,9 +71,9 @@ if ($_POST['do'] == 'insert') // check permissions on various input values if (!can_perform('canchangestatus', $bugsys->in['product'])) { - $bug->set('priority', $bugsys->options['defaultpriority']); - $bug->set('status', $bugsys->options['defaultstatus']); - $bug->set('resolution', $bugsys->options['defaultresolve']); + $bug->set('priority', bugdar::$options['defaultpriority']); + $bug->set('status', bugdar::$options['defaultstatus']); + $bug->set('resolution', bugdar::$options['defaultresolve']); } else { @@ -83,7 +83,7 @@ if ($_POST['do'] == 'insert') } if (!can_perform('canassign', $bugsys->in['product'])) { - $bug->set('assignedto', $bugsys->options['defaultassign']); + $bug->set('assignedto', bugdar::$options['defaultassign']); } else { @@ -115,11 +115,11 @@ if ($_POST['do'] == 'insert') $bug->set('dateline', $comment->values['dateline']); $bug->set('initialreport', $comment->insertid); $bug->set('lastposttime', $comment->values['dateline']); - $bug->set('lastpostby', $bugsys->userinfo['userid']); - $bug->set('lastpostbyname', $bugsys->userinfo['displayname']); + $bug->set('lastpostby', bugdar::$userinfo['userid']); + $bug->set('lastpostbyname', bugdar::$userinfo['displayname']); $bug->set('hiddenlastposttime', $comment->values['dateline']); - $bug->set('hiddenlastpostby', $bugsys->userinfo['userid']); - $bug->set('hiddenlastpostbyname', $bugsys->userinfo['displayname']); + $bug->set('hiddenlastpostby', bugdar::$userinfo['userid']); + $bug->set('hiddenlastpostbyname', bugdar::$userinfo['displayname']); $bug->update(); $notif->set_bug_data($bug->objdata); @@ -139,35 +139,35 @@ if ($_POST['do'] == 'insert') if ($_REQUEST['do'] == 'add') { - if (!is_array($bugsys->datastore['product'])) + if (!is_array(bugdar::$datastore['product'])) { $message->error(T('No products have been setup, therefore no bugs can be added.')); } - if (!is_array($bugsys->datastore['version'])) + if (!is_array(bugdar::$datastore['version'])) { $message->error(T('No versions have been setup underneath your product(s), therefore no bugs can be added.')); } - $select['severity'] = construct_datastore_select('severity', 'severity', 'severityid', ($bugsys->in['severity'] ? $bugsys->in['severity'] : $bugsys->options['defaultseverity'])); + $select['severity'] = construct_datastore_select('severity', 'severity', 'severityid', ($bugsys->in['severity'] ? $bugsys->in['severity'] : bugdar::$options['defaultseverity'])); $show['changestatus'] = can_perform('canchangestatus'); if (can_perform('canchangestatus')) { - $select['priority'] = construct_datastore_select('priority', 'priority', 'priorityid', ($bugsys->in['priority'] ? $bugsys->in['priority'] : $bugsys->options['defaultpriority'])); - $select['status'] = construct_datastore_select('status', 'status', 'statusid', ($bugsys->in['status'] ? $bugsys->in['status'] : $bugsys->options['defaultstatus'])); - $select['resolution'] = construct_datastore_select('resolution', 'resolution', 'resolutionid', ($bugsys->in['resolution'] ? $bugsys->in['resolution'] : $bugsys->options['defaultresolve'])); + $select['priority'] = construct_datastore_select('priority', 'priority', 'priorityid', ($bugsys->in['priority'] ? $bugsys->in['priority'] : bugdar::$options['defaultpriority'])); + $select['status'] = construct_datastore_select('status', 'status', 'statusid', ($bugsys->in['status'] ? $bugsys->in['status'] : bugdar::$options['defaultstatus'])); + $select['resolution'] = construct_datastore_select('resolution', 'resolution', 'resolutionid', ($bugsys->in['resolution'] ? $bugsys->in['resolution'] : bugdar::$options['defaultresolve'])); } $show['assign'] = can_perform('canassign'); if (can_perform('canassign')) { - foreach ($bugsys->datastore['assignto'] AS $dev) + foreach (bugdar::$datastore['assignto'] AS $dev) { $value = $dev['userid']; $label = construct_user_display($dev, false); - $selected = ($bugsys->in['assignedto'] ? ($bugsys->in['assignedto'] == $dev['userid']) : ($dev['userid'] == $bugsys->options['defaultassign'])); + $selected = ($bugsys->in['assignedto'] ? ($bugsys->in['assignedto'] == $dev['userid']) : ($dev['userid'] == bugdar::$options['defaultassign'])); eval('$select[dev] .= "' . $template->fetch('selectoption') . '";'); } } @@ -190,7 +190,7 @@ if ($_REQUEST['do'] == 'add') $productSelect = ConstructProductSelect('cansubmitbugs', $bugsys->in['product'], false); - $reporter = construct_user_display($bugsys->userinfo); + $reporter = construct_user_display(bugdar::$userinfo); eval('$template->flush("' . $template->fetch('newreport') . '");'); } diff --git a/register.php b/register.php index c849890..6c6db55 100755 --- a/register.php +++ b/register.php @@ -37,12 +37,12 @@ APIError(array(new API_Error_Handler($message), 'user_cumulative')); if ($_POST['do'] == 'insert') { - if ($bugsys->userinfo['userid']) + if (bugdar::$userinfo['userid']) { $message->error(T('Sorry, you are already registered.')); } - if (!$bugsys->options['allownewreg']) + if (!bugdar::$options['allownewreg']) { $message->error(T('Sorry, we don\'t allow new registrations.')); } @@ -57,13 +57,13 @@ if ($_POST['do'] == 'insert') $message->addError(T('The passwords you entered did not match.')); } - if ($bugsys->options['verifyemail']) + if (bugdar::$options['verifyemail']) { $usergroupid = 3; } else { - if ($bugsys->options['moderatenewusers']) + if (bugdar::$options['moderatenewusers']) { $usergroupid = 4; } @@ -80,7 +80,7 @@ if ($_POST['do'] == 'insert') $user->set('showemail', $bugsys->in['showemail']); $user->set('showcolors', 1); $user->set('languageid', $bugsys->in['languageid']); - $user->set('timezone', $bugsys->options['defaulttimezone']); + $user->set('timezone', bugdar::$options['defaulttimezone']); $user->set('usergroupid', $usergroupid); if (!$message->hasErrors()) @@ -96,7 +96,7 @@ if ($_POST['do'] == 'insert') $db->query("INSERT INTO " . TABLE_PREFIX . "useractivation (userid, activator, dateline, usergroupid) VALUES ($userid, '$activationid', " . TIMENOW . ", 2)"); - eval('$email = "' . $template->fetch(FetchEmailPath('activateaccount.xml', $bugsys->datastore['language'][$bugsys->in['languageid']]['langcode'])) . '";'); + eval('$email = "' . $template->fetch(FetchEmailPath('activateaccount.xml', bugdar::$datastore['language'][$bugsys->in['languageid']]['langcode'])) . '";'); $email = $bugsys->xml->parse($email); $mail->setSubject($email['email']['subject']['value']); $mail->setBodyText($email['email']['bodyText']['value']); @@ -107,10 +107,10 @@ if ($_POST['do'] == 'insert') } else if ($usergroupid == 4 OR $usergroupid == 2) { - if ($bugsys->options['sendwelcomemail']) + if (bugdar::$options['sendwelcomemail']) { $displayName = $bugsys->in['displayname']; - eval('$email = "' . $template->fetch(FetchEmailPath('welcome.xml', $bugsys->datastore['language'][$bugsys->in['languageid']]['langcode'])) . '";'); + eval('$email = "' . $template->fetch(FetchEmailPath('welcome.xml', bugdar::$datastore['language'][$bugsys->in['languageid']]['langcode'])) . '";'); $email = $bugsys->xml->parse($email); $mail->setSubject($email['email']['subject']['value']); $mail->setBodyText($email['email']['bodyText']['value']); @@ -138,17 +138,17 @@ if ($_POST['do'] == 'insert') if (empty($_REQUEST['do'])) { - if ($bugsys->userinfo['userid']) + if (bugdar::$userinfo['userid']) { $message->error(T('Sorry, you are already registered.')); } - if (!$bugsys->options['allownewreg']) + if (!bugdar::$options['allownewreg']) { $message->error(T('Sorry, we don\'t allow new registrations.')); } - foreach ($bugsys->datastore['language'] AS $value => $temp) + foreach (bugdar::$datastore['language'] AS $value => $temp) { $label = $temp['title']; $selected = ($value == $bugsys->in['languageid']); @@ -169,10 +169,10 @@ if ($_REQUEST['do'] == 'activate') $db->query("UPDATE " . TABLE_PREFIX . "user SET usergroupid = $useractivation[usergroupid] WHERE userid = " . $bugsys->in['userid']); $db->query("DELETE FROM " . TABLE_PREFIX . "useractivation WHERE userid = " . $bugsys->in['userid']); - if ($bugsys->options['sendwelcomemail']) + if (bugdar::$options['sendwelcomemail']) { $displayName = $user['displayname']; - eval('$email = "' . $template->fetch(FetchEmailPath('welcome.xml', $bugsys->datastore['language'][$user['languageid']]['langcode'])) . '";'); + eval('$email = "' . $template->fetch(FetchEmailPath('welcome.xml', bugdar::$datastore['language'][$user['languageid']]['langcode'])) . '";'); $email = $bugsys->xml->parse($email); $mail->setSubject($email['email']['subject']['value']); $mail->setBodyText($email['email']['bodyText']['value']); diff --git a/search.php b/search.php index e22c3b6..a56c28a 100644 --- a/search.php +++ b/search.php @@ -76,11 +76,11 @@ if ($_REQUEST['do'] == 'search') } else if ($bugsys->in['searchid']) { - $cachedsearch = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "search WHERE searchid = " . $bugsys->input_clean('searchid', TYPE_UINT) . " AND userid = " . $bugsys->userinfo['userid']); + $cachedsearch = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "search WHERE searchid = " . $bugsys->input_clean('searchid', TYPE_UINT) . " AND userid = " . bugdar::$userinfo['userid']); } - else if ($bugsys->userinfo['userid']) + else if (bugdar::$userinfo['userid']) { - $cachedsearch = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "search WHERE name IS NULL AND userid = " . $bugsys->userinfo['userid']); + $cachedsearch = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "search WHERE name IS NULL AND userid = " . bugdar::$userinfo['userid']); } else { @@ -109,12 +109,12 @@ if ($_REQUEST['do'] == 'search') if ($newsearch) { - if (!is_array($bugsys->datastore['product'])) + if (!is_array(bugdar::$datastore['product'])) { $message->error(T('No products are setup, therefore there can be no bugs and thus search cannot function.')); } - if (!is_array($bugsys->datastore['version'])) + if (!is_array(bugdar::$datastore['version'])) { $message->error(T('No versions have been added underneath your product(s), there can be no bugs and thus search cannot function.')); } @@ -146,9 +146,9 @@ if ($_REQUEST['do'] == 'search') $select['resolution'] = construct_datastore_select('resolution', 'resolution', 'resolutionid'); $searches = ''; - if ($bugsys->userinfo['userid']) + if (bugdar::$userinfo['userid']) { - $searchesFetch = $db->query("SELECT * FROM " . TABLE_PREFIX . "search WHERE name IS NOT NULL AND userid = " . $bugsys->userinfo['userid']); + $searchesFetch = $db->query("SELECT * FROM " . TABLE_PREFIX . "search WHERE name IS NOT NULL AND userid = " . bugdar::$userinfo['userid']); while ($search = $db->fetch_array($searchesFetch)) { $value = $search['searchid']; @@ -158,7 +158,7 @@ if ($_REQUEST['do'] == 'search') } $select['dev'] = ''; - foreach ($bugsys->datastore['assignto'] AS $dev) + foreach (bugdar::$datastore['assignto'] AS $dev) { $value = $dev['userid']; $label = construct_user_display($dev, false); @@ -295,9 +295,9 @@ if ($_REQUEST['do'] == 'process') // ------------------------------------------------------------------- // favorites $bugsys->input_clean('favorite', TYPE_INT); - if ($bugsys->in['favorite'] != 0 AND $bugsys->userinfo['userid']) + if ($bugsys->in['favorite'] != 0 AND bugdar::$userinfo['userid']) { - $favorites = $db->query("SELECT * FROM " . TABLE_PREFIX . "favorite WHERE userid = " . $bugsys->userinfo['userid']); + $favorites = $db->query("SELECT * FROM " . TABLE_PREFIX . "favorite WHERE userid = " . bugdar::$userinfo['userid']); while ($favorite = $db->fetch_array($favorites)) { $ids[] = $favorite['bugid']; @@ -331,7 +331,7 @@ if ($_REQUEST['do'] == 'process') LEFT JOIN " . TABLE_PREFIX . "bugfieldpermission AS permission ON (bugfield.fieldid = permission.fieldid) WHERE mask <> 0 - AND permission.usergroupid IN ({$bugsys->userinfo['usergroupid']}" . (sizeof($bugsys->userinfo['groupids']) != 0 ? ',' . implode(',', $bugsys->userinfo['groupids']) : '') . ") + AND permission.usergroupid IN ({bugdar::$userinfo['usergroupid']}" . (sizeof(bugdar::$userinfo['groupids']) != 0 ? ',' . implode(',', bugdar::$userinfo['groupids']) : '') . ") AND bugfield.cansearch = 1 GROUP BY (bugfield.fieldid)" ); @@ -378,7 +378,7 @@ if ($_REQUEST['do'] == 'process') OR (bug.hidden AND bug.product IN (" . fetch_on_bits('canviewhidden') . "))" . (can_perform('canviewownhidden') ? " OR - (bug.hidden AND bug.userid = " . $bugsys->userinfo['userid'] . " AND bug.product IN (" . fetch_on_bits('canviewonhidden') . "))" : "") . " + (bug.hidden AND bug.userid = " . bugdar::$userinfo['userid'] . " AND bug.product IN (" . fetch_on_bits('canviewonhidden') . "))" : "") . " ) " . implode("\n\t\t", $querybuild) . " GROUP BY bug.bugid @@ -398,9 +398,9 @@ if ($_REQUEST['do'] == 'process') $results[] = $result; } - if ($bugsys->userinfo['userid'] AND !$cachedsearch AND !$bugsys->in['rerun']) + if (bugdar::$userinfo['userid'] AND !$cachedsearch AND !$bugsys->in['rerun']) { - $db->query("DELETE FROM " . TABLE_PREFIX . "search WHERE userid = " . $bugsys->userinfo['userid'] . " AND name IS NULL"); + $db->query("DELETE FROM " . TABLE_PREFIX . "search WHERE userid = " . bugdar::$userinfo['userid'] . " AND name IS NULL"); } // store the search params @@ -423,7 +423,7 @@ if ($_REQUEST['do'] == 'process') INSERT INTO " . TABLE_PREFIX . "search (userid, dateline, query, ids, orderby, hilight, resultcount) VALUES - (" . $bugsys->userinfo['userid'] . ", + (" . bugdar::$userinfo['userid'] . ", " . TIMENOW . ", '" . $bugsys->escape(serialize($params)) . "', '" . implode(',', $ids) . "', '" . $bugsys->escape($sortclause) . "', '" . $bugsys->escape($hilight) . "', @@ -440,7 +440,7 @@ if ($_REQUEST['do'] == 'process') if ($_REQUEST['do'] == 'update') { - $search = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "search WHERE searchid = " . $bugsys->input_clean('searchid', TYPE_UINT) . " AND userid = " . $bugsys->userinfo['userid']); + $search = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "search WHERE searchid = " . $bugsys->input_clean('searchid', TYPE_UINT) . " AND userid = " . bugdar::$userinfo['userid']); if (!$search OR !can_perform('caneditother')) { $message->errorPermission(); @@ -480,7 +480,7 @@ if ($_REQUEST['do'] == 'update') $selected = true; eval('$select[dev] .= "' . $template->fetch('selectoption') . '";'); $selected = false; - foreach ($bugsys->datastore['assignto'] AS $dev) + foreach (bugdar::$datastore['assignto'] AS $dev) { $value = $dev['userid']; $label = construct_user_display($dev, false); @@ -494,7 +494,7 @@ if ($_REQUEST['do'] == 'update') if ($_POST['do'] == 'doupdate') { - $search = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "search WHERE searchid = " . $bugsys->input_clean('searchid', TYPE_UINT) . " AND userid = " . $bugsys->userinfo['userid']); + $search = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "search WHERE searchid = " . $bugsys->input_clean('searchid', TYPE_UINT) . " AND userid = " . bugdar::$userinfo['userid']); if (!$search OR !can_perform('caneditother')) { $message->errorPermission(); @@ -509,12 +509,12 @@ if ($_POST['do'] == 'doupdate') ( product IN (" . fetch_on_bits('caneditother') . ") OR - (userid = " . $bugsys->userinfo['userid'] . " AND product IN (" . fetch_on_bits('caneditown') . ")) + (userid = " . bugdar::$userinfo['userid'] . " AND product IN (" . fetch_on_bits('caneditown') . ")) ) "); while ($bug = $db->fetch_array($bugs)) { - if (!((can_perform('caneditown', $bug['product']) AND $bugsys->userinfo['userid'] == $bug['userid']) OR (can_perform('caneditother', $bug['product']) AND $bugsys->userinfo['userid'] != $bug['userid'])) AND !can_perform('canpostcomments', $bug['product'])) + if (!((can_perform('caneditown', $bug['product']) AND bugdar::$userinfo['userid'] == $bug['userid']) OR (can_perform('caneditother', $bug['product']) AND bugdar::$userinfo['userid'] != $bug['userid'])) AND !can_perform('canpostcomments', $bug['product'])) { continue; } @@ -571,13 +571,13 @@ if ($_POST['do'] == 'doupdate') if ($_REQUEST['do'] == 'export') { - if (!$bugsys->in['searchid'] AND $bugsys->userinfo['userid']) + if (!$bugsys->in['searchid'] AND bugdar::$userinfo['userid']) { - $search = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "search WHERE name IS NULL AND userid = " . $bugsys->userinfo['userid']); + $search = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "search WHERE name IS NULL AND userid = " . bugdar::$userinfo['userid']); } else if ($bugsys->in['searchid']) { - $search = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "search WHERE searchid = " . $bugsys->input_clean('searchid', TYPE_UINT) . " AND userid = " . $bugsys->userinfo['userid']); + $search = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "search WHERE searchid = " . $bugsys->input_clean('searchid', TYPE_UINT) . " AND userid = " . bugdar::$userinfo['userid']); } else { @@ -593,7 +593,7 @@ if ($_REQUEST['do'] == 'export') $xml = ' -'; +'; while ($bug = $db->fetch_array($bugs)) { @@ -617,7 +617,7 @@ if ($_REQUEST['do'] == 'export') $xml .= "\n\t\t" . $bug['status'] . ""; if ($bug['assignedto']) { - $xml .= "\n\t\t" . construct_user_display($bugsys->datastore['assignto']["$bug[assignedto]"], false) . ""; + $xml .= "\n\t\t" . construct_user_display(bugdar::$datastore['assignto']["$bug[assignedto]"], false) . ""; } $xml .= "\n\t\t" . $bug['resolution'] . ""; $xml .= "\n\t\t" . $bug['severity'] . ""; @@ -635,7 +635,7 @@ if ($_REQUEST['do'] == 'export') if ($_POST['do'] == 'dosave') { - $search = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "search WHERE searchid = " . $bugsys->input_clean('searchid', TYPE_UINT) . " AND userid = " . $bugsys->userinfo['userid']); + $search = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "search WHERE searchid = " . $bugsys->input_clean('searchid', TYPE_UINT) . " AND userid = " . bugdar::$userinfo['userid']); if (!$search) { $message->addError(T('The search does not exist.')); @@ -665,7 +665,7 @@ if ($_POST['do'] == 'dosave') if ($_REQUEST['do'] == 'save') { - if (!$bugsys->userinfo['userid']) + if (!bugdar::$userinfo['userid']) { $message->errorPermission(); } @@ -691,7 +691,7 @@ if ($_POST['do'] == 'results') $sort = new ListSorter('search'); - $show['save'] = ($bugsys->userinfo['userid'] AND !$search['name']); + $show['save'] = (bugdar::$userinfo['userid'] AND !$search['name']); $show['update'] = can_perform('caneditother'); $bugs = ''; diff --git a/showhistory.php b/showhistory.php index ebef405..de31c51 100644 --- a/showhistory.php +++ b/showhistory.php @@ -60,7 +60,7 @@ $customfields = $db->query(" LEFT JOIN " . TABLE_PREFIX . "bugfieldpermission AS permission ON (bugfield.fieldid = permission.fieldid) WHERE mask <> 0 - AND permission.usergroupid IN ({$bugsys->userinfo['usergroupid']}" . (sizeof($bugsys->userinfo['groupids']) != 0 ? ',' . implode(',', $bugsys->userinfo['groupids']) : '') . ") + AND permission.usergroupid IN ({bugdar::$userinfo['usergroupid']}" . (sizeof(bugdar::$userinfo['groupids']) != 0 ? ',' . implode(',', bugdar::$userinfo['groupids']) : '') . ") GROUP BY (bugfield.fieldid)" ); @@ -81,7 +81,7 @@ $logs_fetch = $db->query(" ); while ($log = $db->fetch_array($logs_fetch)) { - $log['date'] = $datef->format($bugsys->options['dateformat'], $log['dateline']); + $log['date'] = $datef->format(bugdar::$options['dateformat'], $log['dateline']); $log['user'] = construct_user_display($log); $logs["$log[dateline]"]["$log[historyid]"] = $log; @@ -133,8 +133,8 @@ foreach ($logs AS $dateline => $logitems) if (isset($lookupfields["$matches[1]"])) { $lookup = $matches[1]; - $log['original'] = $bugsys->datastore["$lookup"]["$log[original]"][ $lookupfields["$lookup"] ]; - $log['changed'] = $bugsys->datastore["$lookup"]["$log[changed]"][ $lookupfields["$lookup"] ]; + $log['original'] = bugdar::$datastore["$lookup"]["$log[original]"][ $lookupfields["$lookup"] ]; + $log['changed'] = bugdar::$datastore["$lookup"]["$log[changed]"][ $lookupfields["$lookup"] ]; } else if ($matches[1] == 'assignto' OR $matches[1] == 'assignedto') { diff --git a/showreport.php b/showreport.php index 7119bad..befc103 100644 --- a/showreport.php +++ b/showreport.php @@ -79,7 +79,7 @@ if (!check_bug_permissions($bug)) $message->errorPermission(); } -$show['edit'] = ((can_perform('caneditown', $bug['product']) AND $bugsys->userinfo['userid'] == $bug['userid'] AND $bug['userid'] != 0) OR (can_perform('caneditother', $bug['product']) AND $bugsys->userinfo['userid'] != $bug['userid'])); +$show['edit'] = ((can_perform('caneditown', $bug['product']) AND bugdar::$userinfo['userid'] == $bug['userid'] AND $bug['userid'] != 0) OR (can_perform('caneditother', $bug['product']) AND bugdar::$userinfo['userid'] != $bug['userid'])); $show['delete'] = can_perform('candeletedata', $bug['product']); // ################################################################### @@ -97,16 +97,16 @@ if ($show['edit']) } else { - $bug['status'] = $bugsys->datastore['status']["$bug[status]"]['status']; - $bug['resolution'] = $bugsys->datastore['resolution']["$bug[resolution]"]['resolution']; - $bug['severity'] = $bugsys->datastore['severity']["$bug[severity]"]['severity']; - $bug['priority'] = $bugsys->datastore['priority']["$bug[priority]"]['priority']; + $bug['status'] = bugdar::$datastore['status']["$bug[status]"]['status']; + $bug['resolution'] = bugdar::$datastore['resolution']["$bug[resolution]"]['resolution']; + $bug['severity'] = bugdar::$datastore['severity']["$bug[severity]"]['severity']; + $bug['priority'] = bugdar::$datastore['priority']["$bug[priority]"]['priority']; } $show['assign'] = (can_perform('canassign', $bug['product']) ? true : false); - if (can_perform('canassign', $bug['product']) AND is_array($bugsys->datastore['assignto'])) + if (can_perform('canassign', $bug['product']) AND is_array(bugdar::$datastore['assignto'])) { - foreach ($bugsys->datastore['assignto'] AS $dev) + foreach (bugdar::$datastore['assignto'] AS $dev) { $value = $dev['userid']; $selected = (($dev['userid'] == $bug['assignedto']) ? true : false); @@ -135,9 +135,9 @@ if ($show['edit']) $select['automations'] = ''; $show['automations'] = false; - if (is_array($bugsys->datastore['automation'])) + if (is_array(bugdar::$datastore['automation'])) { - foreach ($bugsys->datastore['automation'] AS $action) + foreach (bugdar::$datastore['automation'] AS $action) { $label = $action['name']; $value = $action['actionid']; @@ -161,12 +161,12 @@ else { // ------------------------------------------------------------------- // prep display - $bug['status'] = $bugsys->datastore['status']["$bug[status]"]['status']; - $bug['resolution'] = $bugsys->datastore['resolution']["$bug[resolution]"]['resolution']; - $bug['severity'] = $bugsys->datastore['severity']["$bug[severity]"]['severity']; - $bug['priority'] = $bugsys->datastore['priority']["$bug[priority]"]['priority']; + $bug['status'] = bugdar::$datastore['status']["$bug[status]"]['status']; + $bug['resolution'] = bugdar::$datastore['resolution']["$bug[resolution]"]['resolution']; + $bug['severity'] = bugdar::$datastore['severity']["$bug[severity]"]['severity']; + $bug['priority'] = bugdar::$datastore['priority']["$bug[priority]"]['priority']; - $assigninfo = $bugsys->datastore['assignto']["$bug[assignedto]"]; + $assigninfo = bugdar::$datastore['assignto']["$bug[assignedto]"]; $bug['assigninfo'] = ((is_array($assigninfo)) ? construct_user_display($assigninfo) : ''); $duplicateof = $db->query_first("SELECT bugid, summary FROM " . TABLE_PREFIX . "bug WHERE bugid = $bug[duplicateof]"); @@ -196,17 +196,17 @@ else $show['subscribe'] = can_perform('cansubscribe', $bug['product']); -$favorite = (bool)$db->query_first("SELECT * FROM " . TABLE_PREFIX . "favorite WHERE bugid = $bug[bugid] AND userid = " . $bugsys->userinfo['userid']); +$favorite = (bool)$db->query_first("SELECT * FROM " . TABLE_PREFIX . "favorite WHERE bugid = $bug[bugid] AND userid = " . bugdar::$userinfo['userid']); $favoritetext = ($favorite ? T('Remove from Favorites') : T('Add to Favorites')); $bug['userinfo'] = construct_user_display($bug); -$bug['datetime'] = $datef->format($bugsys->options['dateformat'], $bug['dateline']); +$bug['datetime'] = $datef->format(bugdar::$options['dateformat'], $bug['dateline']); $bug['productid'] = $bug['product']; -$bug['product'] = $bugsys->datastore['product']["$bug[product]"]['title']; +$bug['product'] = bugdar::$datastore['product']["$bug[product]"]['title']; $bug['componentid'] = $bug['component']; -$bug['component'] = ($bug['component'] ? $bugsys->datastore['product']["$bug[component]"]['title'] : ''); +$bug['component'] = ($bug['component'] ? bugdar::$datastore['product']["$bug[component]"]['title'] : ''); $bug['versionid'] = $bug['version']; -$bug['version'] = $bugsys->datastore['version']["$bug[version]"]['version']; +$bug['version'] = bugdar::$datastore['version']["$bug[version]"]['version']; // ################################################################### // custom field output @@ -265,8 +265,8 @@ if ($show['getattachments'] OR $show['putattachments']) while ($attachment = $db->fetch_array($attachments_fetch)) { $attaches = true; - $show['editattach'] = ((can_perform('caneditattach', $bug['productid']) OR ($attachment['userid'] == $bugsys->userinfo['userid'] AND can_perform('canputattach', $bug['productid']))) ? true : false); - $attachment['date'] = $datef->format($bugsys->options['dateformat'], $attachment['dateline']); + $show['editattach'] = ((can_perform('caneditattach', $bug['productid']) OR ($attachment['userid'] == bugdar::$userinfo['userid'] AND can_perform('canputattach', $bug['productid']))) ? true : false); + $attachment['date'] = $datef->format(bugdar::$options['dateformat'], $attachment['dateline']); $attachment['user'] = construct_user_display($attachment, false); eval('$attachments .= "' . $template->fetch('showreport_attachment') . '";'); } @@ -277,7 +277,7 @@ if ($show['getattachments'] OR $show['putattachments']) // ------------------------------------------------------------------- // votes -$vote = $db->query_first("SELECT *, FIND_IN_SET(" . $bugsys->userinfo['userid'] . ", userids) AS uservote FROM " . TABLE_PREFIX . "vote WHERE bugid = $bug[bugid]"); +$vote = $db->query_first("SELECT *, FIND_IN_SET(" . bugdar::$userinfo['userid'] . ", userids) AS uservote FROM " . TABLE_PREFIX . "vote WHERE bugid = $bug[bugid]"); $vote['total'] = $vote['votefor'] + $vote['voteagainst']; if ($vote['total'] != 0) @@ -306,12 +306,12 @@ $comments_fetch = $db->query(" ); while ($comment = $db->fetch_array($comments_fetch)) { - $comment['posttime'] = $datef->format($bugsys->options['dateformat'], $comment['dateline']); + $comment['posttime'] = $datef->format(bugdar::$options['dateformat'], $comment['dateline']); $comment['postby'] = construct_user_display($comment); - $show['editcomment'] = ((can_perform('caneditownreply', $bug['productid']) AND $bugsys->userinfo['userid'] == $comment['userid']) OR (can_perform('caneditotherreply', $bug['productid']) AND $bugsys->userinfo['userid'] != $comment['userid'])); + $show['editcomment'] = ((can_perform('caneditownreply', $bug['productid']) AND bugdar::$userinfo['userid'] == $comment['userid']) OR (can_perform('caneditotherreply', $bug['productid']) AND bugdar::$userinfo['userid'] != $comment['userid'])); - $bugsys->debug('can edit own replies: ' . (int)(can_perform('caneditownreply', $bug['productid']) AND $bugsys->userinfo['userid'] == $comment['userid'])); - $bugsys->debug('can edit other replies:' . (int)(can_perform('caneditotherreply', $bug['productid']) AND $bugsys->userinfo['userid'] != $comment['userid'])); + $bugsys->debug('can edit own replies: ' . (int)(can_perform('caneditownreply', $bug['productid']) AND bugdar::$userinfo['userid'] == $comment['userid'])); + $bugsys->debug('can edit other replies:' . (int)(can_perform('caneditotherreply', $bug['productid']) AND bugdar::$userinfo['userid'] != $comment['userid'])); $bugsys->debug('$show[editcomment]: ' . $show['editcomment']); if (is_array($hilight)) diff --git a/syndicate.php b/syndicate.php index 0f0329b..a9febca 100644 --- a/syndicate.php +++ b/syndicate.php @@ -44,7 +44,7 @@ $bugs_fetch = $db->query(" WHERE bug.product IN (" . fetch_on_bits('canviewbugs', fetch_guest_user()) . ") AND (!bug.hidden OR (bug.hidden AND bug.product IN (" . fetch_on_bits('canviewhidden', fetch_guest_user()) . "))) ORDER BY " . (can_perform('canviewhidden', 0, fetch_guest_user()) ? "bug.lastposttime" : "bug.hiddenlastposttime") . " DESC - LIMIT " . $bugsys->options['syndicateditems'] + LIMIT " . bugdar::$options['syndicateditems'] ); while ($bug = $db->fetch_array($bugs_fetch)) { @@ -68,21 +68,21 @@ while ($bug = $db->fetch_array($bugs_fetch)) - + - + - +
' . T('Product/Component/Version') . ':' . $bugsys->datastore['product']["$bug[product]"]['title'] . '/' . (($bug['component']) ? $bugsys->datastore['product']["$bug[component]"]['title'] . '/' : '') . $bugsys->datastore['version']["$bug[version]"]['version'] . '' . bugdar::$datastore['product']["$bug[product]"]['title'] . '/' . (($bug['component']) ? bugdar::$datastore['product']["$bug[component]"]['title'] . '/' : '') . bugdar::$datastore['version']["$bug[version]"]['version'] . '
' . T('Status') . ':' . $bugsys->datastore['status']["$bug[status]"]['status'] . '' . bugdar::$datastore['status']["$bug[status]"]['status'] . '
' . T('Severity') . ':' . $bugsys->datastore['severity']["$bug[severity]"]['severity'] . '' . bugdar::$datastore['severity']["$bug[severity]"]['severity'] . '

' . $bug['comment_parsed'] . '

') . ' ' . htmlspecialchars($bug['comment_parsed']) . ' - + '; $lastupdated = $bug["$timestamp"]; @@ -91,8 +91,8 @@ while ($bug = $db->fetch_array($bugs_fetch)) echo ' - ' . sprintf(T('%1$s Syndication Feed'), $bugsys->options['trackertitle']) . ' - + ' . sprintf(T('%1$s Syndication Feed'), bugdar::$options['trackertitle']) . ' + ' . gmdate('Y-m-d\TH:i:s\Z', $lastupdated) . ' diff --git a/templates/explain_automation.tpl b/templates/explain_automation.tpl index 90fb868..79029e8 100644 --- a/templates/explain_automation.tpl +++ b/templates/explain_automation.tpl @@ -2,7 +2,7 @@ $doctype $headinclude - {$bugsys->options['trackertitle']} - {@"Automations"} + {bugdar::$options['trackertitle']} - {@"Automations"} diff --git a/templates/explain_product.tpl b/templates/explain_product.tpl index cc841b4..ce78cb4 100644 --- a/templates/explain_product.tpl +++ b/templates/explain_product.tpl @@ -2,7 +2,7 @@ $doctype $headinclude - {$bugsys->options['trackertitle']} - {@"Products"} + {bugdar::$options['trackertitle']} - {@"Products"} diff --git a/templates/favorites.tpl b/templates/favorites.tpl index 36e9234..b2505aa 100644 --- a/templates/favorites.tpl +++ b/templates/favorites.tpl @@ -2,7 +2,7 @@ $doctype $headinclude - {$bugsys->options['trackertitle']} - {@"My Favorite Bugs"} + {bugdar::$options['trackertitle']} - {@"My Favorite Bugs"} diff --git a/templates/header.tpl b/templates/header.tpl index 9f56107..0151efb 100644 --- a/templates/header.tpl +++ b/templates/header.tpl @@ -6,13 +6,13 @@ - {$bugsys->options['trackertitle']} + {bugdar::$options['trackertitle']}   {@ $datetime - +
{@"Hello, guest. We have noticed that you are not registered at this bug tracker. Your experience will be greatly enhanced if you log in. To do so, you first must register by clicking on the Register tab at the top. If you are already registered, you can login at the Login tab."}
@@ -29,14 +29,14 @@ {@"Search"} - + {@"Favorites"} - userinfo['userid']">userctrl.php">{@"Options"}login.php">{@"Login/Register"} + userctrl.php">{@"Options"}login.php">{@"Login/Register"}
{@"Administration"} - + {@"Logout"} diff --git a/templates/login.tpl b/templates/login.tpl index 17840a2..747b9f8 100644 --- a/templates/login.tpl +++ b/templates/login.tpl @@ -3,7 +3,7 @@ $doctype $headinclude - {$bugsys->options['trackertitle']} - {@"Login"} + {bugdar::$options['trackertitle']} - {@"Login"} diff --git a/templates/lostpassword.tpl b/templates/lostpassword.tpl index 9694a9f..2e6db04 100644 --- a/templates/lostpassword.tpl +++ b/templates/lostpassword.tpl @@ -3,7 +3,7 @@ $doctype $headinclude - {$bugsys->options['trackertitle']} - {@"Lost Password"} + {bugdar::$options['trackertitle']} - {@"Lost Password"} diff --git a/templates/newreport.tpl b/templates/newreport.tpl index 61c8801..02afa56 100644 --- a/templates/newreport.tpl +++ b/templates/newreport.tpl @@ -4,7 +4,7 @@ $doctype $headinclude - {@"New Bug Report"} - {$bugsys->options['trackertitle']} + {@"New Bug Report"} - {bugdar::$options['trackertitle']} @@ -110,7 +110,7 @@ $header
{@"Description/Initial Report"} - +
checked="checked" /> {@"Parse Links in the Comment"}
diff --git a/templates/passwordreset.tpl b/templates/passwordreset.tpl index 7ce3eb2..a21052f 100644 --- a/templates/passwordreset.tpl +++ b/templates/passwordreset.tpl @@ -3,7 +3,7 @@ $doctype $headinclude - {$bugsys->options['trackertitle']} - {@"Reset Password"} + {bugdar::$options['trackertitle']} - {@"Reset Password"} diff --git a/templates/quicksearch.tpl b/templates/quicksearch.tpl index 4c6cdd1..c38fb43 100644 --- a/templates/quicksearch.tpl +++ b/templates/quicksearch.tpl @@ -3,7 +3,7 @@ $doctype $headinclude - {$bugsys->options['trackertitle']} - {@"Quick Search"} + {bugdar::$options['trackertitle']} - {@"Quick Search"} diff --git a/templates/register.tpl b/templates/register.tpl index 5eec074..df88eca 100644 --- a/templates/register.tpl +++ b/templates/register.tpl @@ -3,7 +3,7 @@ $doctype $headinclude - {$bugsys->options['trackertitle']} - {@"Register"} + {bugdar::$options['trackertitle']} - {@"Register"} diff --git a/templates/search.tpl b/templates/search.tpl index bbfcbc1..6f0e45c 100644 --- a/templates/search.tpl +++ b/templates/search.tpl @@ -4,7 +4,7 @@ $doctype $headinclude - {$bugsys->options['trackertitle']} - {@"Search"} + {bugdar::$options['trackertitle']} - {@"Search"} @@ -147,7 +147,7 @@ $header - +
{@"Favorite"} diff --git a/templates/search_results.tpl b/templates/search_results.tpl index a7e730d..52ea77a 100644 --- a/templates/search_results.tpl +++ b/templates/search_results.tpl @@ -2,7 +2,7 @@ $doctype $headinclude - {$bugsys->options['trackertitle']} - {@"Search Results"} + {bugdar::$options['trackertitle']} - {@"Search Results"} diff --git a/templates/search_save.tpl b/templates/search_save.tpl index fe20921..acc09fd 100644 --- a/templates/search_save.tpl +++ b/templates/search_save.tpl @@ -3,7 +3,7 @@ $doctype $headinclude - {$bugsys->options['trackertitle']} - {@"Save Search"} + {bugdar::$options['trackertitle']} - {@"Save Search"} diff --git a/templates/search_update.tpl b/templates/search_update.tpl index 5fbcc9c..0f8cf1b 100644 --- a/templates/search_update.tpl +++ b/templates/search_update.tpl @@ -4,7 +4,7 @@ $doctype $headinclude - {$bugsys->options['trackertitle']} - {@"Mass Update"} + {bugdar::$options['trackertitle']} - {@"Mass Update"} @@ -71,7 +71,7 @@ $header
- +
{@"Favorite"} diff --git a/templates/std_error.tpl b/templates/std_error.tpl index d821a31..ef99bd2 100644 --- a/templates/std_error.tpl +++ b/templates/std_error.tpl @@ -3,7 +3,7 @@ $doctype $headinclude - {$bugsys->options['trackertitle']} - {@"Error"} + {bugdar::$options['trackertitle']} - {@"Error"} diff --git a/templates/std_message.tpl b/templates/std_message.tpl index 1b7afaa..c797ccb 100644 --- a/templates/std_message.tpl +++ b/templates/std_message.tpl @@ -3,7 +3,7 @@ $doctype $headinclude - {$bugsys->options['trackertitle']} - <if condition="$show['confirm']">{@"Confirm"}<else />{@"Notice"}</if> + {bugdar::$options['trackertitle']} - <if condition="$show['confirm']">{@"Confirm"}<else />{@"Notice"}</if> diff --git a/templates/std_redirect.tpl b/templates/std_redirect.tpl index 22276f5..78b781e 100644 --- a/templates/std_redirect.tpl +++ b/templates/std_redirect.tpl @@ -4,7 +4,7 @@ $doctype $headinclude - {$bugsys->options['trackertitle']} - {@"Redirect..."} + {bugdar::$options['trackertitle']} - {@"Redirect..."} diff --git a/templates/trackerhome.tpl b/templates/trackerhome.tpl index f446a41..505067e 100644 --- a/templates/trackerhome.tpl +++ b/templates/trackerhome.tpl @@ -2,7 +2,7 @@ $doctype $headinclude - {$bugsys->options['trackertitle']} - {@"Bug Listing"} + {bugdar::$options['trackertitle']} - {@"Bug Listing"} diff --git a/templates/trackerhome_bits.tpl b/templates/trackerhome_bits.tpl index 5ec5db5..fbf436e 100644 --- a/templates/trackerhome_bits.tpl +++ b/templates/trackerhome_bits.tpl @@ -1,6 +1,6 @@ - style="background-color: $bug[bgcolor]; font-style: italic" class="$bug[bgcolor]" style="font-style: italic"> + style="background-color: $bug[bgcolor]; font-style: italic" class="$bug[bgcolor]" style="font-style: italic"> $fields diff --git a/templates/userctrl.tpl b/templates/userctrl.tpl index 8c4fc62..5f1e2a1 100644 --- a/templates/userctrl.tpl +++ b/templates/userctrl.tpl @@ -4,7 +4,7 @@ $doctype $headinclude - {$bugsys->options['trackertitle']} - {@"User Options"} + {bugdar::$options['trackertitle']} - {@"User Options"} @@ -29,7 +29,7 @@ $header
{@"User Options"}
- +
{@"Display Name"} @@ -158,7 +158,7 @@ $header - +
diff --git a/userctrl.php b/userctrl.php index 100e17f..878b5fc 100644 --- a/userctrl.php +++ b/userctrl.php @@ -35,16 +35,16 @@ require_once('./includes/api_user.php'); APIError(array(new API_Error_Handler($message), 'user_cumulative')); -if (!$bugsys->userinfo['userid']) +if (!bugdar::$userinfo['userid']) { $message->errorPermission(); } $userapi = new UserAPI($bugsys); -$userapi->set('userid', $bugsys->userinfo['userid']); +$userapi->set('userid', bugdar::$userinfo['userid']); $userapi->set_condition(); -$userinfo = $bugsys->userinfo; +$userinfo = bugdar::$userinfo; // ################################################################### @@ -57,7 +57,7 @@ if (empty($_REQUEST['do'])) if ($_POST['do'] == 'killsearch') { - $search = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "search WHERE searchid = " . $bugsys->input_clean('searchid', TYPE_UINT) . " AND userid = " . $bugsys->userinfo['userid']); + $search = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "search WHERE searchid = " . $bugsys->input_clean('searchid', TYPE_UINT) . " AND userid = " . bugdar::$userinfo['userid']); if (!$search) { $message->errorPermission(); @@ -72,7 +72,7 @@ if ($_POST['do'] == 'killsearch') if ($_REQUEST['do'] == 'deletesearch') { - $search = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "search WHERE searchid = " . $bugsys->input_clean('searchid', TYPE_UINT) . " AND userid = " . $bugsys->userinfo['userid']); + $search = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "search WHERE searchid = " . $bugsys->input_clean('searchid', TYPE_UINT) . " AND userid = " . bugdar::$userinfo['userid']); if (!$search) { $message->errorPermission(); @@ -95,7 +95,7 @@ if ($_POST['do'] == 'update') } else { - if (md5(md5($bugsys->in['validate']) . md5($bugsys->userinfo['salt'])) != $bugsys->userinfo['password']) + if (md5(md5($bugsys->in['validate']) . md5(bugdar::$userinfo['salt'])) != bugdar::$userinfo['password']) { $message->addError(T('Your authentication password does not match the one in our records')); } @@ -176,7 +176,7 @@ if ($_POST['do'] == 'update') { $userapi->update(); - $db->query("DELETE FROM " . TABLE_PREFIX . "useremail WHERE userid = " . $bugsys->userinfo['userid']); + $db->query("DELETE FROM " . TABLE_PREFIX . "useremail WHERE userid = " . bugdar::$userinfo['userid']); $bugsys->input_clean('emailopts', TYPE_INT); if (is_array($bugsys->in['emailopts'])) { @@ -190,7 +190,7 @@ if ($_POST['do'] == 'update') $bitmask += $option * $yes; } } - $db->query("INSERT INTO " . TABLE_PREFIX . "useremail (userid, relation, mask) VALUES (" . $bugsys->userinfo['userid'] . ", $relation, $bitmask)"); + $db->query("INSERT INTO " . TABLE_PREFIX . "useremail (userid, relation, mask) VALUES (" . bugdar::$userinfo['userid'] . ", $relation, $bitmask)"); } } @@ -205,7 +205,7 @@ if ($_REQUEST['do'] == 'modify') $langselect = construct_datastore_select('language', 'title', 'languageid', $userinfo['languageid']); $hidestatuses = construct_datastore_select('status', 'status', 'statusid', (!is_array($userinfo['hidestatuses']) ? explode(',', $userinfo['hidestatuses']) : $userinfo['hidestatuses']), 0); - $hidestatusesnum = (sizeof($bugsys->datastore['status']) < 8 ? sizeof($bugsys->datastore['status']) + 1 : 8); + $hidestatusesnum = (sizeof(bugdar::$datastore['status']) < 8 ? sizeof(bugdar::$datastore['status']) + 1 : 8); $defaultsortkey = construct_option_select('defaultsortkey', ListSorter::fetch_by_text(false), $userinfo['defaultsortkey']); $defaultsortas = construct_option_select('defaultsortas', ListSorter::fetch_as_text(false), $userinfo['defaultsortas']); @@ -219,7 +219,7 @@ if ($_REQUEST['do'] == 'modify') $checked = array(); if (!is_array($bugsys->in['emailopts'])) { - $options = $db->query("SELECT * FROM " . TABLE_PREFIX . "useremail WHERE userid = " . $bugsys->userinfo['userid']); + $options = $db->query("SELECT * FROM " . TABLE_PREFIX . "useremail WHERE userid = " . bugdar::$userinfo['userid']); while ($opt = $db->fetch_array($options)) { foreach ($bugsys->emailoptions['notifications'] AS $name => $notif) @@ -256,13 +256,13 @@ if ($_REQUEST['do'] == 'modify') { foreach (ListSorter::fetch_by_text(false) AS $column => $name) { - if (is_array($bugsys->userinfo['columnoptions'])) + if (is_array(bugdar::$userinfo['columnoptions'])) { - $columns["$column"] = $bugsys->userinfo['columnoptions']["$column"]; + $columns["$column"] = bugdar::$userinfo['columnoptions']["$column"]; } else { - $columns["$column"] = $bugsys->options['columnoptions']["$column"]; + $columns["$column"] = bugdar::$options['columnoptions']["$column"]; } eval('$columnOptions .= "' . $template->fetch('userctrl_column') . '";'); } @@ -278,7 +278,7 @@ if ($_REQUEST['do'] == 'modify') // searches $searches = ''; - $searchesFetch = $db->query("SELECT * FROM " . TABLE_PREFIX . "search WHERE name IS NOT NULL AND userid = " . $bugsys->userinfo['userid']); + $searchesFetch = $db->query("SELECT * FROM " . TABLE_PREFIX . "search WHERE name IS NOT NULL AND userid = " . bugdar::$userinfo['userid']); while ($search = $db->fetch_array($searchesFetch)) { eval('$searches .= "' . $template->fetch('userctrl_search') . '";'); diff --git a/vote.php b/vote.php index 7c35db3..91384a8 100644 --- a/vote.php +++ b/vote.php @@ -37,7 +37,7 @@ if (empty($_REQUEST['do'])) if ($_REQUEST['do'] == 'vote') { $bug = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid = " . $bugsys->input_clean('bugid', TYPE_UINT)); - $vote = $db->query_first("SELECT *, FIND_IN_SET(" . $bugsys->userinfo['userid'] . ", userids) AS uservote FROM " . TABLE_PREFIX . "vote WHERE bugid = $bug[bugid]"); + $vote = $db->query_first("SELECT *, FIND_IN_SET(" . bugdar::$userinfo['userid'] . ", userids) AS uservote FROM " . TABLE_PREFIX . "vote WHERE bugid = $bug[bugid]"); if (!check_bug_permissions($bug)) { @@ -61,15 +61,15 @@ if ($_REQUEST['do'] == 'vote') // handle userids $userids = $vote['userids']; - if ($bugsys->userinfo['userid']) + if (bugdar::$userinfo['userid']) { if (trim($vote['userids'])) { - $userids .= ',' . $bugsys->userinfo['userid']; + $userids .= ',' . bugdar::$userinfo['userid']; } else { - $userids = $bugsys->userinfo['userid']; + $userids = bugdar::$userinfo['userid']; } } -- 2.43.5