Allow deselecting of all Monitor IDS

pull/4202/head
Isaac Connor 2024-11-27 12:58:31 -05:00
parent 318ea39e94
commit 78badcbd07
1 changed files with 8 additions and 2 deletions

View File

@ -37,8 +37,14 @@ if ($action == 'Save') {
}
# 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 {