From 2f27818e5b46bb4f04ed0dfe6829a1bf9ad9af3b Mon Sep 17 00:00:00 2001 From: Laercio Motta Date: Thu, 31 Mar 2016 09:23:01 -0300 Subject: [PATCH 1/2] Improve test multiserver restart cam. Test if correct server from camera edit settings. --- web/includes/functions.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/web/includes/functions.php b/web/includes/functions.php index 14a8d778e..3cab8366f 100644 --- a/web/includes/functions.php +++ b/web/includes/functions.php @@ -982,6 +982,7 @@ function daemonControl( $command, $daemon=false, $args=false ) function zmcControl( $monitor, $mode=false ) { + if (ZM_SERVER_ID == $monitor['ServerId']) { $row = NULL; if ( $monitor['Type'] == "Local" ) { @@ -1007,10 +1008,12 @@ function zmcControl( $monitor, $mode=false ) } daemonControl( "start", "zmc", $zmcArgs ); } + } } function zmaControl( $monitor, $mode=false ) { + if (ZM_SERVER_ID == $monitor['ServerId']) { if ( !is_array( $monitor ) ) { $monitor = dbFetchOne( "select C.*, M.* from Monitors as M left join Controls as C on (M.ControlId = C.Id ) where M.Id=?", NULL, array($monitor) ); @@ -1055,6 +1058,7 @@ function zmaControl( $monitor, $mode=false ) daemonControl( "reload", "zma", "-m ".$monitor['Id'] ); } } + } } function initDaemonStatus() From ad912a6c6bd79cbaed3f9edee324a6af63e0981a Mon Sep 17 00:00:00 2001 From: Laercio Motta Date: Thu, 31 Mar 2016 09:45:13 -0300 Subject: [PATCH 2/2] Improve test multiserver restart camera. (FIX) Check if the server is correctly before restart cam and multiserver is activate. --- web/includes/functions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/includes/functions.php b/web/includes/functions.php index 3cab8366f..800f03f4d 100644 --- a/web/includes/functions.php +++ b/web/includes/functions.php @@ -982,7 +982,7 @@ function daemonControl( $command, $daemon=false, $args=false ) function zmcControl( $monitor, $mode=false ) { - if (ZM_SERVER_ID == $monitor['ServerId']) { + if ( (!ZM_SERVER) or ( ZM_SERVER==$monitor[ServerId}) ) { $row = NULL; if ( $monitor['Type'] == "Local" ) { @@ -1013,7 +1013,7 @@ function zmcControl( $monitor, $mode=false ) function zmaControl( $monitor, $mode=false ) { - if (ZM_SERVER_ID == $monitor['ServerId']) { + if ( (!ZM_SERVER) or ( ZM_SERVER==$monitor[ServerId}) ) { if ( !is_array( $monitor ) ) { $monitor = dbFetchOne( "select C.*, M.* from Monitors as M left join Controls as C on (M.ControlId = C.Id ) where M.Id=?", NULL, array($monitor) );