zoneminder/web/ajax/alarm.php

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

29 lines
770 B
PHP
Raw Permalink Normal View History

<?php
define('MSG_TIMEOUT', 2.0);
define('MSG_DATA_SIZE', 4+256);
2018-06-26 02:51:46 +08:00
if ( canEdit('Monitors') ) {
$zmuCommand = getZmuCommand(' -m '.validInt($_REQUEST['id']));
2018-06-26 02:51:46 +08:00
switch ( validJsStr($_REQUEST['command']) ) {
case 'disableAlarms' :
$zmuCommand .= ' -n';
break;
2018-06-26 02:51:46 +08:00
case 'enableAlarms' :
$zmuCommand .= ' -c';
break;
2018-06-26 02:51:46 +08:00
case 'forceAlarm' :
$zmuCommand .= ' -a';
break;
2018-06-26 02:51:46 +08:00
case 'cancelForcedAlarm' :
$zmuCommand .= ' -c';
break;
default :
2018-06-26 02:51:46 +08:00
ajaxError("Unexpected command '".validJsStr($_REQUEST['command'])."'");
}
2018-06-26 02:51:46 +08:00
ajaxResponse(exec(escapeshellcmd($zmuCommand)));
} else {
2018-06-26 02:51:46 +08:00
ajaxError('Insufficient permissions');
}
?>