diff --git a/auth.inc.php b/auth.inc.php index 70069b94..66f1857d 100644 --- a/auth.inc.php +++ b/auth.inc.php @@ -2,16 +2,21 @@ if (isset($_POST["server"])) { $_SESSION["username"] = $_POST["username"]; $_SESSION["password"] = $_POST["password"]; - header("Location: " . ($_GET["server"] == $_POST["server"] ? $_SERVER["REQUEST_URI"] : preg_replace('~^[^?]*/([^?]*).*~', '\\1' . (strlen($_POST["server"]) ? '?server=' . urlencode($_POST["server"]) : '') . (SID ? (strlen($_POST["server"]) ? "&" : "?") . SID : ""), $_SERVER["REQUEST_URI"]))); + header("Location: " . ((string) $_GET["server"] === $_POST["server"] ? preg_replace('~(\\?)logout=&|[?&]logout=~', '\\1', $_SERVER["REQUEST_URI"]) : preg_replace('~^[^?]*/([^?]*).*~', '\\1' . (strlen($_POST["server"]) ? '?server=' . urlencode($_POST["server"]) : '') . (SID ? (strlen($_POST["server"]) ? "&" : "?") . SID : ""), $_SERVER["REQUEST_URI"]))); exit; +} elseif (isset($_GET["logout"])) { + unset($_SESSION["username"]); + unset($_SESSION["password"]); } -if (!@mysql_connect($_GET["server"], $_SESSION["username"], $_SESSION["password"])) { +if (isset($_GET["logout"]) || !@mysql_connect($_GET["server"], $_SESSION["username"], $_SESSION["password"])) { page_header(lang('Login'), "auth"); ?>

" . lang('Logout successful.') . "

\n"; + } elseif (isset($_GET["server"])) { echo "

" . lang('Invalid credentials.') . "

\n"; } ?> diff --git a/design.inc.php b/design.inc.php index 2ce9e0f6..c1ce957d 100644 --- a/design.inc.php +++ b/design.inc.php @@ -32,11 +32,12 @@ H2 { font-size: 150%; margin-top: 0; }

+