mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +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",
|
||||
"removeplay", "skip", "shuffle", "userpass"];
|
||||
|
||||
Crypt.set_pass(chan.toLowerCase(), Crypt.tmp_pass);
|
||||
|
||||
for (var i = 0; i < names.length; i++) {
|
||||
|
||||
@@ -11,7 +11,7 @@ var Chat = {
|
||||
var password = input[1];
|
||||
temp_name = name;
|
||||
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});
|
||||
} else if(input.length == 3) {
|
||||
var name = input[0];
|
||||
@@ -21,8 +21,8 @@ var Chat = {
|
||||
temp_name = name;
|
||||
temp_pass = password;
|
||||
|
||||
new_password = Crypt.crypt_pass(new_password);
|
||||
old_password = Crypt.crypt_pass(old_password);
|
||||
new_password = Crypt.crypt_chat_pass(new_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});
|
||||
} else {
|
||||
@@ -83,7 +83,7 @@ var Chat = {
|
||||
} else if($(".chat-tab-li a.active").attr("href") == "#all_chat") {
|
||||
socket.emit("all,chat", {channel: chan.toLowerCase(), data: data.value});
|
||||
} 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 = "";
|
||||
return;
|
||||
|
||||
@@ -198,8 +198,7 @@ var Crypt = {
|
||||
return conf_arr.remote;
|
||||
},
|
||||
|
||||
crypt_pass: function(pass) {
|
||||
Crypt.tmp_pass = pass;
|
||||
crypt_chat_pass: function(pass) {
|
||||
var key = btoa(socket.id) + btoa(socket.id);
|
||||
key = key.substring(0,32);
|
||||
key = btoa(key);
|
||||
@@ -217,6 +216,11 @@ var Crypt = {
|
||||
return encrypted.toString() + "$" + iv;
|
||||
},
|
||||
|
||||
crypt_pass: function(pass) {
|
||||
Crypt.tmp_pass = pass;
|
||||
return Crypt.crypt_chat_pass(pass);
|
||||
},
|
||||
|
||||
makeiv: function() {
|
||||
var text = "";
|
||||
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
||||
|
||||
Reference in New Issue
Block a user