From c8664fabda57063299d18a3fab205580d7825c96 Mon Sep 17 00:00:00 2001 From: Skylar Ittner Date: Wed, 11 Jul 2018 00:18:39 -0600 Subject: [PATCH] Fix undefined variable warnings --- lib/getjobhistorytable.php | 2 +- lib/getpunchtable.php | 2 +- lib/getshifttable.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/getjobhistorytable.php b/lib/getjobhistorytable.php index 8357a63..f5f94f8 100644 --- a/lib/getjobhistorytable.php +++ b/lib/getjobhistorytable.php @@ -14,7 +14,7 @@ require_once __DIR__ . "/login.php"; require_once __DIR__ . "/userinfo.php"; $account_is_admin = account_has_permission($_SESSION['username'], "QWIKCLOCK_ADMIN"); -$showmanaged = ($VARS['show_all'] == 1 && (account_has_permission($_SESSION['username'], "QWIKCLOCK_MANAGE") || $account_is_admin)); +$showmanaged = (!empty($VARS['show_all']) && $VARS['show_all'] == 1 && (account_has_permission($_SESSION['username'], "QWIKCLOCK_MANAGE") || $account_is_admin)); $managed_uids = []; $managed_uids[] = $_SESSION['uid']; if ($showmanaged) { diff --git a/lib/getpunchtable.php b/lib/getpunchtable.php index 2e5f930..8697a78 100644 --- a/lib/getpunchtable.php +++ b/lib/getpunchtable.php @@ -14,7 +14,7 @@ require_once __DIR__ . "/login.php"; require_once __DIR__ . "/userinfo.php"; $account_is_admin = account_has_permission($_SESSION['username'], "QWIKCLOCK_ADMIN"); -$showmanaged = ($VARS['show_all'] == 1 && (account_has_permission($_SESSION['username'], "QWIKCLOCK_MANAGE") || $account_is_admin)); +$showmanaged = (!empty($VARS['show_all']) && $VARS['show_all'] == 1 && (account_has_permission($_SESSION['username'], "QWIKCLOCK_MANAGE") || $account_is_admin)); $managed_uids = []; $managed_uids[] = $_SESSION['uid']; if ($showmanaged) { diff --git a/lib/getshifttable.php b/lib/getshifttable.php index fd5ef10..df079cb 100644 --- a/lib/getshifttable.php +++ b/lib/getshifttable.php @@ -14,7 +14,7 @@ header("Content-Type: application/json"); require_once __DIR__ . "/login.php"; require_once __DIR__ . "/userinfo.php"; -$showall = ($VARS['show_all'] == 1); // && account_has_permission($_SESSION['username'], "QWIKCLOCK_MANAGE")); +$showall = (!empty($VARS['show_all']) && $VARS['show_all'] == 1); // && account_has_permission($_SESSION['username'], "QWIKCLOCK_MANAGE")); $showmanaged = false; $managed_uids = [];