Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function doSend(what){ // main auth
- what.password.value=MD5(what.pass.value);
- what.password.value=MD5(what.password.value+what.nonce.value);
- what.pass.value=''; // NOT to send password as a plain text
- what.nonce.value='';// NOT to send random key
- what.pass.disabled=true;
- what.nonce.disabled=true;
- what.screenw.value=screen.width;
- }
- function checkNonce(f_nonce){
- c_nonce = getCookie('old_nonce');
- //f_nonce = what.nonce.value;
- //alert(c_nonce + '\n'+ f_nonce);
- if (c_nonce == f_nonce){
- window.location.reload();
- }
- }
- function getCookie(name) {
- var prefix = name + "="
- var cookieStartIndex = document.cookie.indexOf(prefix)
- if (cookieStartIndex == -1)
- return null
- var cookieEndIndex = document.cookie.indexOf(";", cookieStartIndex + prefix.length)
- if (cookieEndIndex == -1)
- cookieEndIndex = document.cookie.length
- return unescape(document.cookie.substring(cookieStartIndex + prefix.length, cookieEndIndex))
- }
- <script language="Javascript" src=img/js/md5.js></script>
- <form action="?handler" method=POST name=f onsubmit="doSend(this);">
- {tlog}:{tpass}
- <input type=text size=12 class=inp name=login value="{login}">:<input type=password size=12 class=inp name=pass>
- <input type=submit class=but value=">" {light}>
- <input type=hidden name=action value=auth><input type=hidden name=sub value=login>
- <input type=hidden name=password><input type=hidden name=nonce value={nonce}>
- <input type=hidden name=screenw>
- </form>
- <script language="Javascript">
- checkNonce(document.f.nonce.value);
- // window.location.reload();
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement