1Uncaptcha.Timer(3kaya)       Kaya module reference      Uncaptcha.Timer(3kaya)
2
3
4

NAME

6       Uncaptcha::Timer - A time-based filter
7

SYNOPSIS

9       Uncaptcha::Timer< >
10
11
12     = Timer(String varname,Int mindelay,Int maxdelay)
13

DESCRIPTION

15       The  logic  behind  this  filter  is  described in a UseNet post by its
16       inventor Ben Bacarisse in the message 87abj0fbpy.fsf@bsb.me.uk
17
18       varname is the variable name that will be used to send the timing state
19       information  (the  information will be encrypted to prevent tampering).
20       You can use any non-empty value for this provided that it is not other‐
21       wise used in the form.
22
23       mindelay is the minimum delay in seconds between the form being created
24       and the user submitting it. This should be not be too large, or genuine
25       fast  users  of  the form may be blocked. If this value is negative, no
26       requests will be blocked for being too fast.
27
28       maxdelay is the maximum delay in seconds between the form being created
29       and  the  user  submitting  it.  This aims to prevent the 'distributed'
30       attacks where one hijacked computer obtains the form and places it into
31       a  queue, and another hijacked computer takes it from the queue several
32       hours later and submits it. The delay should not be too small, however,
33       especially  for  complex forms. If this value is negative, all requests
34       will be blocked.
35
36       You should always redisplay a form that fails this  check,  as  genuine
37       users may also trigger this check on rare occasions (or if you have set
38       the delays too harshly).
39
40
41    // in the form generating function
42        enableTimer(fieldset,myTimer);
43
44    // in the form handling function
45        if (checkTimer(myTimer)) {
46            // process the form or do further checks
47        } else {
48            // give an error message, redisplay the form.
49        }
50
51    // myTimer (sample values only - do not use!)
52    Timer myTimer = Timer("myvarname",20,10000);
53

AUTHORS

55       Kaya  standard  library  by  Edwin  Brady,  Chris  Morris  and   others
56       (kaya@kayalang.org). For further information see http://kayalang.org/
57

LICENSE

59       The  Kaya  standard  library  is free software; you can redistribute it
60       and/or modify it under the terms  of  the  GNU  Lesser  General  Public
61       License  (version  2.1  or  any later version) as published by the Free
62       Software Foundation.
63
65       Uncaptcha.checkTimer (3kaya)
66       Uncaptcha.enableTimer (3kaya)
67
68
69
70Kaya                             December 2010          Uncaptcha.Timer(3kaya)
Impressum