From 78badcbd07d684a39b2b2be834247a51ddabd4b3 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Wed, 27 Nov 2024 12:58:31 -0500 Subject: [PATCH] Allow deselecting of all Monitor IDS --- web/includes/actions/user.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/web/includes/actions/user.php b/web/includes/actions/user.php index 75bcf3f7f6..73a9104ed8 100644 --- a/web/includes/actions/user.php +++ b/web/includes/actions/user.php @@ -37,8 +37,14 @@ } # What other tests should we do? - if (isset($_REQUEST['newUser']['MonitorIds']) and is_array($_REQUEST['newUser']['MonitorIds'])) - $_REQUEST['newUser']['MonitorIds'] = implode(',', $_REQUEST['newUser']['MonitorIds']); + if (isset($_REQUEST['newUser']['MonitorIds'])) { + if (is_array($_REQUEST['newUser']['MonitorIds'])) { + $_REQUEST['newUser']['MonitorIds'] = implode(',', $_REQUEST['newUser']['MonitorIds']); + } + } else { + # If nothing is selected, it won't exist in _REQUEST + $_REQUEST['newUser']['MonitorIds'] = ''; + } if (!empty($_REQUEST['newUser']['Password'])) { $_REQUEST['newUser']['Password'] = password_hash($_REQUEST['newUser']['Password'], PASSWORD_BCRYPT); } else {