added: antispam mechanism
each html form has a hidden form_id and counter_id counter_id on the client side is generated through javascript code on the server the form_id and counter_id is stored in the session after sending the html form the server checks the form_id and counter_id git-svn-id: svn://ttmath.org/publicrep/winix/trunk@1116 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
19
winixd/html/antispam.html
Normal file
19
winixd/html/antispam.html
Normal file
@@ -0,0 +1,19 @@
|
||||
|
||||
|
||||
<input type="hidden" name="winix_form_id" value="[antispam_create_new_form_id_for_this_session]">
|
||||
<input type="hidden" name="winix_form_counter" value="" class="winix_form_counter">
|
||||
|
||||
<script>
|
||||
[# call antispam_create_new_form_id_for_this_session before antispam_loop]
|
||||
function winix_calc_me()\{var counter = 0;[for antispam_loop]counter [antispam_loop_operator] [antispam_counter];[end]return counter;\}
|
||||
|
||||
var el = document.getElementsByClassName("winix_form_counter");
|
||||
var val = winix_calc_me();
|
||||
|
||||
for(var i=0 ; i<el.length ; ++i)
|
||||
\{
|
||||
console.log(el\[i\]);
|
||||
el\[i\].value = val;
|
||||
\}
|
||||
|
||||
</script>
|
||||
@@ -52,6 +52,8 @@
|
||||
<label for="winix_rebus_id">{rebus_how_is_it} [rebus_question]?</p>
|
||||
<input id="winix_rebus_id" type="text" name="rebus">
|
||||
</div>
|
||||
|
||||
[include "antispam.html"]
|
||||
[end]
|
||||
|
||||
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
|
||||
<p class="withnext">{rebus_how_is_it} [rebus_question]?</p>
|
||||
<input class="edit" type="text" name="rebus">
|
||||
|
||||
[include "antispam.html"]
|
||||
[end]
|
||||
|
||||
[if winix_function_param_is "postredirect"]
|
||||
|
||||
@@ -119,6 +119,8 @@
|
||||
<label for="winix_rebus_id">{rebus_how_is_it} [rebus_question]?</p>
|
||||
<input id="winix_rebus_id" type="text" name="rebus">
|
||||
</div>
|
||||
|
||||
[include "antispam.html"]
|
||||
[end]
|
||||
|
||||
|
||||
|
||||
@@ -28,6 +28,8 @@
|
||||
<label for="winix_rebus_id">{rebus_how_is_it} [rebus_question]?</label>
|
||||
<input id="winix_rebus_id" type="text" name="rebus">
|
||||
</div>
|
||||
|
||||
[include "antispam.html"]
|
||||
[end]
|
||||
|
||||
[if winix_function_param_is "postredirect"]
|
||||
|
||||
@@ -48,6 +48,8 @@
|
||||
|
||||
<p class="withnext">{rebus_how_is_it} [rebus_question]?</p>
|
||||
<input class="edit" type="text" name="rebus">
|
||||
|
||||
[include "antispam.html"]
|
||||
[end]
|
||||
|
||||
[if winix_function_param_is "postredirect"]
|
||||
|
||||
@@ -47,6 +47,8 @@
|
||||
<label for="">{rebus_how_is_it} [rebus_question]?</p>
|
||||
<input type="text" name="rebus">
|
||||
</div>
|
||||
|
||||
[include "antispam.html"]
|
||||
[end]
|
||||
|
||||
[if winix_function_param_is "postredirect"]
|
||||
|
||||
@@ -39,6 +39,8 @@
|
||||
|
||||
<p class="withnext">{rebus_how_is_it} [rebus_question]?</p>
|
||||
<input class="edit" type="text" name="rebus">
|
||||
|
||||
[include "antispam.html"]
|
||||
[end]
|
||||
|
||||
[if winix_function_param_is "postredirect"]
|
||||
|
||||
@@ -41,6 +41,8 @@
|
||||
|
||||
<p class="withnext">{rebus_how_is_it} [rebus_question]?</p>
|
||||
<input class="edit" type="text" name="rebus">
|
||||
|
||||
[include "antispam.html"]
|
||||
[end]
|
||||
|
||||
[if winix_function_param_is "postredirect"]
|
||||
|
||||
Reference in New Issue
Block a user