mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Fixed shuffle issue where users not logged in could not shuffle
This commit is contained in:
@@ -431,11 +431,12 @@ io.on('connection', function(socket){
|
|||||||
|
|
||||||
socket.on('shuffle', function(pass)
|
socket.on('shuffle', function(pass)
|
||||||
{
|
{
|
||||||
if(pass !== undefined && pass !== null && pass != "")
|
if(pass !== undefined && pass !== null)
|
||||||
{
|
{
|
||||||
check_inlist(coll, guid, socket, name);
|
check_inlist(coll, guid, socket, name);
|
||||||
|
|
||||||
var hash = hash_pass(pass);
|
if(pass == "") var hash = pass;
|
||||||
|
else var hash = hash_pass(pass);
|
||||||
db.collection(coll).find({views:{$exists:true}}, function(err, docs){
|
db.collection(coll).find({views:{$exists:true}}, function(err, docs){
|
||||||
if(docs !== null && docs.length != 0 && ((docs[0]["adminpass"] == hash || docs[0]["adminpass"] == "") || docs[0]["shuffle"] == false))
|
if(docs !== null && docs.length != 0 && ((docs[0]["adminpass"] == hash || docs[0]["adminpass"] == "") || docs[0]["shuffle"] == false))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -146,7 +146,8 @@ function remove_bar()
|
|||||||
|
|
||||||
function shuffle()
|
function shuffle()
|
||||||
{
|
{
|
||||||
socket.emit('shuffle', adminpass);
|
var pass_to_send = adminpass !== undefined ? adminpass : "";
|
||||||
|
socket.emit('shuffle', pass_to_send);
|
||||||
}
|
}
|
||||||
|
|
||||||
function rnd(arr)
|
function rnd(arr)
|
||||||
|
|||||||
@@ -85,8 +85,7 @@ $(document).ready(function()
|
|||||||
};
|
};
|
||||||
img.crossOrigin = 'Anonymous';
|
img.crossOrigin = 'Anonymous';
|
||||||
img.src = 'http://img.youtube.com/vi/NuEfvIca0XU/mqdefault.jpg';
|
img.src = 'http://img.youtube.com/vi/NuEfvIca0XU/mqdefault.jpg';
|
||||||
*/
|
*/
|
||||||
|
|
||||||
setup_youtube_listener(chan);
|
setup_youtube_listener(chan);
|
||||||
//Materialize.toast("Passwords have been reset. If anything is not right, please send us a mail @ contact@zoff.no", 10000);
|
//Materialize.toast("Passwords have been reset. If anything is not right, please send us a mail @ contact@zoff.no", 10000);
|
||||||
$("#settings").sideNav({
|
$("#settings").sideNav({
|
||||||
|
|||||||
Reference in New Issue
Block a user