]> git.joonet.de Git - adminer.git/commitdiff
Document password functions
authorJakub Vrana <jakub@vrana.cz>
Wed, 19 Feb 2014 17:27:22 +0000 (09:27 -0800)
committerJakub Vrana <jakub@vrana.cz>
Wed, 19 Feb 2014 17:27:22 +0000 (09:27 -0800)
adminer/include/auth.inc.php
adminer/include/functions.inc.php
changes.txt

index 5edd0abcd7d3a82c969e32a977ea059c5329f0e2..1dea7fa6d940140a27ca9f76677320f5eac87da9 100644 (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]);
index 8aac0fb588f76212b1941543644c61d12e8aca6e..a2f804a65ae8be173b81d3a4646e997c384e422f 100644 (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
index 7ef8c7e38cea4c1a80079497c6ece08adf2dc6da..bb87c2632ebfdea333584950ee2c052a13bbd7bc 100644 (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