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