mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Update server.js
This commit is contained in:
committed by
GitHub
parent
c3ca04a747
commit
554912a18f
@@ -358,8 +358,8 @@ io.on('connection', function(socket){
|
|||||||
var list = msg.channel;
|
var list = msg.channel;
|
||||||
var pass = decrypt_string(socketid, msg.pass);
|
var pass = decrypt_string(socketid, msg.pass);
|
||||||
db.collection(list).find({views: {$exists: true}}, function(err, docs) {
|
db.collection(list).find({views: {$exists: true}}, function(err, docs) {
|
||||||
if(docs.length == 0 || docs[0].userpass == "" || docs[0].userpass == undefined || docs[0].userpass == pass) {
|
if(docs.length == 0 || (docs.length > 0 && (docs[0].userpass == undefined || docs[0].userpass == "" || docs[0].userpass == pass))) {
|
||||||
if(docs[0].userpass != "" && docs[0].userpass == pass) {
|
if(docs.length > 0 && docs[0].hasOwnProperty('userpass') && docs[0].userpass != "" && docs[0].userpass == pass) {
|
||||||
socket.emit("auth_accepted", {value: true});
|
socket.emit("auth_accepted", {value: true});
|
||||||
}
|
}
|
||||||
in_list = true;
|
in_list = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user