Commit 9d5788be authored by Henning Leutz's avatar Henning Leutz 🥋

feat: #1010

parent dbd4e26a
......@@ -80,6 +80,12 @@
<conf name="mongo_collection">
<type><![CDATA[string]]></type>
</conf>
<conf name="mongo_username">
<type><![CDATA[string]]></type>
</conf>
<conf name="mongo_password">
<type><![CDATA[string]]></type>
</conf>
<conf name="file_path">
<type><![CDATA[string]]></type>
</conf>
......@@ -309,6 +315,20 @@
var="quiqqer.settings.longTimeCache.mongo_collection.server"/>
</text>
</input>
<input conf="longtime.mongo_username" type="text">
<text>
<locale group="quiqqer/quiqqer"
var="quiqqer.settings.longTimeCache.mongo.username"/>
</text>
</input>
<input conf="longtime.mongo_password" type="text">
<text>
<locale group="quiqqer/quiqqer"
var="quiqqer.settings.longTimeCache.mongo.password"/>
</text>
</input>
</settings>
</category>
......
......@@ -219,8 +219,17 @@ class LongTermCache
$database = 'mongodb://'.$database;
}
if (!empty($conf['mongo_username']) && !empty($conf['mongo_password'])) {
$Client = new \MongoDB\Client($database, [
"username" => $conf['mongo_username'],
"password" => $conf['mongo_password']
]);
} else {
$Client = new \MongoDB\Client($database);
}
self::$Driver = new QuiqqerMongoDriver([
'mongo' => new \MongoDB\Client($database),
'mongo' => $Client,
'database' => $database,
'collection' => $collection
]);
......
......@@ -2714,6 +2714,12 @@
<locale name="quiqqer.settings.longTimeCache.mongo.server">
<de><![CDATA[MongoDB Server]]></de>
</locale>
<locale name="quiqqer.settings.longTimeCache.mongo.username">
<de><![CDATA[MongoDB Bentzername]]></de>
</locale>
<locale name="quiqqer.settings.longTimeCache.mongo.password">
<de><![CDATA[MongoDB Passwort]]></de>
</locale>
<locale name="quiqqer.settings.longTimeCache.mongo_collection.server">
<de><![CDATA[MongoDB Collection]]></de>
</locale>
......
......@@ -2657,6 +2657,12 @@ You can also ignore the console user permissions check with '--ignore-file-permi
<locale name="quiqqer.settings.longTimeCache.mongo.server">
<en><![CDATA[MongoDB Server]]></en>
</locale>
<locale name="quiqqer.settings.longTimeCache.mongo.username">
<en><![CDATA[MongoDB Username]]></en>
</locale>
<locale name="quiqqer.settings.longTimeCache.mongo.password">
<en><![CDATA[MongoDB Password]]></en>
</locale>
<locale name="quiqqer.settings.longTimeCache.mongo_collection.server">
<en><![CDATA[MongoDB Collection]]></en>
</locale>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment