Files
zoneminder/web/ajax/alarm.php
stan 81fd3aaa41 Restructured ajax to be consistent.
git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@2668 e3e1d417-86f3-4887-817a-d78f3d33393f
2008-10-16 16:12:23 +00:00

43 lines
907 B
PHP

<?php
define( "MSG_TIMEOUT", 2.0 );
define( "MSG_DATA_SIZE", 4+256 );
if ( canEdit( 'Monitors' ) )
{
$zmuCommand = getZmuCommand( " -m ".validInt($_REQUEST['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( escapeshellcmd( $zmuCommand ) ) );
}
ajaxError( 'Unrecognised action or insufficient permissions' );
?>