mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-12-29 05:21:01 +00:00
Merge pull request #198 from zoff-music/fix/password-set-fix
Fixed issue where setting password was faulty on entering channel a s…
This commit is contained in:
@@ -119,7 +119,6 @@ var Admin = {
|
|||||||
}
|
}
|
||||||
names = ["vote","addsongs","longsongs","frontpage", "allvideos",
|
names = ["vote","addsongs","longsongs","frontpage", "allvideos",
|
||||||
"removeplay", "skip", "shuffle", "userpass"];
|
"removeplay", "skip", "shuffle", "userpass"];
|
||||||
|
|
||||||
Crypt.set_pass(chan.toLowerCase(), Crypt.tmp_pass);
|
Crypt.set_pass(chan.toLowerCase(), Crypt.tmp_pass);
|
||||||
|
|
||||||
for (var i = 0; i < names.length; i++) {
|
for (var i = 0; i < names.length; i++) {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ var Chat = {
|
|||||||
var password = input[1];
|
var password = input[1];
|
||||||
temp_name = name;
|
temp_name = name;
|
||||||
temp_pass = password;
|
temp_pass = password;
|
||||||
password = Crypt.crypt_pass(password);
|
password = Crypt.crypt_chat_pass(password);
|
||||||
socket.emit("namechange", {name: name, channel: chan.toLowerCase(), password: password, first: first});
|
socket.emit("namechange", {name: name, channel: chan.toLowerCase(), password: password, first: first});
|
||||||
} else if(input.length == 3) {
|
} else if(input.length == 3) {
|
||||||
var name = input[0];
|
var name = input[0];
|
||||||
@@ -21,8 +21,8 @@ var Chat = {
|
|||||||
temp_name = name;
|
temp_name = name;
|
||||||
temp_pass = password;
|
temp_pass = password;
|
||||||
|
|
||||||
new_password = Crypt.crypt_pass(new_password);
|
new_password = Crypt.crypt_chat_pass(new_password);
|
||||||
old_password = Crypt.crypt_pass(old_password);
|
old_password = Crypt.crypt_chat_pass(old_password);
|
||||||
|
|
||||||
socket.emit("namechange", {name: name, channel: chan.toLowerCase(), new_password: new_password, old_password: old_password});
|
socket.emit("namechange", {name: name, channel: chan.toLowerCase(), new_password: new_password, old_password: old_password});
|
||||||
} else {
|
} else {
|
||||||
@@ -83,7 +83,7 @@ var Chat = {
|
|||||||
} else if($(".chat-tab-li a.active").attr("href") == "#all_chat") {
|
} else if($(".chat-tab-li a.active").attr("href") == "#all_chat") {
|
||||||
socket.emit("all,chat", {channel: chan.toLowerCase(), data: data.value});
|
socket.emit("all,chat", {channel: chan.toLowerCase(), data: data.value});
|
||||||
} else {
|
} else {
|
||||||
socket.emit("chat", {channel: chan.toLowerCase(), data: data.value, pass: embed ? '' : Crypt.crypt_pass(Crypt.get_userpass(chan.toLowerCase()))});
|
socket.emit("chat", {channel: chan.toLowerCase(), data: data.value, pass: embed ? '' : Crypt.crypt_chat_pass(Crypt.get_userpass(chan.toLowerCase()))});
|
||||||
}
|
}
|
||||||
data.value = "";
|
data.value = "";
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -198,8 +198,7 @@ var Crypt = {
|
|||||||
return conf_arr.remote;
|
return conf_arr.remote;
|
||||||
},
|
},
|
||||||
|
|
||||||
crypt_pass: function(pass) {
|
crypt_chat_pass: function(pass) {
|
||||||
Crypt.tmp_pass = pass;
|
|
||||||
var key = btoa(socket.id) + btoa(socket.id);
|
var key = btoa(socket.id) + btoa(socket.id);
|
||||||
key = key.substring(0,32);
|
key = key.substring(0,32);
|
||||||
key = btoa(key);
|
key = btoa(key);
|
||||||
@@ -217,6 +216,11 @@ var Crypt = {
|
|||||||
return encrypted.toString() + "$" + iv;
|
return encrypted.toString() + "$" + iv;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
crypt_pass: function(pass) {
|
||||||
|
Crypt.tmp_pass = pass;
|
||||||
|
return Crypt.crypt_chat_pass(pass);
|
||||||
|
},
|
||||||
|
|
||||||
makeiv: function() {
|
makeiv: function() {
|
||||||
var text = "";
|
var text = "";
|
||||||
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
||||||
|
|||||||
Reference in New Issue
Block a user