$output = "";
foreach ((array) $_SESSION["pwds"] as $vendor => $servers) {
foreach ($servers as $server => $usernames) {
+ $name = h(get_setting("vendor-$server") ?: $drivers[$vendor]);
foreach ($usernames as $username => $password) {
if ($password !== null) {
$dbs = $_SESSION["db"][$vendor][$server][$username];
foreach (($dbs ? array_keys($dbs) : array("")) as $db) {
- $output .= "<li><a href='" . h(auth_url($vendor, $server, $username, $db)) . "'>($drivers[$vendor]) " . h($username . ($server != "" ? "@" . $this->serverName($server) : "") . ($db != "" ? " - $db" : "")) . "</a>\n";
+ $output .= "<li><a href='" . h(auth_url($vendor, $server, $username, $db)) . "'>($name) " . h($username . ($server != "" ? "@" . $this->serverName($server) : "") . ($db != "" ? " - $db" : "")) . "</a>\n";
}
}
}
if ($adminer->operators === null) {
$adminer->operators = $driver->operators;
}
+ if (isset($connection->maria)) {
+ save_settings(array("vendor-" . SERVER => $drivers[DRIVER]));
+ }
}
}
return $return;
}
-/** Get settings stored in a cookie
-* @param string
-* @return array
-*/
-function get_settings($cookie) {
- parse_str($_COOKIE[$cookie], $settings);
- return $settings;
-}
-
-/** Get setting stored in a cookie
-* @param string
-* @param string
-* @return mixed
-*/
-function get_setting($key, $cookie = "adminer_settings") {
- $settings = get_settings($cookie);
- return $settings[$key];
-}
-
-/** Store settings to a cookie
-* @param array
-* @param string
-* @return bool
-*/
-function save_settings($settings, $cookie = "adminer_settings") {
- return cookie($cookie, http_build_query($settings + get_settings($cookie)));
-}
-
/** Print SQL <textarea> tag
* @param string
* @param string or array in which case [0] of every element is used
);
}
+/** Get settings stored in a cookie
+* @param string
+* @return array
+*/
+function get_settings($cookie) {
+ parse_str($_COOKIE[$cookie], $settings);
+ return $settings;
+}
+
+/** Get setting stored in a cookie
+* @param string
+* @param string
+* @return mixed
+*/
+function get_setting($key, $cookie = "adminer_settings") {
+ $settings = get_settings($cookie);
+ return $settings[$key];
+}
+
+/** Store settings to a cookie
+* @param array
+* @param string
+* @return bool
+*/
+function save_settings($settings, $cookie = "adminer_settings") {
+ return cookie($cookie, http_build_query($settings + get_settings($cookie)));
+}
+
/** Restart stopped session
* @return null
*/