From c02b8402747f200b491a53d027699c4e428905b7 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Tue, 11 Oct 2016 12:10:47 -0400 Subject: [PATCH] Fix logic when disabling a monitor --- web/includes/actions.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web/includes/actions.php b/web/includes/actions.php index 7affee781..3fc6f80c8 100644 --- a/web/includes/actions.php +++ b/web/includes/actions.php @@ -338,7 +338,9 @@ if ( !empty($action) ) $monitor = dbFetchOne( "SELECT * FROM Monitors WHERE Id=?", NULL, array($mid) ); $newFunction = validStr($_REQUEST['newFunction']); - $newEnabled = isset( $_REQUEST['newEnabled'] ) and $_REQUEST['newEnabled'] != "1" ? "0" : "1"; + # Because we use a checkbox, it won't get passed in the request. So not being in _REQUEST means 0 + $newEnabled = ( !isset( $_REQUEST['newEnabled'] ) or $_REQUEST['newEnabled'] != '1' ) ? '0' : '1'; + $oldFunction = $monitor['Function']; $oldEnabled = $monitor['Enabled']; if ( $newFunction != $oldFunction || $newEnabled != $oldEnabled )