$client); } if (Request::post('token') == Property::get("rebootcontrol_APIPOSTKEY")) { if (Request::isPost()) { if (Request::post('action') == 'shutdown') { $shutdown = true; $task = Taskmanager::submit("RemoteReboot", array("clients" => $clients, "shutdown" => $shutdown, "minutes" => $minutes)); echo $task["id"]; } else if (Request::post('action') == 'reboot') { $shutdown = false; $task = Taskmanager::submit("RemoteReboot", array("clients" => $clients, "shutdown" => $shutdown, "minutes" => $minutes)); echo $task["id"]; } else { echo "Only action=shutdown and action=reboot available."; } } else { echo "Only POST Method available."; } } else { echo "Not authorized"; }