Skip to content

Commit

Permalink
Allow deselecting of all Monitor IDS
Browse files Browse the repository at this point in the history
  • Loading branch information
Isaac Connor committed Nov 27, 2024
1 parent 318ea39 commit 78badcb
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions web/includes/actions/user.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 78badcb

Please sign in to comment.