Change the big three $bugsys arrays to be a bugdar class
authorRobert Sesek <rsesek@bluestatic.org>
Wed, 25 Jun 2008 15:36:06 +0000 (11:36 -0400)
committerRobert Sesek <rsesek@bluestatic.org>
Wed, 25 Jun 2008 15:36:06 +0000 (11:36 -0400)
57 files changed:
admin/global.php
admin/index.php
admin/language.php
admin/setting.php
admin/user.php
admin/usergroup.php
attachment.php
docs/populate.php
editcomment.php
editreport.php
explain.php
favorite.php
global.php
help.php
includes/class_logging.php
includes/class_message_reporter.php
includes/class_sort.php
includes/functions.php
includes/functions_datastore.php
includes/functions_product.php
includes/init.php
includes/language.php
index.php
install/global.php
locale/en_US/emails/accountapproved.xml.tpl
locale/en_US/emails/activateaccount.xml.tpl
locale/en_US/emails/passwordreset.xml.tpl
locale/en_US/emails/welcome.xml.tpl
login.php
newreport.php
register.php
search.php
showhistory.php
showreport.php
syndicate.php
templates/explain_automation.tpl
templates/explain_product.tpl
templates/favorites.tpl
templates/header.tpl
templates/login.tpl
templates/lostpassword.tpl
templates/newreport.tpl
templates/passwordreset.tpl
templates/quicksearch.tpl
templates/register.tpl
templates/search.tpl
templates/search_results.tpl
templates/search_save.tpl
templates/search_update.tpl
templates/std_error.tpl
templates/std_message.tpl
templates/std_redirect.tpl
templates/trackerhome.tpl
templates/trackerhome_bits.tpl
templates/userctrl.tpl
userctrl.php
vote.php

index 89eacdfd7877e1c5e2dd96d8dc7b2be90dc369fb..5a0894c1f28479bd1e5e6613989430da4fc69a7a 100755 (executable)
@@ -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);
index 4375764e48da58d76adc2a9c6466289039cd621b..ea3a9062052f9307e52d5a64b755ae6a1a5413e8 100755 (executable)
@@ -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, '<version-check>') !== false)
        {
                $check = $bugsys->xml->parse($check);
                if (isset($check['version-check']['update']))
                {
-                       $admin->page_code('<div style="background-color: white; border-color: red; border-width: 2px; border-style: solid; color: red; padding: 4px"><div style="font-size: 18px; font-weight: bold">' . T('Update Avaliable') . ':</div>' . sprintf(T('Your installation of Bugdar is out-of-date. You are running version <strong>%1$s</strong> and the latest version is <strong>%2$s</strong>. You can download the update at <a href="http://www.bluestatic.org">Blue Static\'s website</a>. 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']) . '</div>');
+                       $admin->page_code('<div style="background-color: white; border-color: red; border-width: 2px; border-style: solid; color: red; padding: 4px"><div style="font-size: 18px; font-weight: bold">' . T('Update Avaliable') . ':</div>' . sprintf(T('Your installation of Bugdar is out-of-date. You are running version <strong>%1$s</strong> and the latest version is <strong>%2$s</strong>. You can download the update at <a href="http://www.bluestatic.org">Blue Static\'s website</a>. 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']) . '</div>');
                }
                else if (isset($check['version-check']['up-to-date']))
                {
-                       $admin->page_code('<div style="background-color: white; border-color: green; border-width: 2px; border-style: solid; color: green; padding: 4px"><div style="font-size: 18px; font-weight: bold">' . T('Up-to-Date') . ':</div>' . sprintf(T('Your installation of Bugdar is up-to-date. You are running version <strong>%1$s</strong>.'), $bugsys->options['trackerversion']) . '</div>');
+                       $admin->page_code('<div style="background-color: white; border-color: green; border-width: 2px; border-style: solid; color: green; padding: 4px"><div style="font-size: 18px; font-weight: bold">' . T('Up-to-Date') . ':</div>' . sprintf(T('Your installation of Bugdar is up-to-date. You are running version <strong>%1$s</strong>.'), bugdar::$options['trackerversion']) . '</div>');
                }
        }
 }
