Fixup Monitor->sendControlCommand. start/stop/quit should be run through zmdc.pl now instead of talking directly to zmcontrol.
This commit is contained in:
parent
45a445ac48
commit
82188c266e
|
@ -495,12 +495,16 @@ 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';
|
||||
|
||||
if ( $command == 'quit' or $command == 'start' or $command == 'stop' ) {
|
||||
# These are special as we now run zmcontrol as a daemon through zmdc.
|
||||
$status = daemonStatus('zmcontrol.pl', array('--id', $this->{'Id'}));
|
||||
Logger::Debug("Current status $status");
|
||||
if ( $status or ( (!defined('ZM_SERVER_ID')) or ( property_exists($this, 'ServerId') and (ZM_SERVER_ID==$this->{'ServerId'}) ) ) ) {
|
||||
daemonControl($command, 'zmcontrol.pl', '--id '.$this->{'Id'});
|
||||
return;
|
||||
}
|
||||
$options['command'] = $command;
|
||||
} else {
|
||||
Warning("No commands to send to zmcontrol from $command");
|
||||
return false;
|
||||
|
@ -540,10 +544,10 @@ class Monitor extends ZM_Object {
|
|||
if ( ZM_AUTH_RELAY == 'hashed' ) {
|
||||
$url .= '?auth='.generateAuthHash(ZM_AUTH_HASH_IPS);
|
||||
} else if ( ZM_AUTH_RELAY == 'plain' ) {
|
||||
$url = '?user='.$_SESSION['username'];
|
||||
$url = '?pass='.$_SESSION['password'];
|
||||
$url .= '?user='.$_SESSION['username'];
|
||||
$url .= '?pass='.$_SESSION['password'];
|
||||
} else if ( ZM_AUTH_RELAY == 'none' ) {
|
||||
$url = '?user='.$_SESSION['username'];
|
||||
$url .= '?user='.$_SESSION['username'];
|
||||
}
|
||||
}
|
||||
Logger::Debug("sending command to $url");
|
||||
|
|
Loading…
Reference in New Issue