X-Git-Url: https://jfr.im/git/irc/unrealircd/unrealircd-webpanel.git/blobdiff_plain/82fa15f1c216c9496f44ff63cd413872e0f6ee1c..be3ca91ebeb38538c348e67af05ec7e4f03ed489:/servers/details.php diff --git a/servers/details.php b/servers/details.php index 7730224..cf28deb 100644 --- a/servers/details.php +++ b/servers/details.php @@ -5,32 +5,101 @@ require_once "../header.php"; $title = "Server Lookup"; $servername = ""; $srv = NULL; + +$rehash_errors = []; +$rehash_warnings = []; +$rehash_success = []; + if (isset($_POST)) { - if (isset($_POST['disconnect'])) - { - if ($rpc->server()->disconnect($_POST['disconnect'], $_POST['reason'])) - Message::Success("Server \"".$_POST['disconnect']."\" has been successfully disconnected from the network."); - else - Message::Fail($rpc->error); - } - + if (isset($_POST['rehash'])) + { + $servID = $_POST['rehash']; + if ($response = $rpc->server()->rehash($servID)) + { + $serb = $rpc->server()->get($servID); + do_log($servID, $response); + if ($response->success || (!isset($response->success) != false && $response == true)) + { + $rehash_success[] = $serb->name; + foreach($response->log as $log) + { + do_log($log->level); + if ($log->level == "warn") + $rehash_warnings[$log->log_source][] = $log->msg; + } + } + else if (isset($response->success) && !$response->success) + { + foreach ($response->log as $log) + { + if ($log->level == "error") + $rehash_errors[$log->log_source][] = $log->msg; + } + } + } + } + if (isset($_POST['disconnect'])) + { + if ($rpc->server()->disconnect($_POST['disconnect'], $_POST['reason'])) + Message::Success("Server \"".$_POST['disconnect']."\" has been successfully disconnected from the network."); + else + Message::Fail($rpc->error); + } + } if (isset($_GET['server'])) { $servername = $_GET['server']; $srv = $rpc->server()->get($servername); - + if (!$srv) { Message::Fail("Could not find server: \"$servername\""); } - - else { + + else { $servername = $srv->name; $title .= " for \"" . $servername . "\""; } } +if (!empty($rehash_success)) { + do_log($rehash_success); + $servlist_bullet = "