$template = null; $userName = ""; $user = null; $server = null; $serverPort = 0; $serverIP = 0; // Server ID $err = @Utils::checkInput($_POST['servertargetid'], "Server ID", 1, 64, INPUT_TYPE_NUMERIC); if (strlen($err) != 0) { $error[] = $err; } else { if (!PhysicalServerManager::existsById($_POST['servertargetid'])) { $error[] = "The given Server doesnt exist."; } else { $server = new PhysicalServer($_POST['servertargetid']); $serverName = $server->getData("name"); $serverIP = $server->getData("ip"); } } // Port $err = @Utils::checkInput($_POST['port'], "Port", 1, 64, INPUT_TYPE_NUMERIC); if (strlen($err) != 0) { if (strlen($_POST['port']) == 0) { $serverPort = $server->getRandomFreePort(); if ($serverPort === false) { $error[] = "The given Server doesnt have any free port."; } } else { $error[] = $err; } } else {
$errors = array(); $sid = isset($_POST['serverid']) ? $_POST['serverid'] : ""; if (empty($sid)) { $errors[] = "Es wurde keine Server-ID angegeben."; } else { if (!is_numeric($sid)) { $errors[] = "Es wurde eine ungültige Server-ID angegeben."; } else { if (!PhysicalServerManager::existsById($sid)) { $errors[] = "Die angegebene Server-ID existiert nicht."; } } } if (count($errors) == 0) { $server = new PhysicalServer($sid); $page->assign("t_Report", Reporting::success("Der Server \"" . $server->getData("name") . "\" wird demnächst aktualisiert. (Task geplant)")); $server->addTask(TASK_SERVER_UPDATE); //header("Location: " . Core::GetConfig("dirRoot") . "Server"); } else { $page->assign("t_Report", Reporting::error(Utils::buildErrorString($errors))); } } } } } } } $sc = PhysicalServerManager::getCount(); $smarty->assign("servercount", $sc); $smarty->assign("physicalServerStates", $physicalServerStates); if ($sc != 0) {
$errors = array(); $sid = isset($_POST['servertargetid']) ? $_POST['servertargetid'] : ""; if (empty($sid)) { $errors[] = "No server id set.."; } else { if (!is_numeric($sid)) { $errors[] = "The given server id was invalid."; } else { if (!PhysicalServerManager::existsById($sid)) { $errors[] = "The given server id doesn't exist."; } else { $server = new PhysicalServer($sid); } } } if (isset($server) && $server->getData("status") == 0) { $error[] = "The server wasnt initialized yet."; } $templateid = isset($_POST['templateID']) ? $_POST['templateID'] : ""; if (empty($templateid)) { $errors[] = "No template id set."; } else { if (!is_numeric($sid)) { $errors[] = "The given template id was invalid."; } else { if (!TemplateManager::existsById($templateid)) { $errors[] = "The given template id doesn't exist."; } else { $tpl = new Template($templateid); } }