mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-12-08 20:48:48 +00:00
Search now always returns 6 answers hopefully
This commit is contained in:
@@ -163,6 +163,20 @@ io.on('connection', function(socket){
|
||||
}
|
||||
});
|
||||
|
||||
socket.on('password', function(pw)
|
||||
{
|
||||
|
||||
db.collection(coll).find({views:{$exists:true}}, function(err, docs){
|
||||
if(docs[0]["adminpass"] == "" || docs[0]["adminpass"] == hash_pass(pw))
|
||||
{
|
||||
db.collection(coll).update({views:{$exists:true}}, {$set:{adminpass:hash_pass(pw)}}, function(err, docs)
|
||||
{
|
||||
socket.emit("pw", pw);
|
||||
})
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
socket.on('skip', function(list)
|
||||
{
|
||||
db.collection(coll).find({skip: false}, function(err, docs){
|
||||
|
||||
Reference in New Issue
Block a user