Rename variable
This commit is contained in:
parent
f4addc5259
commit
48356d8d4f
|
@ -745,7 +745,7 @@ username.form['auth[driver]'].onchange();
|
||||||
<?php
|
<?php
|
||||||
if ($missing == "auth") {
|
if ($missing == "auth") {
|
||||||
$first = true;
|
$first = true;
|
||||||
foreach ((array) $_SESSION["pwds"] as $driver => $servers) {
|
foreach ((array) $_SESSION["pwds"] as $vendor => $servers) {
|
||||||
foreach ($servers as $server => $usernames) {
|
foreach ($servers as $server => $usernames) {
|
||||||
foreach ($usernames as $username => $password) {
|
foreach ($usernames as $username => $password) {
|
||||||
if ($password !== null) {
|
if ($password !== null) {
|
||||||
|
@ -753,9 +753,9 @@ username.form['auth[driver]'].onchange();
|
||||||
echo "<p id='logins' onmouseover='menuOver(this, event);' onmouseout='menuOut(this);'>\n";
|
echo "<p id='logins' onmouseover='menuOver(this, event);' onmouseout='menuOut(this);'>\n";
|
||||||
$first = false;
|
$first = false;
|
||||||
}
|
}
|
||||||
$dbs = $_SESSION["db"][$driver][$server][$username];
|
$dbs = $_SESSION["db"][$vendor][$server][$username];
|
||||||
foreach (($dbs ? array_keys($dbs) : array("")) as $db) {
|
foreach (($dbs ? array_keys($dbs) : array("")) as $db) {
|
||||||
echo "<a href='" . h(auth_url($driver, $server, $username, $db)) . "'>($drivers[$driver]) " . h($username . ($server != "" ? "@$server" : "") . ($db != "" ? " - $db" : "")) . "</a><br>\n";
|
echo "<a href='" . h(auth_url($vendor, $server, $username, $db)) . "'>($drivers[$vendor]) " . h($username . ($server != "" ? "@$server" : "") . ($db != "" ? " - $db" : "")) . "</a><br>\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,17 +52,17 @@ if ($auth) {
|
||||||
$private = $adminer->permanentLogin();
|
$private = $adminer->permanentLogin();
|
||||||
foreach ($permanent as $key => $val) {
|
foreach ($permanent as $key => $val) {
|
||||||
list(, $cipher) = explode(":", $val);
|
list(, $cipher) = explode(":", $val);
|
||||||
list($driver, $server, $username, $db) = array_map('base64_decode', explode("-", $key));
|
list($vendor, $server, $username, $db) = array_map('base64_decode', explode("-", $key));
|
||||||
$_SESSION["pwds"][$driver][$server][$username] = decrypt_string(base64_decode($cipher), $private);
|
$_SESSION["pwds"][$vendor][$server][$username] = decrypt_string(base64_decode($cipher), $private);
|
||||||
$_SESSION["db"][$driver][$server][$username][$db] = true;
|
$_SESSION["db"][$vendor][$server][$username][$db] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function unset_permanent() {
|
function unset_permanent() {
|
||||||
global $permanent;
|
global $permanent;
|
||||||
foreach ($permanent as $key => $val) {
|
foreach ($permanent as $key => $val) {
|
||||||
list($driver, $server, $username, $db) = array_map('base64_decode', explode("-", $key));
|
list($vendor, $server, $username, $db) = array_map('base64_decode', explode("-", $key));
|
||||||
if ($driver == DRIVER && $server == SERVER && $username == $_GET["username"] && $db == DB) {
|
if ($vendor == DRIVER && $server == SERVER && $username == $_GET["username"] && $db == DB) {
|
||||||
unset($permanent[$key]);
|
unset($permanent[$key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -455,12 +455,12 @@ function set_session($key, $val) {
|
||||||
* @param string
|
* @param string
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function auth_url($driver, $server, $username, $db = null) {
|
function auth_url($vendor, $server, $username, $db = null) {
|
||||||
global $drivers;
|
global $drivers;
|
||||||
preg_match('~([^?]*)\\??(.*)~', remove_from_uri(implode("|", array_keys($drivers)) . "|username|" . ($db !== null ? "db|" : "") . session_name()), $match);
|
preg_match('~([^?]*)\\??(.*)~', remove_from_uri(implode("|", array_keys($drivers)) . "|username|" . ($db !== null ? "db|" : "") . session_name()), $match);
|
||||||
return "$match[1]?"
|
return "$match[1]?"
|
||||||
. (sid() ? SID . "&" : "")
|
. (sid() ? SID . "&" : "")
|
||||||
. ($driver != "server" || $server != "" ? urlencode($driver) . "=" . urlencode($server) . "&" : "")
|
. ($vendor != "server" || $server != "" ? urlencode($vendor) . "=" . urlencode($server) . "&" : "")
|
||||||
. "username=" . urlencode($username)
|
. "username=" . urlencode($username)
|
||||||
. ($db != "" ? "&db=" . urlencode($db) : "")
|
. ($db != "" ? "&db=" . urlencode($db) : "")
|
||||||
. ($match[2] ? "&$match[2]" : "")
|
. ($match[2] ? "&$match[2]" : "")
|
||||||
|
|
Loading…
Reference in a new issue