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