From 5ee086bbfe34415009ad1ea78c51dd9e9c098329 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Mon, 10 Aug 2020 12:25:44 -0400 Subject: [PATCH] Test for configuration of ZM_PATH_SHUTDOWN and provide useul error message --- web/skins/classic/views/shutdown.php | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/web/skins/classic/views/shutdown.php b/web/skins/classic/views/shutdown.php index 5e032cd1c..1fbe838c1 100644 --- a/web/skins/classic/views/shutdown.php +++ b/web/skins/classic/views/shutdown.php @@ -33,15 +33,23 @@ xhtmlHeaders(__FILE__, translate('Shutdown').' '.translate('Restart'));

+ZM_PATH_SHUTDOWN is not defined. This is normally configured in /etc/zm/conf.d/01-system-paths.conf
'; + } else if ( !file_exists(ZM_PATH_SHUTDOWN) ) { + echo '
Path does not exist for ZM_PATH_SHUTDOWN. Current value is '.ZM_PATH_SHUTDOWN.'
'; + } else { +?> +
'.implode('
', $output).'

'; - } - if ( isset($_POST['when']) and ($_POST['when'] != 'NOW') and ($action != 'cancel') ) { - echo '

You may cancel this shutdown by clicking '.translate('Cancel').'

'; - } + if ( isset($output) ) { + echo '

'.implode('
', $output).'

'; + } + if ( isset($_POST['when']) and ($_POST['when'] != 'NOW') and ($action != 'cancel') ) { + echo '

You may cancel this shutdown by clicking '.translate('Cancel').'

'; + } ?>

Warning

This command will either shutdown or restart all ZoneMinder Servers
@@ -52,17 +60,20 @@ xhtmlHeaders(__FILE__, translate('Shutdown').' '.translate('Restart'));

+