Document password functions

This commit is contained in:
Jakub Vrana 2014-02-19 09:27:22 -08:00
parent 822f3f2498
commit 1602db304a
3 changed files with 29 additions and 18 deletions

View file

@ -108,24 +108,6 @@ function auth_error($exception = null) {
page_footer("auth");
}
function set_password($vendor, $server, $username, $password) {
$_SESSION["pwds"][$vendor][$server][$username] = ($_COOKIE["adminer_key"] && is_string($password)
? array(encrypt_string($password, $_COOKIE["adminer_key"]))
: $password
);
}
function get_password() {
$return = get_session("pwds");
if (is_array($return)) {
$return = ($_COOKIE["adminer_key"]
? decrypt_string($return[0], $_COOKIE["adminer_key"])
: false
);
}
return $return;
}
if (isset($_GET["username"])) {
if (!class_exists("Min_DB")) {
unset($_SESSION["pwds"][DRIVER]);

View file

@ -249,6 +249,34 @@ function sid() {
return $return;
}
/** Set password to session
* @param string
* @param string
* @param string
* @param string
* @return null
*/
function set_password($vendor, $server, $username, $password) {
$_SESSION["pwds"][$vendor][$server][$username] = ($_COOKIE["adminer_key"] && is_string($password)
? array(encrypt_string($password, $_COOKIE["adminer_key"]))
: $password
);
}
/** Get password from session
* @return string
*/
function get_password() {
$return = get_session("pwds");
if (is_array($return)) {
$return = ($_COOKIE["adminer_key"]
? decrypt_string($return[0], $_COOKIE["adminer_key"])
: false
);
}
return $return;
}
/** Shortcut for $driver->quote($string)
* @param string
* @return string

View file

@ -1,5 +1,6 @@
Adminer 4.0.4-dev:
SQLite: Display auto-created unique indexes, bug since Adminer 3.5.0
Editor: Fix login() method, bug since Adminer 4.0.0
Adminer 4.0.3 (released 2014-02-01)
MongoDB: insert, truncate, indexes