Permalink
Browse files

Document password functions

  • Loading branch information...
1 parent 822f3f2 commit 1602db304aaa6e44bf012d9239600580660b5a13 @vrana committed Feb 19, 2014
Showing with 29 additions and 18 deletions.
  1. +0 −18 adminer/include/auth.inc.php
  2. +28 −0 adminer/include/functions.inc.php
  3. +1 −0 changes.txt
@@ -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]);
@@ -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
@@ -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

0 comments on commit 1602db3

Please sign in to comment.