From aa7ba44ed902d0f922ecd67d81870fb578c775cc Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Tue, 29 Sep 2020 16:48:22 -0400 Subject: [PATCH] Use ->zmaControl instead of invalid zmaControl(). the old zmaControl takes a mid, not a monitor object --- web/includes/actions/function.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/web/includes/actions/function.php b/web/includes/actions/function.php index 9667b8c24..0a1569a01 100644 --- a/web/includes/actions/function.php +++ b/web/includes/actions/function.php @@ -32,7 +32,7 @@ if ( !canEdit('Monitors', $mid) ) { if ( $action == 'function' ) { $monitor = new ZM\Monitor($mid); - if ( !$monitor ) { + if ( !$monitor->Id() ) { ZM\Error("Monitor not found with Id=$mid"); return; } @@ -46,10 +46,10 @@ if ( $action == 'function' ) { $monitor->save(array('Function'=>$newFunction, 'Enabled'=>$newEnabled)); if ( daemonCheck() && ($monitor->Type() != 'WebSite') ) { - zmaControl($monitor, 'stop'); - zmcControl($monitor, ($newFunction != 'None') ? 'restart' : 'stop'); + $monitor->zmaControl('stop'); + $monitor->zmcControl(($newFunction != 'None') ? 'restart' : 'stop'); if ( $newFunction != 'None' && $newFunction != 'NoDect' ) - zmaControl($monitor, 'start'); + $monitor->zmaControl('start'); } } else { ZM\Logger::Debug('No change to function, not doing anything.');