mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-09-08 11:26:15 -04:00
Remove references to zma
This commit is contained in:
1 parent
49209d9e72
commit
105eff7a21
10 files changed
+9
-1077
No files matched your search
@@ -347,66 +347,6 @@ class Monitor extends ZM_Object {
|
||||
}
|
||||
} // end function zmcControl
|
||||
|
||||
function zmaControl($mode=false) {
|
||||
if ( ! (property_exists($this, 'Id') and $this->{'Id'}) ) {
|
||||
Warning('Attempt to control a monitor with no Id');
|
||||
return;
|
||||
}
|
||||
|
||||
if ( (!defined('ZM_SERVER_ID')) or ( property_exists($this, 'ServerId') and (ZM_SERVER_ID==$this->{'ServerId'}) ) ) {
|
||||
if ( $this->{'Function'} == 'None' || $this->{'Function'} == 'Monitor' || $mode == 'stop' ) {
|
||||
if ( ZM_OPT_CONTROL && $this->Controllable() && $this->TrackMotion() &&
|
||||
( $this->{'Function'} == 'Modect' || $this->{'Function'} == 'Mocord' ) ) {
|
||||
daemonControl('stop', 'zmtrack.pl', '-m '.$this->{'Id'});
|
||||
}
|
||||
daemonControl('stop', 'zma', '-m '.$this->{'Id'});
|
||||
} else {
|
||||
if ( $mode == 'restart' ) {
|
||||
if ( ZM_OPT_CONTROL ) {
|
||||
daemonControl('stop', 'zmtrack.pl', '-m '.$this->{'Id'});
|
||||
}
|
||||
daemonControl('stop', 'zma', '-m '.$this->{'Id'});
|
||||
}
|
||||
daemonControl('start', 'zma', '-m '.$this->{'Id'});
|
||||
if ( ZM_OPT_CONTROL && $this->Controllable() && $this->TrackMotion() &&
|
||||
( $this->{'Function'} == 'Modect' || $this->{'Function'} == 'Mocord' ) ) {
|
||||
daemonControl('start', 'zmtrack.pl', '-m '.$this->{'Id'});
|
||||
}
|
||||
if ( $mode == 'reload' ) {
|
||||
daemonControl('reload', 'zma', '-m '.$this->{'Id'});
|
||||
}
|
||||
}
|
||||
} else if ( $this->ServerId() ) {
|
||||
$Server = $this->Server();
|
||||
|
||||
$url = $Server->UrlToApi().'/monitors/daemonControl/'.$this->{'Id'}.'/'.$mode.'/zma.json';
|
||||
if ( ZM_OPT_USE_AUTH ) {
|
||||
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'];
|
||||
} else {
|
||||
Error('Multi-Server requires AUTH_RELAY be either HASH or PLAIN');
|
||||
return;
|
||||
}
|
||||
}
|
||||
Debug("sending command to $url");
|
||||
|
||||
$context = stream_context_create();
|
||||
try {
|
||||
$result = file_get_contents($url, false, $context);
|
||||
if ( $result === FALSE ) { /* Handle error */
|
||||
Error("Error restarting zma using $url");
|
||||
}
|
||||
} catch ( Exception $e ) {
|
||||
Error("Except $e thrown trying to restart zma");
|
||||
}
|
||||
} else {
|
||||
Error('Server not assigned to Monitor in a multi-server setup. Please assign a server to the Monitor.');
|
||||
} // end if we are on the recording server
|
||||
} // end public function zmaControl
|
||||
|
||||
public function GroupIds( $new='' ) {
|
||||
if ( $new != '' ) {
|
||||
if ( !is_array($new) ) {
|
||||
@@ -433,7 +373,6 @@ class Monitor extends ZM_Object {
|
||||
Warning("Attempt to delete a monitor without id.");
|
||||
return;
|
||||
}
|
||||
$this->zmaControl('stop');
|
||||
$this->zmcControl('stop');
|
||||
|
||||
// If fast deletes are on, then zmaudit will clean everything else up later
|
||||
|
||||
Reference in new issue
Block a user