]> git.joonet.de Git - adminer.git/commitdiff
setup Mongo authSource by ENV
authorFrantišek Hána <sinacek@gmail.com>
Thu, 15 Aug 2019 12:54:47 +0000 (14:54 +0200)
committerJakub Vrana <jakub@vrana.cz>
Thu, 22 Aug 2019 07:43:46 +0000 (09:43 +0200)
adminer/drivers/mongo.inc.php
changes.txt

index 7b83a285fb82d06c691151487bd8696319407b15..88c8e0dbc3f764682ecc103ef8c6c13f7e1ad832 100644 (file)
@@ -618,6 +618,9 @@ if (isset($_GET["mongo"])) {
                if ($db != "") {
                        $options["db"] = $db;
                }
+               if (($auth_source = getenv("MONGO_AUTH_SOURCE"))) {
+                       $options["authSource"] = $auth_source;
+               }
                try {
                        $connection->_link = $connection->connect("mongodb://$server", $options);
                        if ($password != "") {
index 08f369b17bddd10fb61dc16c8e43aa6d63aa4edb..15d4fa4235943c043c31408ca2eea3fde821f3ef 100644 (file)
@@ -8,6 +8,7 @@ SQLite: Handle error in altering table (bug #697)
 SQLite: Allow setting auto increment for empty tables
 SQLite: Preserve auto increment when recreating table
 MS SQL: Support foreign keys to other DB
+MongoDB: Allow setting authSource from environment variable 
 
 Adminer 4.7.2 (released 2019-07-18):
 Do not attempt logging in without password (bug #676)