mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-11-30 04:04:03 -05:00
33 lines
932 B
PHP
33 lines
932 B
PHP
<?php
|
|
define('MSG_TIMEOUT', 2.0);
|
|
define('MSG_DATA_SIZE', 4+256);
|
|
|
|
require_once('includes/Monitor.php');
|
|
$monitor = new ZM\Monitor(validCardinal($_REQUEST['id']));
|
|
|
|
// Needs edit on this monitor, not only the global Monitors permission.
|
|
if ( $monitor->Id() and $monitor->canEdit() ) {
|
|
$zmuCommand = getZmuCommand(' -m '.$monitor->Id());
|
|
|
|
switch ( validJsStr($_REQUEST['command']) ) {
|
|
case 'disableAlarms' :
|
|
$zmuCommand .= ' -n';
|
|
break;
|
|
case 'enableAlarms' :
|
|
$zmuCommand .= ' -c';
|
|
break;
|
|
case 'forceAlarm' :
|
|
$zmuCommand .= ' -a';
|
|
break;
|
|
case 'cancelForcedAlarm' :
|
|
$zmuCommand .= ' -c';
|
|
break;
|
|
default :
|
|
ajaxError("Unexpected command '".validJsStr($_REQUEST['command'])."'");
|
|
}
|
|
ajaxResponse(exec($zmuCommand));
|
|
} else {
|
|
ajaxError('Insufficient permissions');
|
|
}
|
|
?>
|