From 41d0245ac1044b22e25bfdfc5b20c17e68c384e4 Mon Sep 17 00:00:00 2001 From: Hao_Tian22 Date: Sat, 28 Jan 2023 02:38:57 +0800 Subject: [PATCH] purecool Login-Fix --- theme/purecool.html | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/theme/purecool.html b/theme/purecool.html index 3e2d88a..ed1282b 100644 --- a/theme/purecool.html +++ b/theme/purecool.html @@ -457,8 +457,9 @@
-
+ +
@@ -1246,6 +1247,35 @@ document.getElementById('login_div').style.top=(window.innerHeight-document.getElementById('login_div').offsetHeight)/2+document.body.scrollTop +'px'; document.getElementById('login_input').focus(); } + function sha1loginpass(f) { + if (f.password1.value == "") return false; + try { + timestamp = new Date().getTime() + ""; + timestamp = timestamp.substr(0, timestamp.length - 3); + f.timestamp.value = timestamp; + f.password1.value = sha1(timestamp + "" + f.password1.value); + return true; + } catch { + //alert("sha1.js not loaded."); + if (confirm("sha1.js not loaded.\n\nLoad from program?")) loadjs("?jsFile=sha1.min.js"); + return false; + } + } + function loadjs(url) { + var xhr = new XMLHttpRequest; + xhr.open("GET", url); + xhr.onload = function (e) { + if (xhr.status == 200) { + var script = document.createElement("script"); + script.type = "text/javascript"; + script.text = xhr.responseText; + document.body.appendChild(script); + } else { + console.log(xhr.response); + } + } + xhr.send(null); + } document.getElementById('password1').focus();