From 0e592f6a8fe4c712b17e7b53a127f888b6db8010 Mon Sep 17 00:00:00 2001 From: stan Date: Tue, 22 Nov 2005 15:18:57 +0000 Subject: [PATCH] Bug 213 - Correct invalid console behaviour when not running. git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@1620 e3e1d417-86f3-4887-817a-d78f3d33393f --- web/zm_actions.php | 26 +++++++++++++++++++------- web/zm_funcs.php | 11 +++++++++-- web/zm_html_view_console.php | 4 ++-- web/zm_xhtml_view_console.php | 4 ++-- 4 files changed, 32 insertions(+), 13 deletions(-) diff --git a/web/zm_actions.php b/web/zm_actions.php index 2161f12f1..99fddc29f 100644 --- a/web/zm_actions.php +++ b/web/zm_actions.php @@ -126,7 +126,7 @@ if ( isset($action) ) $filter_parms[] = "sort_asc=$sort_asc"; $filter_parms[] = "limit=$limit"; $filter_query_string = join( '&', $filter_parms ); - simpleQuery( "replace into Filters set Name = '$filter_name', Query = '$filter_query_string', AutoArchive = '$auto_archive', AutoVideo = '$auto_video', AutoUpload = '$auto_upload', AutoEmail = '$auto_email', AutoMessage = '$auto_message', AutoExecute = '$auto_execute', AutoDelete = '$auto_delete'" ); + simpleQuery( "replace into Filters set Name = '$filter_name', Query = '$filter_query_string', AutoArchive = '$auto_archive', AutoVideo = '$auto_video', AutoUpload = '$auto_upload', AutoEmail = '$auto_email', AutoMessage = '$auto_message', AutoExecute = '$auto_execute', AutoDelete = '$auto_delete'" ); $refresh_parent = true; } } @@ -994,8 +994,11 @@ if ( isset($action) ) $monitor['Function'] = $new_function; if ( $cookies ) session_write_close(); - zmcControl( $monitor, true ); - zmaControl( $monitor, true ); + if ( daemonCheck() ) + { + zmcControl( $monitor, true ); + zmaControl( $monitor, true ); + } $refresh_parent = true; } } @@ -1035,7 +1038,10 @@ if ( isset($action) ) //echo "$sql"; simpleQuery( $sql ); if ( $cookies ) session_write_close(); - zmaControl( $mid, true ); + if ( daemonCheck() ) + { + zmaControl( $mid, true ); + } $refresh_parent = true; } } @@ -1157,8 +1163,11 @@ if ( isset($action) ) $monitor = mysql_fetch_assoc( $result ); fixDevices(); if ( $cookies ) session_write_close(); - zmcControl( $monitor, true ); - zmaControl( $monitor, true ); + if ( daemonCheck() ) + { + zmcControl( $monitor, true ); + zmaControl( $monitor, true ); + } //daemonControl( 'restart', 'zmwatch.pl' ); $refresh_parent = true; } @@ -1201,7 +1210,10 @@ if ( isset($action) ) if ( $deleted_zid ) { if ( $cookies ) session_write_close(); - zmaControl( $mid, true ); + if ( daemonCheck() ) + { + zmaControl( $mid, true ); + } $refresh_parent = true; } } diff --git a/web/zm_funcs.php b/web/zm_funcs.php index 8b0d59734..06f60f74f 100644 --- a/web/zm_funcs.php +++ b/web/zm_funcs.php @@ -584,9 +584,16 @@ function daemonStatus( $daemon, $args=false ) { global $daemon_status; - initDaemonStatus(); + if ( daemonCheck() ) + { + initDaemonStatus(); + } + else + { + $daemon_status = ""; + } - $string .= "$daemon"; + $string = "$daemon"; if ( $args ) $string .= " $args"; return( strpos( $daemon_status, "'$string' running" ) !== false ); diff --git a/web/zm_html_view_console.php b/web/zm_html_view_console.php index 7d2480a82..2250258b5 100644 --- a/web/zm_html_view_console.php +++ b/web/zm_html_view_console.php @@ -245,7 +245,7 @@ else if ( canView( 'Stream' ) && $cycle_count > 1 ) { ?> - /  + /  - + ".$monitor['Function']."", canEdit( 'Monitors' ) ) ?> ".$monitor['Device']." (".$monitor['Channel'].")", canEdit( 'Monitors' ) ) ?> diff --git a/web/zm_xhtml_view_console.php b/web/zm_xhtml_view_console.php index b5e70c281..e0ddd9b1c 100644 --- a/web/zm_xhtml_view_console.php +++ b/web/zm_xhtml_view_console.php @@ -116,7 +116,7 @@ foreach( $monitors as $monitor ) $fclass .= "em"; } ?> - + ".substr( $monitor['Function'], 0, 4 )."", canEdit( 'Monitors' ) ) ?> @@ -126,7 +126,7 @@ foreach( $monitors as $monitor ) ?>   - 1 ) ) ?> + 1 ) ) ?>