From 9e30d3fd7b40ace387a7ae31d465c12c782195dd Mon Sep 17 00:00:00 2001 From: Tony Murray Date: Mon, 14 May 2018 12:31:46 -0500 Subject: [PATCH] Fix some issues with globals (#8709) Some variables aren't global anymore. Make $vars global. --- html/includes/functions.inc.php | 1 - html/pages/bill.inc.php | 5 ++--- html/pages/bill/transfer.inc.php | 8 ++++---- includes/init.php | 3 +-- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/html/includes/functions.inc.php b/html/includes/functions.inc.php index 65a344366b..09b781805f 100644 --- a/html/includes/functions.inc.php +++ b/html/includes/functions.inc.php @@ -1575,7 +1575,6 @@ function get_disks_with_smart($device, $app_id) */ function get_dashboards($user_id = null) { - global $authorizer; $default = get_user_pref('dashboard'); $dashboards = dbFetchRows( "SELECT * FROM `dashboards` WHERE dashboards.access > 0 || dashboards.user_id = ?", diff --git a/html/pages/bill.inc.php b/html/pages/bill.inc.php index 73a3d2da5e..7e6434e049 100644 --- a/html/pages/bill.inc.php +++ b/html/pages/bill.inc.php @@ -66,9 +66,8 @@ if (bill_permitted($bill_id)) { $vars['view'] = 'quick'; } - function print_port_list() + function print_port_list($ports) { - global $ports; echo '

Billed Ports

@@ -150,7 +149,7 @@ if ($vars['view'] == 'edit' && Auth::user()->hasGlobalAdmin()) {
- +
diff --git a/html/pages/bill/transfer.inc.php b/html/pages/bill/transfer.inc.php index ffda5ce442..6beae31e37 100644 --- a/html/pages/bill/transfer.inc.php +++ b/html/pages/bill/transfer.inc.php @@ -87,7 +87,7 @@ function showPercent($per)
- +
@@ -141,8 +141,8 @@ function showPercent($per) - - + +
@@ -196,4 +196,4 @@ $mi .= "'>";
-
\ No newline at end of file +
diff --git a/includes/init.php b/includes/init.php index 9c25c66225..6a51d417a6 100644 --- a/includes/init.php +++ b/includes/init.php @@ -30,8 +30,7 @@ use LibreNMS\Authentication\Auth; use LibreNMS\Config; -global $config; -global $permissions; +global $config, $permissions, $vars; error_reporting(E_ERROR|E_PARSE|E_CORE_ERROR|E_COMPILE_ERROR); ini_set('display_errors', 1);