mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Making the passwords more safe
This commit is contained in:
@@ -56,6 +56,7 @@
|
||||
<script type="text/javascript" src="static/js/lib/jquery-ui-1.10.3.min.js"></script>-->
|
||||
<script src="//cdn.socket.io/socket.io-1.2.0.js"></script>
|
||||
<script type="text/javascript" src="static/js/lib/iscroll-min.js"></script>
|
||||
<script src="http://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/sha256.js"></script>
|
||||
<script>
|
||||
var socket = io.connect('http://'+window.location.hostname+':3000');
|
||||
var guid = "<?php echo $guid; ?>";
|
||||
|
||||
@@ -14,7 +14,10 @@ socket.on("toast", function(msg)
|
||||
break;
|
||||
case "wrongpass":
|
||||
msg=rnd(["That's not the right password!", "Wrong! Better luck next time...", "You seem to have mistyped the password", "Incorrect. Have you tried meditating?","Nope, wrong password!", "Wrong password. The authorities have been notified."])
|
||||
break;
|
||||
if(localStorage[chan.toLowerCase()]){
|
||||
localStorage.removeItem(chan.toLowerCase());
|
||||
}
|
||||
break;
|
||||
case "shuffled":
|
||||
msg=rnd(["I vigorously stirred your playlist!", "I hope you like your list stirred, not shaken.", "I shuffled your playlist with the cosmic background radiation as a seed. Enjoy.", "100% randomized, for your listening pleasure!", "I hope you enjoy your fresh playlist!"])
|
||||
break;
|
||||
@@ -75,12 +78,13 @@ $('input[class=conf]').change(function()
|
||||
|
||||
function pass_save()
|
||||
{
|
||||
socket.emit('password', [document.getElementById("password").value, chan.toLowerCase(), guid]);
|
||||
|
||||
socket.emit('password', [CryptoJS.SHA256(document.getElementById("password").value).toString(), chan.toLowerCase(), guid]);
|
||||
}
|
||||
|
||||
function log_out(){
|
||||
if(localStorage[chan.toLowerCase()]){
|
||||
localStorage.removeItem(chan.toLowerCase())
|
||||
localStorage.removeItem(chan.toLowerCase());
|
||||
w_p = true;
|
||||
names=["vote","addsongs","longsongs","frontpage", "allvideos", "removeplay", "skip", "shuffle"];
|
||||
for (var i = 0; i < names.length; i++) {
|
||||
|
||||
@@ -104,7 +104,8 @@ $(document).ready(function()
|
||||
|
||||
if(localStorage[chan.toLowerCase()])
|
||||
{
|
||||
socket.emit("password", [localStorage[chan.toLowerCase()], chan.toLowerCase(), guid]);
|
||||
localStorage.removeItem(chan.toLowerCase());
|
||||
//socket.emit("password", [localStorage[chan.toLowerCase()], chan.toLowerCase(), guid]);
|
||||
}
|
||||
|
||||
if($("#chan").html().toLowerCase() == "jazz")
|
||||
|
||||
Reference in New Issue
Block a user