bot validierung durch Zeitmessung, Interaktionsmessung und Honeypot eingerichtet.
This commit is contained in:
parent
5bd72ad89e
commit
a32e4a9d4b
11 changed files with 99 additions and 117 deletions
|
|
@ -1,6 +1,28 @@
|
|||
window.onload = function () {
|
||||
|
||||
// initieiere Zeitmessung zur Botprevention
|
||||
var startTime = Date.now();
|
||||
|
||||
// Messe ob mit der Seite agiert wird
|
||||
var userInteracted = false;
|
||||
|
||||
function setUserInteracted() {
|
||||
userInteracted = true;
|
||||
}
|
||||
|
||||
document.addEventListener("mousedown", setUserInteracted);
|
||||
document.addEventListener("touchstart", setUserInteracted);
|
||||
document.addEventListener("keydown", setUserInteracted);
|
||||
|
||||
document.getElementById('formular').addEventListener('submit', function (e) {
|
||||
e.preventDefault(); // Verhindert die Standard-Formularsendung
|
||||
|
||||
var endTime = Date.now();
|
||||
var timeSpent = (endTime - startTime) / 1000; // Zeit in Sekunden
|
||||
document.getElementById("age").value = timeSpent;
|
||||
|
||||
document.getElementById("hobbies").value = userInteracted ? "1" : "0";
|
||||
|
||||
const form = e.target;
|
||||
const zsrNummer = form.elements['zsr_nummer'].value;
|
||||
const isNumberOrBeantragt = /^\d+$|^beantragt$/i.test(zsrNummer);
|
||||
|
|
|
|||
|
|
@ -260,12 +260,22 @@ table .far {
|
|||
margin-right: auto;
|
||||
}
|
||||
|
||||
.accordion-collapse {
|
||||
max-height: 0;
|
||||
overflow: hidden;
|
||||
transition: max-height 0.3s ease;
|
||||
}
|
||||
|
||||
.fadeOut {
|
||||
@apply transition-opacity duration-500 ease-in-out opacity-0;
|
||||
}
|
||||
.fadeIn {
|
||||
@apply transition-opacity duration-1000 ease-in-out opacity-100;
|
||||
}
|
||||
#verify_email, #age, #hobbies {
|
||||
display:none;
|
||||
}
|
||||
|
||||
|
||||
/**************** Component Styles ******************/
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue