\n"; echo "
\n"; outputImageStream("liveStream", $streamSrc, $width, $height, "stream"); echo "
"; exit; } else if (strcmp($action, "vevent") == 0) { /* ACTION: View an event */ if (!canView('Events')) { error_log("User ".$user['Username']. " doesn't have view Events perms"); exit; } if (!isset($_GET['mid']) || !isset($_GET['eid']) || !isset($_GET['fps'])) { error_log("Not all parameters set for Action View-event"); exit; } $baseURL = trim(shell_exec('pwd'))."/events/".$_REQUEST['mid']."/".$_REQUEST['eid']."/"; $relativeURL = "./events/".$_REQUEST['mid']."/".$_REQUEST['eid']."/"; $shellCmd = "ffmpeg -y -r ".$_REQUEST['fps']." -i ".$baseURL."%03d-capture.jpg -vcodec mpeg4 -r 10 ".$baseURL."capture.mov 2> /dev/null"; shell_exec("rm -f ".$baseURL."capture.mov"); $shellOutput = shell_exec($shellCmd); header("Location: ".$relativeURL."capture.mov"); } else if (strcmp($action, "state") == 0) { /* ACTION: Change the state of the system */ if (!canEdit('System')) { error_log("User ".$user['Username']. " doesn't have edit System perms"); exit; } if (!isset($_GET['state'])) { error_log("Server state not specified for action"); exit; } $url = "./index.php?view=none&action=state&runState=".$_GET['state']; header("Location: ".$url); exit; } else if (strcmp($action, "func") == 0) { /* ACTION: Change state of the monitor */ if (!canEdit('Monitors')) { error_log("User ".$user['Username']. " doesn't have monitors Edit perms"); exit; } if (!isset($_GET['mid']) || !isset($_GET['func']) || !isset($_GET['en'])) { error_log("Not all parameters specified for action Monitor state"); exit; } $url = "./index.php?view=none&action=function&mid=".$_GET['mid']."&newFunction=".$_GET['func']."&newEnabled=".$_GET['en']; header("Location: ".$url); exit; } } ?>