implemented security counter of IP answering incorrect to captcha, to ban the IP for some time

This commit is contained in:
arnaucode
2017-08-09 20:34:09 +02:00
parent 9adf62a5df
commit 9262080f54
11 changed files with 95 additions and 20 deletions

View File

@@ -1,4 +1,6 @@
#goCaptcha{
max-width: 380px;
}
.c_blue300{
background: #64B5F6!important;
color: #ffffff!important;
@@ -7,6 +9,10 @@
background: #E57373!important;
color: #ffffff!important;
}
.c_green300{
background: #81C784!important;
color: #ffffff!important;
}
.g_button{
border: none;
border-radius: 2px;
@@ -31,8 +37,8 @@
float: right;
}
.g_selected{
border: 4px solid yellow;
border: 5px solid #64B5F6;
}
.g_unselected{
border: 4px solid white;
border: 5px solid white;
}

View File

@@ -33,7 +33,7 @@ function showCaptcha(captcha) {
html = "";
html += "<h2>Select all " + captcha.question + "s</h2>";
for (k in captcha.imgs) {
html += "<img id='" + k + "' onclick='selectCaptchaImg(this)' src='" + goCaptchaURL + "/image/" + captcha.imgs[k] + "' style='width:150px;cursor:pointer;' />";
html += "<img id='" + k + "' onclick='selectCaptchaImg(this)' src='" + goCaptchaURL + "/image/" + captcha.imgs[k] + "' style='width:120px;cursor:pointer;' class='g_unselected' />";
}
html += "<div onclick='validateCaptcha()' class='g_button c_blue300 g_floatRight'>Validate</div>";
document.getElementById("goCaptcha").innerHTML = html;
@@ -59,6 +59,7 @@ function validateCaptcha() {
var html = "";
if (resp) {
html += "<h2>goCaptcha validated</h2>";
html += "<div onclick='getCaptcha()' class='g_button c_green300 g_floatRight'>Reload Captcha</div>";
} else {
html += "<h2>goCaptcha failed</h2>";
html += "<div onclick='getCaptcha()' class='g_button c_red300 g_floatRight'>Reload Captcha</div>";

View File

@@ -13,14 +13,14 @@
<br>
<div class="container">
<div class="row">
<div class="col-sm-3"></div>
<div class="col-sm-6">
<div class="col-sm-4"></div>
<div class="col-sm-5">
<div class="panel panel-default">
<div class="panel-heading c_blue300">
<h3 class="panel-title">goCaptcha</h3>
</div>
<div class="panel-body">
<div id="goCaptcha"></div>
<div id="goCaptcha">Getting goCaptcha data from server</div>
</div>
</div>
</div>