From f6cf581212230fbf40723f424ec23f80062716a3 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Wed, 17 Sep 2008 10:12:25 -0400 Subject: [PATCH] Removing uses of $bugsys --- global.php | 1 - includes/class_mo.php | 2 -- includes/class_sort.php | 2 -- includes/functions.php | 17 +---------------- includes/functions_product.php | 2 -- includes/init.php | 2 +- includes/language.php | 3 --- newreport.php | 2 +- search.php | 4 ++-- 9 files changed, 5 insertions(+), 30 deletions(-) diff --git a/global.php b/global.php index 86677eb..6b0afea 100755 --- a/global.php +++ b/global.php @@ -96,7 +96,6 @@ if (!(defined('NO_TEMPLATES') AND constant('NO_TEMPLATES') == true)) // create error reporter require_once('./includes/class_message_reporter.php'); $message = new MessageReporter(); -$bugsys->message = $message; /*=====================================================================*\ || ################################################################### diff --git a/includes/class_mo.php b/includes/class_mo.php index 17c24be..ca81a5a 100644 --- a/includes/class_mo.php +++ b/includes/class_mo.php @@ -108,8 +108,6 @@ class MOReader */ function _loadFile() { - global $bugsys; - $this->file = @fopen($this->filename, 'r'); if (!$this->file) { diff --git a/includes/class_sort.php b/includes/class_sort.php index e260c8d..94ad6c9 100644 --- a/includes/class_sort.php +++ b/includes/class_sort.php @@ -376,8 +376,6 @@ class ListSorter */ function constructRow($bug, $params = null) { - global $bugsys; - $this->_processColumns(); foreach ($this->columns as $columns) diff --git a/includes/functions.php b/includes/functions.php index 1d9f870..f9f5063 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -38,8 +38,6 @@ */ function construct_option_select($name, $array, $selected = 0, $valuekey = '', $labelkey = '', $includenil = false, $multiple = false) { - global $bugsys; - if ($multiple) { $selected = explode(',', $selected); @@ -99,8 +97,6 @@ function construct_user_display($userinfo, $html = true) // short-hand for bitwise & function can_perform($bitmask, $productid = 0, $userinfo = null) { - global $bugsys; - // masks that aren't product-specific static $inspecific = array( 'cansearch', @@ -167,8 +163,6 @@ function can_perform($bitmask, $productid = 0, $userinfo = null) */ function construct_datastore_select($datastore, $labelname, $valuename, $selectedvalue = 0, $includeblank = false, $adminmode = false) { - global $bugsys; - if ($adminmode) { global $admin; @@ -483,8 +477,6 @@ function process_custom_fields(&$bugapi, &$msg, $errorbox = false, $searchMode = // ####################### Start fetch_on_bits ####################### function fetch_on_bits($mask, $userinfo = null) { - global $bugsys; - if ($userinfo == null) { $userinfo =& bugdar::$userinfo; @@ -603,8 +595,6 @@ function fetch_help_link($topic) */ function fetch_guest_user() { - global $bugsys; - return array( 'usergroupid' => 1, 'groupids' => array(), @@ -633,7 +623,6 @@ function fetch_guest_user() */ function check_bug_permissions($bug, $userinfo = null) { - global $bugsys; if ($userinfo == null) { $userinfo = bugdar::$userinfo; @@ -692,9 +681,7 @@ function check_bug_permissions($bug, $userinfo = null) * @param array Bug array with data fit for display */ function ProcessBugDataForDisplay($bug, $color = '') -{ - global $bugsys; - +{ $bug['hiddendisplay'] = ($bug['hidden'] AND (can_perform('canviewhidden', $bug['product']) OR (can_perform('canviewownhidden') AND $bug['userid'] == bugdar::$userinfo['userid']))); $bug['bgcolor'] = (bugdar::$userinfo['showcolors'] ? bugdar::$datastore['status']["$bug[status]"]['color'] : $color); @@ -729,8 +716,6 @@ function ProcessBugDataForDisplay($bug, $color = '') */ function FetchUserPermissions(&$user) { - global $bugsys; - $perms = (int)bugdar::$datastore['usergroup']["$user[usergroupid]"]['permissions']; if (!is_array($user['groupids'])) { diff --git a/includes/functions_product.php b/includes/functions_product.php index f4feb30..643c16b 100644 --- a/includes/functions_product.php +++ b/includes/functions_product.php @@ -84,8 +84,6 @@ function construct_product_select($action = 'canviewbugs', $select = null, $obso */ function construct_version_select($productid, $select, $obsolete) { - global $bugsys; - $product = bugdar::$datastore['product']["$productid"]; $component = null; diff --git a/includes/init.php b/includes/init.php index f65826e..5783eae 100755 --- a/includes/init.php +++ b/includes/init.php @@ -128,7 +128,7 @@ $authMethod = ((defined('USE_DEFAULT_AUTH_METHOD') AND constant('USE_DEFAULT_AUT require_once('./includes/auth/auth_' . $authMethod . '.php'); $authClass = 'Authentication' . str_replace(' ', '', ucwords(str_replace('_', ' ', $authMethod))); -$bugsys->auth = $auth = new $authClass(); +$auth = new $authClass(); if ($auth->authenticateCookies()) { diff --git a/includes/language.php b/includes/language.php index 35e296c..0be1056 100644 --- a/includes/language.php +++ b/includes/language.php @@ -42,8 +42,6 @@ define('L_INVALID_ID', T('That is an invalid ID.')); // determines the user's language function fetch_user_language() { - global $bugsys; - if (bugdar::$userinfo['userid']) { $languageid = bugdar::$userinfo['languageid']; @@ -83,7 +81,6 @@ function fetch_user_language() */ function T($str) { - global $bugsys; static $mo; if (!bugdar::$options['devgettext']) diff --git a/newreport.php b/newreport.php index f343c42..db3008a 100755 --- a/newreport.php +++ b/newreport.php @@ -172,7 +172,7 @@ if ($_REQUEST['do'] == 'add') } // custom fields - $fields = construct_custom_fields($bugsys->in, true); + $fields = construct_custom_fields($input->in, true); $i = 0; foreach ($fields AS $field) { diff --git a/search.php b/search.php index 6014a6e..4a54301 100644 --- a/search.php +++ b/search.php @@ -231,7 +231,7 @@ if ($_REQUEST['do'] == 'process') { // force email or name?? make a distinction? // more elegant way to do this? probably - $user = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "user WHERE email LIKE '%" . str_replace('%', '\%', $bugsys->input_escape('reporter')) . "' OR displayname LIKE '%" . str_replace('%', '\%', $bugsys->input_escape('reporter')) . "%'"); + $user = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "user WHERE email LIKE '%" . str_replace('%', '\%', $input->inputEscape('reporter')) . "' OR displayname LIKE '%" . str_replace('%', '\%', $input->inputEscape('reporter')) . "%'"); if ($user['userid']) { $querybuild['reporter'] = "AND bug.userid = $user[userid] OR comment.userid = $user[userid]"; @@ -537,7 +537,7 @@ if ($_POST['do'] == 'doupdate') continue; } - $api = new BugApi($bugsys); + $api = new BugApi(); $api->set('bugid', $bug['bugid']); $api->values = $bug; -- 2.43.5