@@ -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");
index fdad1581267440bac1eb4f08969d130f2523fa35..237a902bcc445ffb08da772fbcc13b03297133bd 100644 (file)
@@ -176,7 +176,7 @@ if ($_REQUEST['do'] == 'modify')
                $admin->row_multi_item(array(
                        "<a href=\"language.php?do=edit&amp;languageid=$language[languageid]\">$language[title]</a>" => 'l',
                        $language['langcode'] . ' / ' . $language['charset'] => 'c',
-                       (($bugsys->options['defaultlanguage'] == $language['languageid']) ? '<strong>' . T('DEFAULT LANGUAGE') . '</strong> / ' : '') . ($language['userselect'] ? T('User Selectable') : T('Private')) => 'c'
+                       ((bugdar::$options['defaultlanguage'] == $language['languageid']) ? '<strong>' . T('DEFAULT LANGUAGE') . '</strong> / ' : '') . ($language['userselect'] ? T('User Selectable') : T('Private')) => 'c'
                ));
        }
        
index 359e2783fddea527300d4b5b08aabe8ac2f74787..07982d6c727051a7fa3afc7cdb5780445e8f2c94 100755 (executable)
@@ -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 <em>yes</em>, then new users will be allowed to register.'), 'setting[allownewreg]', $bugsys->options['allownewreg']);
+       $admin->row_yesno(T('If this is set to <em>yes</em>, 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 <em>yes</em> will send each new verified user a welcome email.'), 'setting[sendwelcomemail]', $bugsys->options['sendwelcomemail']);
+       $admin->row_yesno(T('Setting this option to <em>yes</em> 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. <strong>Be sure that this does not end in a trailing slash (&quot;/&quot;).</strong><br />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. <strong>Be sure that this does not end in a trailing slash (&quot;/&quot;).</strong><br />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 <em>yes</em> if you want to allow users to post raw HTML in their bug reports. This is <strong>very</strong> dangerous and it is not recommended.'), 'setting[allowhtml]', $bugsys->options['allowhtml']);
+       $admin->row_yesno(T('Set this to <em>yes</em> if you want to allow users to post raw HTML in their bug reports. This is <strong>very</strong> 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 <em>Not Selected</em>.'), 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 <em>Not Selected</em>.'), 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 = '<table cellspacing="2" cellpadding="1" border="0">';
        foreach (ListSorter::fetch_by_text(false, false) AS $column => $name)
index a2d9a0e15c62022ee09e3de6764012eb81ee8d79..1995f96e899c7b2af510aa18bef736b72491f631 100644 (file)
@@ -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']));       
        
index 7cefd891cc50d9c982f805252673890f91d6c707..45dac27d46f9578e9fb7b5282174e9e8d9c3a402 100755 (executable)
@@ -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(
                        '<a href="user.php?do=edit&amp;userid=' . $user['userid'] . '">' . $user['email'] . '</a>' => 'l',
-                       $bugsys->datastore['usergroup']["$user[usergroupid]"]['title'] => 'c',
+                       bugdar::$datastore['usergroup']["$user[usergroupid]"]['title'] => 'c',
                        '<input name="approve[' . $user['userid'] . ']" type="checkbox" value="1" />' => 'c'                    
                ));
        }
index 3406c8d1e40f06616843b51a01d6a251141d845f..8392b487993bdd519def7b0545e73c6f6f2cffdd 100755 (executable)
@@ -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();
        }
index df0c02bb2f8941638930a42a307fce402e9d8643..8aede923b9baf71dfc0a20266c8b34fb6223160f 100644 (file)
@@ -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();
 }
 
index 2dbf56e4893130f489b79f5df8a3f631aef78bb9..dd7c0e33399653d27fce38ecfc3e94a2186a3daf 100644 (file)
@@ -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);
index fe2734760dcc59452479afba78d988eb85bb0122..4da9a13afbb7e27150282dde89e3f25f6ca1da35 100644 (file)
@@ -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']);
index 1e130998126c38f176fd7e76e4fb7b99d47ed0a8..5c53d9677abf9dcb21d8872f5129c16a8048785b 100644 (file)
@@ -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') . '";');
                                }
                        }
index b9a59513910158d26ce7f16da1afeb46dae4cf81..c10f6e76bbe8d3639bd3487f8ebb3fb9727b7c72 100644 (file)
@@ -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)
index 20cfa8aeca3673c21f6b3041e14b0ecba3bf5234..76fcbbf846dc8d8653e79d6bfcfe45647bd3f746 100755 (executable)
@@ -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'),
index c22ba31dce5225e6c673509bd3f15d0b33d95deb..def80dca8cce67118fcba1a4ac2b38d523ea8a5c 100644 (file)
--- 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']);
 }
 
index 28d7d88b4f682547a4dde18edcc476e2819d72cb..8ba38224238beee841321b6f1a8839fbebe399d5 100644 (file)
@@ -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']) . "'
                                )
index 8473bb840ec41bbd6d922b569ec436cb6ed60798..8ddedf93a0cd18ef9b4b79ef7c69a41d2ecd7dec 100755 (executable)
@@ -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;
index 25d7f9e9df24d38f82281a30998fe897bd5720ec..4b02369b9da8eb2161ff32a9985d7bdfa3c3ac12 100644 (file)
@@ -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)
                        ");
                }
index 3da78edd0b4dfbc978d95e3373f7165cc5285baf..73a812dbd3cc1e1ffec5b4b347380628a5a469ec 100755 (executable)
@@ -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;
index c51a1761c3caeb93e484f6c02c3d62914aa200cb..13ba2ca95eeb8675b4a69bd2597eb002c9fb23d1 100755 (executable)
@@ -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;
 }
 
 /*=====================================================================*\
index a6a31960f08bfed4c31f36f17bfe05998182503e..21b54f9b4a81d68173a7ede96bb0cbd7ccc54cd6 100644 (file)
@@ -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)))
                {
index 6ad0f8a33c512f0ac90717cbcc6bd42380e8988a..2640ab63d9050fa9b07461da03c638a8df3339a3 100755 (executable)
@@ -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);
 
 /*=====================================================================*\
 || ###################################################################
index e808ca9efc37805891ea6bc298925bd21eff3d52..c99350f4afe3966436377d7d9f2a9277c3fcc3ce 100644 (file)
@@ -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);
        }
index 9181c6ca51dbb168358149d539c112b57310f153..a70099cec72fa07722ca9ab355d87a003c4fdce8 100644 (file)
--- 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'])
index c0f29509247eadf0fc8787a3a9a75d165a161d65..554bf2ac7e1fdb7e6c074bee75665252b264c3f0 100644 (file)
@@ -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();
 
 // ###################################################################
 
index d60908c2d451beb2fa03fe2861029524c1c2604d..fd81c9bf45f28c40d411700eaa24190437334ffd 100644 (file)
@@ -1,8 +1,8 @@
 <email>
-       <subject>Account Approved at {$bugsys->options['trackertitle']}</subject>
+       <subject>Account Approved at {bugdar::$options['trackertitle']}</subject>
        <bodyText>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.</bodyText>
 </email>
\ No newline at end of file
index e1f2673696853a244a095fb79e589afaaa38ad21..1ff638d5fc676b58e52894c1c24c8f9124696556 100644 (file)
@@ -1,8 +1,8 @@
 <email>
-       <subject>Welcome to {$bugsys->options['trackertitle']}</subject>
+       <subject>Welcome to {bugdar::$options['trackertitle']}</subject>
        <bodyText>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&amp;userid=$userid&amp;activator=$activationid</bodyText>
+{bugdar::$options['trackerurl']}/register.php?do=activate&amp;userid=$userid&amp;activator=$activationid</bodyText>
 </email>
\ No newline at end of file
index eab2f01155e11206bd49cae9bcf099e4533b360a..988f40a96d6d3c617c3a005e477c41b783858eda 100644 (file)
@@ -1,10 +1,10 @@
 <email>
-       <subject>{$bugsys->options['trackertitle']} Password Reset</subject>
+       <subject>{bugdar::$options['trackertitle']} Password Reset</subject>
        <bodyText>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&amp;activator=$activator
+{bugdar::$options['trackerurl']}/login.php?do=recoverpw&amp;activator=$activator
 
 If you did not request this, do not worry as this notice will expire in 24 hours.</bodyText>
 </email>
\ No newline at end of file
index 494779a3c798e184b1b036e9587407ad2ae34a52..71930bd472d4f4db0388ab1df5ab8549de7a26b8 100644 (file)
@@ -1,8 +1,8 @@
 <email>
-       <subject>Welcome to {$bugsys->options['trackertitle']}</subject>
+       <subject>Welcome to {bugdar::$options['trackertitle']}</subject>
        <bodyText>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.</bodyText>
 </email>
\ No newline at end of file
index e1e54b518405aef40ba5de51b61f716ae4740248..c63ab96e6ee33b757f3eff77a723ff62c470fa87 100755 (executable)
--- 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']);
index 5255a561189058b3c195e6453b96c11db4be6801..541c1a7efae41106867fd32fc74831a876012960 100755 (executable)
@@ -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') . '");');
 }
index c849890e122ec25d260812c4061fab8a79613817..6c6db55ec240ec9d077d297bde8f7d1374e83949 100755 (executable)
@@ -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']);
index e22c3b6bb79a2e5c3868db4deac12a955b66db6b..a56c28a09115e939bb1856b717550103e0a68317 100644 (file)
@@ -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 = '<?xml version="1.0" encoding="' . $language['charset'] . '"?>
 
-<bugdarExport user="' . $bugsys->unsanitize(construct_user_display($bugsys->userinfo, false)) . '" date="' . $datef->format('r', TIMENOW) . '" searchid="' . $search['searchid'] . '">';
+<bugdarExport user="' . $bugsys->unsanitize(construct_user_display(bugdar::$userinfo, false)) . '" date="' . $datef->format('r', TIMENOW) . '" searchid="' . $search['searchid'] . '">';
 
        while ($bug = $db->fetch_array($bugs))
        {
@@ -617,7 +617,7 @@ if ($_REQUEST['do'] == 'export')
                $xml .= "\n\t\t<status>" . $bug['status'] . "</status>";
                if ($bug['assignedto'])
                {
-                       $xml .= "\n\t\t<assignedTo>" . construct_user_display($bugsys->datastore['assignto']["$bug[assignedto]"], false) . "</assignedTo>";
+                       $xml .= "\n\t\t<assignedTo>" . construct_user_display(bugdar::$datastore['assignto']["$bug[assignedto]"], false) . "</assignedTo>";
                }
                $xml .= "\n\t\t<resolution>" . $bug['resolution'] . "</resolution>";
                $xml .= "\n\t\t<severity>" . $bug['severity'] . "</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 = '';
index ebef405970a74726972d56001c0f378d5a2d5f1e..de31c515a4475083cd8885af244c1a86b24b5fb1 100644 (file)
@@ -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')
                        {
index 7119bad73d9555c2e4f960d6b12f504ef59ffb8a..befc103fe7fd739f1643e225efa7e71fbdb6926d 100644 (file)
@@ -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))
index 0f0329bbb9c35e0e6eac4f448a09e0362df95cf1..a9febca7b446b03c631aab5ce09ec7f4d251f692 100644 (file)
@@ -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))
                        </tr>
                        <tr>
                                <td><strong>' . T('Product/Component/Version') . ':</strong></td>
-                               <td>' . $bugsys->datastore['product']["$bug[product]"]['title'] . '/' . (($bug['component']) ? $bugsys->datastore['product']["$bug[component]"]['title'] . '/' : '') . $bugsys->datastore['version']["$bug[version]"]['version'] . '</td>
+                               <td>' . bugdar::$datastore['product']["$bug[product]"]['title'] . '/' . (($bug['component']) ? bugdar::$datastore['product']["$bug[component]"]['title'] . '/' : '') . bugdar::$datastore['version']["$bug[version]"]['version'] . '</td>
                        </tr>
                        <tr>
                                <td><strong>' . T('Status') . ':</strong></td>
-                               <td>' . $bugsys->datastore['status']["$bug[status]"]['status'] . '</td>
+                               <td>' . bugdar::$datastore['status']["$bug[status]"]['status'] . '</td>
                        </tr>
                        <tr>
                                <td><strong>' . T('Severity') . ':</strong></td>
-                               <td>' . $bugsys->datastore['severity']["$bug[severity]"]['severity'] . '</td>
+                               <td>' . bugdar::$datastore['severity']["$bug[severity]"]['severity'] . '</td>
                        </table>
                        
                        <p>' . $bug['comment_parsed'] . '</p>') . '
                </content>
                <summary type="text">' . htmlspecialchars($bug['comment_parsed']) . '</summary>
-               <link rel="alternate" href="' . $bugsys->options['trackerurl'] . '/showreport.php?bugid=' . $bug['bugid'] . '"/>
+               <link rel="alternate" href="' . bugdar::$options['trackerurl'] . '/showreport.php?bugid=' . $bug['bugid'] . '"/>
        </entry>';
        
        $lastupdated = $bug["$timestamp"];
@@ -91,8 +91,8 @@ while ($bug = $db->fetch_array($bugs_fetch))
 echo '<?xml version="1.0" encoding="' . $language['charset'] . '"?>
 <feed xmlns="http://www.w3.org/2005/Atom">
 
-       <title>' . sprintf(T('%1$s Syndication Feed'), $bugsys->options['trackertitle']) . '</title>
-       <link href="' . $bugsys->options['trackerurl'] . '"/>
+       <title>' . sprintf(T('%1$s Syndication Feed'), bugdar::$options['trackertitle']) . '</title>
+       <link href="' . bugdar::$options['trackerurl'] . '"/>
        <updated>' . gmdate('Y-m-d\TH:i:s\Z', $lastupdated) . '</updated>
        
        <!-- entries -->
index 90fb8684791a2229d399fac27e08343559b6f35f..79029e867a0905fd9e310822254a4dfb3be480de 100644 (file)
@@ -2,7 +2,7 @@ $doctype
 <html xmlns="http://www.w3.org/1999/xhtml" lang="$stylevar[lang]" xml:lang="$stylevar[lang]" dir="$stylevar[lang_dir]">
 <head>
 $headinclude
-       <title>{$bugsys->options['trackertitle']} - {@"Automations"}</title>
+       <title>{bugdar::$options['trackertitle']} - {@"Automations"}</title>
 </head>
 
 <body>
index cc841b4fcfcc869e4c390fafe54989379ccc084b..ce78cb4c27528533d2e7aca0864a9fc0f34bb9c3 100644 (file)
@@ -2,7 +2,7 @@ $doctype
 <html xmlns="http://www.w3.org/1999/xhtml" lang="$stylevar[lang]" xml:lang="$stylevar[lang]" dir="$stylevar[lang_dir]">
 <head>
 $headinclude
-       <title>{$bugsys->options['trackertitle']} - {@"Products"}</title>
+       <title>{bugdar::$options['trackertitle']} - {@"Products"}</title>
 </head>
 
 <body>
index 36e92349b9138b91f48655d25e698cc9ff403559..b2505aa2ab21bd81144d54d27f8f10267084434d 100644 (file)
@@ -2,7 +2,7 @@ $doctype
 <html xmlns="http://www.w3.org/1999/xhtml" lang="$stylevar[lang]" xml:lang="$stylevar[lang]" dir="$stylevar[lang_dir]">
 <head>
 $headinclude
-       <title>{$bugsys->options['trackertitle']} - {@"My Favorite Bugs"}</title>
+       <title>{bugdar::$options['trackertitle']} - {@"My Favorite Bugs"}</title>
 </head>
 
 <body>
index 9f561074957eb25caa1fe7c54b916170a36d1002..0151efb267c8ba24065dd2c0c8b8bd6ea657465c 100644 (file)
@@ -6,13 +6,13 @@
        </form>
        <!-- / quick search -->
        
-       <span id="title"><a href="index.php">{$bugsys->options['trackertitle']}</a></span>
+       <span id="title"><a href="index.php">{bugdar::$options['trackertitle']}</a></span>
        &nbsp;
        <img src="templates/images/clock.gif" alt="{@"Current Date and Time"}" />
        <span id="time">$datetime</span>
 </div>
 
-<if condition="!$bugsys->userinfo['userid']">
+<if condition="!bugdar::$userinfo['userid']">
 <div class="alertbox">
        {@"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 <a href="register.php">Register</a> tab at the top. If you are already registered, you can login at the <a href="login.php">Login</a> tab."}
 </div>
        <if condition="$show['search']">
                <a class="tab$focus[search]" href="search.php">{@"Search"}</a>
        </if>
-       <if condition="$bugsys->userinfo['userid']">
+       <if condition="bugdar::$userinfo['userid']">
                <a class="tab$focus[favorites]" href="favorite.php">{@"Favorites"}</a>
        </if>
-       <a class="tab$focus[user]" href="<if condition="$bugsys->userinfo['userid']">userctrl.php">{@"Options"}<else />login.php">{@"Login/Register"}</if></a>
+       <a class="tab$focus[user]" href="<if condition="bugdar::$userinfo['userid']">userctrl.php">{@"Options"}<else />login.php">{@"Login/Register"}</if></a>
        <if condition="$show['admin']">
                <a class="tab" href="admin/index.php">{@"Administration"}</a>
        </if>
-       <if condition="$bugsys->userinfo['userid']">
+       <if condition="bugdar::$userinfo['userid']">
                <a class="tab$focus[logout]" href="login.php?do=logout" onclick="return confirm('{@"Are you sure you want to log out?"}')">{@"Logout"}</a>
        </if>
 </div>
index 17840a2f406d5cc21a6de7db05ca464145c54ee4..747b9f892a3fd17f8bea7eef8ff5edbb51ff11d3 100644 (file)
@@ -3,7 +3,7 @@ $doctype
 <head>
 $headinclude
        <link rel="stylesheet" type="text/css" href="templates/box.css" media="screen" />
-       <title>{$bugsys->options['trackertitle']} - {@"Login"}</title>
+       <title>{bugdar::$options['trackertitle']} - {@"Login"}</title>
 </head>
 
 <body>
index 9694a9fbd360aec078b26a78913446b13c7ed22b..2e6db040002bdbb8c1c569697b09b2261b0134b9 100644 (file)
@@ -3,7 +3,7 @@ $doctype
 <head>
 $headinclude
        <link rel="stylesheet" type="text/css" href="templates/box.css" media="screen" />
-       <title>{$bugsys->options['trackertitle']} - {@"Lost Password"}</title>
+       <title>{bugdar::$options['trackertitle']} - {@"Lost Password"}</title>
 </head>
 
 <body>
index 61c8801a377f1d796f5d87842284fea692c2786b..02afa560d664675aa00f23eaae53847902eaaa57 100644 (file)
@@ -4,7 +4,7 @@ $doctype
 $headinclude
        <link rel="stylesheet" type="text/css" href="templates/report.css" media="screen" />
        <link rel="stylesheet" type="text/css" href="templates/fields.css" media="screen" />
-       <title>{@"New Bug Report"} - {$bugsys->options['trackertitle']}</title>
+       <title>{@"New Bug Report"} - {bugdar::$options['trackertitle']}</title>
 </head>
 
 <body>
@@ -110,7 +110,7 @@ $header
        <fieldset>
                <legend>{@"Description/Initial Report"}</legend>
 
-               <textarea name="comment" cols="50" rows="10" class="textarea"><if condition="$bugsys->in['comment']">{$bugsys->in['comment']}<else />{$bugsys->options['defaultcomment']}</if></textarea>
+               <textarea name="comment" cols="50" rows="10" class="textarea"><if condition="$bugsys->in['comment']">{$bugsys->in['comment']}<else />{bugdar::$options['defaultcomment']}</if></textarea>
 
                <div><input type="checkbox" name="parselinks" value="1"<if condition="$bugsys->in['parselinks']"> checked="checked"</if> /> {@"Parse Links in the Comment"}</div>
        </fieldset>
index 7ce3eb2dfd1a90c6f4666e337e8e7fa374367b3f..a21052fc8c7927261230c4706fa23159edfb3653 100644 (file)
@@ -3,7 +3,7 @@ $doctype
 <head>
 $headinclude
        <link rel="stylesheet" type="text/css" href="templates/box.css" media="screen" />
-       <title>{$bugsys->options['trackertitle']} - {@"Reset Password"}</title>
+       <title>{bugdar::$options['trackertitle']} - {@"Reset Password"}</title>
 </head>
 
 <body>
index 4c6cdd153bd0517ce26dc1374e98bd6e1bf5cce6..c38fb43738b511c4cdd0a80228be8b096c78051a 100644 (file)
@@ -3,7 +3,7 @@ $doctype
 <head>
 $headinclude
        <link rel="stylesheet" type="text/css" href="templates/box.css" media="screen" />
-       <title>{$bugsys->options['trackertitle']} - {@"Quick Search"}</title>
+       <title>{bugdar::$options['trackertitle']} - {@"Quick Search"}</title>
 </head>
 
 <body>
index 5eec07477a0de0dab556c511118ffeb510d5482c..df88eca34bfc24c591216cc06bf79b06a14dff57 100644 (file)
@@ -3,7 +3,7 @@ $doctype
 <head>
 $headinclude
        <link rel="stylesheet" type="text/css" href="templates/box.css" media="screen" />
-       <title>{$bugsys->options['trackertitle']} - {@"Register"}</title>
+       <title>{bugdar::$options['trackertitle']} - {@"Register"}</title>
 </head>
 
 <body>
index bbfcbc113126c02ece02a504dfa2763968a1e248..6f0e45c251586113aba6d58d538951ed3a06fd32 100644 (file)
@@ -4,7 +4,7 @@ $doctype
 $headinclude
        <link rel="stylesheet" type="text/css" href="templates/report.css" media="screen" />
        <link rel="stylesheet" type="text/css" href="templates/fields.css" media="screen" />
-       <title>{$bugsys->options['trackertitle']} - {@"Search"}</title>
+       <title>{bugdar::$options['trackertitle']} - {@"Search"}</title>
 </head>
 
 <body>
@@ -147,7 +147,7 @@ $header
                </fieldset>
                <!-- / severity -->
 
-               <if condition="$bugsys->userinfo['userid']">
+               <if condition="bugdar::$userinfo['userid']">
                <!-- favorite -->
                <fieldset>
                        <legend>{@"Favorite"}</legend>
index a7e730d386037802e2c8b78ac318bb962dd551ee..52ea77a2f6127b0bba0c5216dea1c9aa32b08225 100644 (file)
@@ -2,7 +2,7 @@ $doctype
 <html xmlns="http://www.w3.org/1999/xhtml" lang="$stylevar[lang]" xml:lang="$stylevar[lang]" dir="$stylevar[lang_dir]">
 <head>
 $headinclude
-       <title>{$bugsys->options['trackertitle']} - {@"Search Results"}</title>
+       <title>{bugdar::$options['trackertitle']} - {@"Search Results"}</title>
 </head>
 
 <body>
index fe2092107eb55698a6d4e1a877bf91742677dc5f..acc09fd3c5e89274be8456924301893934893dd9 100644 (file)
@@ -3,7 +3,7 @@ $doctype
 <head>
 $headinclude
        <link rel="stylesheet" type="text/css" href="templates/box.css" media="screen" />
-       <title>{$bugsys->options['trackertitle']} - {@"Save Search"}</title>
+       <title>{bugdar::$options['trackertitle']} - {@"Save Search"}</title>
 </head>
 
 <body>
index 5fbcc9c176a7e23e6de820af66419920ea17b870..0f8cf1b8a8b17dc3b43164b51c997a44bde35c9f 100644 (file)
@@ -4,7 +4,7 @@ $doctype
 $headinclude
        <link rel="stylesheet" type="text/css" href="templates/report.css" media="screen" />
        <link rel="stylesheet" type="text/css" href="templates/fields.css" media="screen" />
-       <title>{$bugsys->options['trackertitle']} - {@"Mass Update"}</title>
+       <title>{bugdar::$options['trackertitle']} - {@"Mass Update"}</title>
 </head>
 
 <body>
@@ -71,7 +71,7 @@ $header
                </fieldset>
                <!-- / severity -->
 
-               <if condition="$bugsys->userinfo['userid']">
+               <if condition="bugdar::$userinfo['userid']">
                <!-- favorite -->
                <fieldset>
                        <legend>{@"Favorite"}</legend>
index d821a31ad78532a14b58f322ea1fe1fd2f10ecca..ef99bd22c2b2c99a7b1c8618f6b575bd08906d27 100644 (file)
@@ -3,7 +3,7 @@ $doctype
 <head>
 $headinclude
        <link rel="stylesheet" type="text/css" href="templates/box.css" media="screen" />
-       <title>{$bugsys->options['trackertitle']} - {@"Error"}</title>
+       <title>{bugdar::$options['trackertitle']} - {@"Error"}</title>
 </head>
 
 <body>
index 1b7afaa4ce7e2ca28edfe808b7c340c00c1e619f..c797ccb4d5e89e3a1d1032188803e8b4e0fdd741 100644 (file)
@@ -3,7 +3,7 @@ $doctype
 <head>
 $headinclude
        <link rel="stylesheet" type="text/css" href="templates/box.css" media="screen" />
-       <title>{$bugsys->options['trackertitle']} - <if condition="$show['confirm']">{@"Confirm"}<else />{@"Notice"}</if></title>
+       <title>{bugdar::$options['trackertitle']} - <if condition="$show['confirm']">{@"Confirm"}<else />{@"Notice"}</if></title>
 </head>
 
 <body>
index 22276f5b851b0d2ccd0217565917e63cb4835bbf..78b781e0d804357a67ce4ad195439db093557301 100644 (file)
@@ -4,7 +4,7 @@ $doctype
 $headinclude
        <link rel="stylesheet" type="text/css" href="templates/box.css" media="screen" />
        <meta http-equiv="refresh" content="2; url=$url" />
-       <title>{$bugsys->options['trackertitle']} - {@"Redirect..."}</title>
+       <title>{bugdar::$options['trackertitle']} - {@"Redirect..."}</title>
 </head>
 
 <body>
index f446a41ad3c541e167a6213337a3e6f6ddd59018..505067e377d81cdfa7d84e2c3c40bcac953a1129 100644 (file)
@@ -2,7 +2,7 @@ $doctype
 <html xmlns="http://www.w3.org/1999/xhtml" lang="$stylevar[lang]" xml:lang="$stylevar[lang]" dir="$stylevar[lang_dir]">
 <head>
 $headinclude
-       <title>{$bugsys->options['trackertitle']} - {@"Bug Listing"}</title>
+       <title>{bugdar::$options['trackertitle']} - {@"Bug Listing"}</title>
 </head>
 
 <body>
index 5ec5db5a13fcec4310688db9133f27f7d9aa7ca3..fbf436e9745456d2157c90d74153e013bc30daa8 100644 (file)
@@ -1,6 +1,6 @@
 
 <!-- bug $bug[bugid] -->
-<tr<if condition="$bugsys->userinfo['showcolors']"> style="background-color: $bug[bgcolor]<if condition="$bug['hidden']">; font-style: italic</if>"<else /> class="$bug[bgcolor]"<if condition="$bug['hidden']"> style="font-style: italic"</if></if>>
+<tr<if condition="bugdar::$userinfo['showcolors']"> style="background-color: $bug[bgcolor]<if condition="$bug['hidden']">; font-style: italic</if>"<else /> class="$bug[bgcolor]"<if condition="$bug['hidden']"> style="font-style: italic"</if></if>>
 $fields
 </tr>
 <!-- / bug $bug[bugid] -->
index 8c4fc62bc257fc17a27cc3307a9861fbfc83367e..5f1e2a1cfefe90561c089cc8be11cbf38471635f 100644 (file)
@@ -4,7 +4,7 @@ $doctype
 $headinclude
        <link rel="stylesheet" type="text/css" href="templates/box.css" media="screen" />
        <link rel="stylesheet" type="text/css" href="templates/fields.css" media="screen" />
-       <title>{$bugsys->options['trackertitle']} - {@"User Options"}</title>
+       <title>{bugdar::$options['trackertitle']} - {@"User Options"}</title>
 </head>
 
 <body>
@@ -29,7 +29,7 @@ $header
                                <div class="box-head" style="text-align: $stylevar[left]">{@"User Options"}</div>
 
                                <div class="box-mid">
-                                       <if condition="$bugsys->options['authmethod'] == 'default'">
+                                       <if condition="bugdar::$options['authmethod'] == 'default'">
                                        <fieldset>
                                                <legend>{@"Display Name"}</legend>
                                                <input type="text" name="displayname" value="{$userinfo['displayname']}" size="25" style="width: 100%" maxlength="250" />
@@ -158,7 +158,7 @@ $header
                </td>
 
                <td>
-                       <if condition="$bugsys->options['authmethod'] == 'default'">
+                       <if condition="bugdar::$options['authmethod'] == 'default'">
                        <!-- password and email -->
                        <div class="box">
                                <div class="box-head" style="text-align: $stylevar[left]">
index 100e17fd04f49a91a08befdcbac0294926e15ee5..878b5fc39358fdc4d51271f084d8975e13d9297c 100644 (file)
@@ -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') . '";');
index 7c35db3db0caa8ccfe5c6ec04f79aead61d640ad..91384a80b51000cefa4f5b78a78e5b60335e0225 100644 (file)
--- 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'];
                }
        }