You've already forked docker-ldap-change-password-web-ui
Add captcha support
This commit is contained in:
@ -12,6 +12,36 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<script>
|
||||
function setSrcQuery(e, q) {
|
||||
var src = e.src;
|
||||
var p = src.indexOf('?');
|
||||
if (p >= 0) {
|
||||
src = src.substr(0, p);
|
||||
}
|
||||
e.src = src + "?" + q
|
||||
}
|
||||
function playAudio() {
|
||||
var le = document.getElementById("lang");
|
||||
var lang = le.options[le.selectedIndex].value;
|
||||
var e = document.getElementById('audio')
|
||||
setSrcQuery(e, "lang=" + lang)
|
||||
e.style.display = 'block';
|
||||
e.autoplay = 'true';
|
||||
return false;
|
||||
}
|
||||
function changeLang() {
|
||||
var e = document.getElementById('audio')
|
||||
if (e.style.display == 'block') {
|
||||
playAudio();
|
||||
}
|
||||
}
|
||||
function reload() {
|
||||
setSrcQuery(document.getElementById('image'), "reload=" + (new Date()).getTime());
|
||||
setSrcQuery(document.getElementById('audio'), (new Date()).getTime());
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
<main>
|
||||
<h1>{{.Title}}</h1>
|
||||
|
||||
@ -30,6 +60,14 @@
|
||||
<input id="confirm-password" name="confirm-password" type="password"
|
||||
pattern=".{8,}" x-moz-errormessage="Password must be at least 8 characters long." required>
|
||||
|
||||
<p>Type the numbers you see in the picture below:</p>
|
||||
<p>
|
||||
<img id=image src="/captcha/{{.CaptchaId}}.png" alt="Captcha image">
|
||||
</p>
|
||||
<a href="#" onclick="reload()">Reload</a>
|
||||
<input type=hidden name=captchaId value="{{.CaptchaId}}">
|
||||
<br>
|
||||
<input id="captchaSolution" name="captchaSolution" type="text" required>
|
||||
<button type="submit">Update password</button>
|
||||
</form>
|
||||
|
||||
|
Reference in New Issue
Block a user