Fix for list without conf

This commit is contained in:
Kasper Rynning-Tønnesen
2018-03-03 15:51:11 +01:00
parent 76776cdcd4
commit 5c1e91467f
4 changed files with 23 additions and 19 deletions

View File

@@ -33,7 +33,7 @@ function password(inp, coll, guid, offline, socket) {
{
if(docs[0].adminpass === "" || docs[0].adminpass == Functions.hash_pass(opw))
{
db.collection(coll + "_settings").update({views:{$exists:true}}, {$set:{adminpass:Functions.hash_pass(pw)}}, function(err, docs){
db.collection(coll + "_settings").update({ id: "config" }, {$set:{adminpass:Functions.hash_pass(pw)}}, function(err, docs){
if(inp.oldpass)
socket.emit("toast", "changedpass");
else
@@ -136,7 +136,7 @@ function conf_function(params, coll, guid, offline, socket) {
} else if (frontpage) {
obj["userpass"] = "";
}
db.collection(coll + "_settings").update({views:{$exists:true}}, {
db.collection(coll + "_settings").update({ id: "config" }, {
$set:obj
}, function(err, docs){
db.collection(coll + "_settings").find(function(err, docs){