$client); } $apikey = Property::get("rebootcontrol_APIPOSTKEY", 'not-set'); if (!empty($apikey) && Request::post('token') === $apikey) { 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"; }