Merge branch 'release-1.34'

This commit is contained in:
Isaac Connor 2020-03-26 15:38:35 -04:00
commit 4ce944da23
6 changed files with 24 additions and 11 deletions

5
db/zm_update-1.34.7.sql Normal file
View File

@ -0,0 +1,5 @@
--
-- This updates a 1.34.6 database to 1.34.7
--
-- No changes required
--

View File

@ -80,7 +80,7 @@ fi;
if [ "$DISTROS" == "" ]; then
if [ "$RELEASE" != "" ]; then
DISTROS="xenial,bionic,disco,eoan,trusty"
DISTROS="xenial,bionic,disco,eoan,focal,trusty"
else
DISTROS=`lsb_release -a 2>/dev/null | grep Codename | awk '{print $2}'`;
fi;

View File

@ -379,6 +379,8 @@ class MonitorsController extends AppController {
$args = '';
if ( $daemon == 'zmc' and $monitor['Type'] == 'Local' ) {
$args = '-d ' . $monitor['Device'];
} else if ( $daemon == 'zmcontrol.pl' ) {
$args = '--id '.$id;
} else {
$args = '-m ' . $id;
}

View File

@ -497,6 +497,10 @@ class Monitor extends ZM_Object {
if ( !count($options) ) {
if ( $command == 'quit' ) {
$options['command'] = 'quit';
} else if ( $command == 'start' ) {
$options['command'] = 'start';
} else if ( $command == 'stop' ) {
$options['command'] = 'stop';
} else {
Warning("No commands to send to zmcontrol from $command");
return false;
@ -531,7 +535,7 @@ class Monitor extends ZM_Object {
} else if ( $this->ServerId() ) {
$Server = $this->Server();
$url = ZM_BASE_PROTOCOL . '://'.$Server->Hostname().'/zm/api/monitors/daemonControl/'.$this->{'Id'}.'/'.$mode.'/zmcontrol.json';
$url = ZM_BASE_PROTOCOL . '://'.$Server->Hostname().'/zm/api/monitors/daemonControl/'.$this->{'Id'}.'/'.$command.'/zmcontrol.pl.json';
if ( ZM_OPT_USE_AUTH ) {
if ( ZM_AUTH_RELAY == 'hashed' ) {
$url .= '?auth='.generateAuthHash( ZM_AUTH_HASH_IPS );
@ -547,12 +551,12 @@ class Monitor extends ZM_Object {
$context = stream_context_create();
try {
$result = file_get_contents($url, false, $context);
if ($result === FALSE) { /* Handle error */
Error("Error restarting zma using $url");
if ( $result === FALSE ) { /* Handle error */
Error("Error sending command using $url");
return false;
}
} catch ( Exception $e ) {
Error("Except $e thrown trying to restart zma");
Error("Exception $e thrown trying to send command to $url");
return false;
}
} else {

View File

@ -92,6 +92,9 @@ if ( $action == 'monitor' ) {
if ( $monitor->Type() != 'WebSite' ) {
$monitor->zmaControl('stop');
$monitor->zmcControl('stop');
if ( $monitor->Controllable() ) {
$monitor->sendControlCommand('stop');
}
}
# These are used in updating zones
@ -264,8 +267,7 @@ if ( $action == 'monitor' ) {
$monitor->zmaControl('start');
if ( $monitor->Controllable() ) {
require_once('includes/control_functions.php');
$monitor->sendControlCommand('quit');
$monitor->sendControlCommand('start');
}
}
// really should thump zmwatch and maybe zmtrigger too.

View File

@ -729,12 +729,12 @@ switch ( $tab ) {
continue;
if ( $optCount && ($optCount%$breakCount == 0) )
echo '</br>';
echo '<input type="checkbox" name="newMonitor[Triggers][]" value="'. $optTrigger. '"'.
(( ('' !== $monitor->Triggers()) && in_array($optTrigger, $monitor->Triggers()) ) ? ' checked="checked"':''). '/> '. $optTrigger;
echo '<input type="checkbox" name="newMonitor[Triggers][]" value="'.$optTrigger.'"'.
(( ('' !== $monitor->Triggers()) && in_array($optTrigger, $monitor->Triggers()) ) ? ' checked="checked"' : ''). '/> '. $optTrigger;
$optCount ++;
} # end foreach trigger option
if ( !$optCount ) {
echo '<em>'. translate('NoneAvailable') .'</em>';
echo '<em>'.translate('NoneAvailable').'</em>';
}
?>
</td></tr>