3 Most automated link/spambots load the edit screen and try to send a
4 submit response immediately after that. This plugin enforces a short
5 delay of 5 seconds before save submissions are accepted - an error
6 message is displayed to users who hit [save] too quickly after the
8 This will defend the majority of current bots and zombie computers.
9 And never forget: 'time is money' even more so counts for spammers.
10 A later version may need to hash-assert the timestamp (with nonce).
11 Idea taken from phpBB2 "disable_spambots" by <magenta*trikuare.cx>.
16 define("EWIKI_UP_SAVE_DELAY", "e_g_t");
17 define("EWIKI_EDIT_SAVE_DELAY", 5);
21 $ewiki_plugins["edit_form_append"][] = "ewiki_aedit_antibot_delay";
22 function ewiki_aedit_antibot_delay($id, &$data, $action) {
23 return('<input type="hidden" name="'.EWIKI_UP_SAVE_DELAY.'" value="'.time().'" />');
28 $ewiki_plugins["edit_save"][] = "ewiki_edit_save_antibot_delay";
29 function ewiki_edit_save_antibot_delay(&$save, &$data) {
32 if (!isset($GLOBALS["ewiki_no_bot"])) {
33 if (time() < $_REQUEST[EWIKI_UP_SAVE_DELAY] + EWIKI_EDIT_SAVE_DELAY) {
35 $ewiki_errmsg = ewiki_t("Too hasty saving rejected. Please go back, wait 3 seconds and hit [save] again.");