1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-09 08:06:59 +02:00

List authentications

This commit is contained in:
Jakub Vrana
2010-05-06 14:21:22 +02:00
parent 8878799c90
commit 605b09301b
4 changed files with 49 additions and 11 deletions

View File

@@ -28,13 +28,7 @@ if (isset($_POST["server"])) {
|| SERVER != $_POST["server"]
|| $_GET["username"] !== $_POST["username"] // "0" == "00"
) {
preg_match('~([^?]*)\\??(.*)~', remove_from_uri(implode("|", array_keys($drivers)) . "|username|" . session_name()), $match);
redirect("$match[1]?"
. (SID ? SID . "&" : "")
. ($_POST["driver"] != "server" || $_POST["server"] != "" ? urlencode($_POST["driver"]) . "=" . urlencode($_POST["server"]) . "&" : "")
. "username=" . urlencode($_POST["username"])
. ($match[2] ? "&$match[2]" : "")
);
redirect(auth_url($_POST["driver"], $_POST["server"], $_POST["username"]));
}
} elseif ($_POST["logout"]) {
if ($token && $_POST["token"] != $token) {
@@ -67,9 +61,10 @@ function auth_error($exception = null) {
if (($_COOKIE[$session_name] || $_GET[$session_name]) && !$token) {
$error = lang('Session expired, please login again.');
} else {
$password = get_session("passwords");
$password = &get_session("passwords");
if (isset($password)) {
$error = h($exception ? $exception->getMessage() : (is_string($connection) ? $connection : lang('Invalid credentials.')));
$password = null;
}
}
}