mirror of
https://github.com/9001/copyparty.git
synced 2026-01-12 15:52:39 -07:00
Improve chpw UI
This commit is contained in:
parent
39c3ccc2eb
commit
e9a86d2d58
|
|
@ -5471,7 +5471,7 @@ class HttpCli(object):
|
||||||
no304vis=self.args.no304 > 0,
|
no304vis=self.args.no304 > 0,
|
||||||
msg=BADXFFB if hasattr(self, "bad_xff") else "",
|
msg=BADXFFB if hasattr(self, "bad_xff") else "",
|
||||||
ver=S_VERSION if show_ver else "",
|
ver=S_VERSION if show_ver else "",
|
||||||
chpw=self.args.chpw and self.uname != "*",
|
chpw=self.args.chpw and self.uname != "*" and self.uname not in self.args.chpw_no,
|
||||||
ahttps="" if self.is_https else "https://" + self.host + self.req,
|
ahttps="" if self.is_https else "https://" + self.host + self.req,
|
||||||
)
|
)
|
||||||
self.reply(html.encode("utf-8"))
|
self.reply(html.encode("utf-8"))
|
||||||
|
|
|
||||||
|
|
@ -213,6 +213,7 @@ var SR="{{ r }}",
|
||||||
dfavico="{{ favico }}";
|
dfavico="{{ favico }}";
|
||||||
|
|
||||||
var STG = window.localStorage;
|
var STG = window.localStorage;
|
||||||
|
var chpw_min = {{ this.args.chpw_len }};
|
||||||
document.documentElement.className = (STG && STG.cpp_thm) || "{{ this.args.theme }}";
|
document.documentElement.className = (STG && STG.cpp_thm) || "{{ this.args.theme }}";
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ Ls.eng = {
|
||||||
"lo2": "ends the session on all browsers",
|
"lo2": "ends the session on all browsers",
|
||||||
"u2": "time since the last server write$N( upload / rename / ... )$N$N17d = 17 days$N1h23 = 1 hour 23 minutes$N4m56 = 4 minutes 56 seconds",
|
"u2": "time since the last server write$N( upload / rename / ... )$N$N17d = 17 days$N1h23 = 1 hour 23 minutes$N4m56 = 4 minutes 56 seconds",
|
||||||
"v2": "use this server as a local HDD",
|
"v2": "use this server as a local HDD",
|
||||||
|
"tan": "ERROR: New password has to be at least $N characters",
|
||||||
"ta1": "fill in your new password first",
|
"ta1": "fill in your new password first",
|
||||||
"ta2": "repeat to confirm new password:",
|
"ta2": "repeat to confirm new password:",
|
||||||
"ta3": "found a typo; please try again",
|
"ta3": "found a typo; please try again",
|
||||||
|
|
@ -103,6 +104,9 @@ if (/\&re=/.test('' + location))
|
||||||
if (!pwi.value)
|
if (!pwi.value)
|
||||||
return ebi('lm').innerHTML = d.ta1;
|
return ebi('lm').innerHTML = d.ta1;
|
||||||
|
|
||||||
|
if (ebi('lp').value.length < chpw_min)
|
||||||
|
return ebi('lm').innerHTML = d.tan.replace('$N', chpw_min);
|
||||||
|
|
||||||
modal.prompt(d.ta2, "y", mok, null, stars);
|
modal.prompt(d.ta2, "y", mok, null, stars);
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue