Changes between Version 2 and Version 3 of MathCaptchaPlugin
- Timestamp:
- Jul 6, 2009, 11:01:37 PM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
MathCaptchaPlugin
v2 v3 4 4 5 5 This is a small plugin to present an anonymous user with simple math addition problems in order to submit a new ticket or to make edits in the wiki. Currently there is no customization: it presents two integers in the range of 1 - 10 and asks the user to add them together. 6 7 == Version 2.0 == 8 9 I'm starting to see some particular spambots get through the simple captcha, so I'm releasing version 2.0 that includes a slight modification to the format presented to the user. In addition, this version now correctly works with fcgi and mod_python by saving the captcha information in the trac database. (To use mod_python as an example: apache may start many processes where each has its own embedded python interpreter. The particular apache process than displayed the form may not be the same one that processes the form request, so there must be a persistent way to store the solution to the captcha rather than making it easy for spambots by encoding the solution in the web page itself.) 10 11 I'm also keeping a 30 day record of failed attempts in the same database so you can get an idea of what sort of spambots are trying to get through your defenses. 6 12 7 13 For the future, would be nice if there were multiple types of math problems presented in a way that wouldn't be easy for a bot to recognize. … … 20 26 Download the zipped source from [download:mathcaptchaplugin here]. 21 27 22 == Source==28 == Install == 23 29 24 You can check out MathCaptchaPlugin from [http://trac-hacks.org/svn/mathcaptchaplugin here] using Subversion, or [source:mathcaptchaplugin browse the source] with Trac. 30 Install by either copying the !MathCaptcha.py file into your {{{/path/to/project/environment/plugins}}} directory, or use 31 {{{ 32 python setup.py install 33 }}} 34 from within the source directory. 25 35 26 == Example == 27 28 To enable the plugin, add the line: 29 36 Version 2.0 of the plugin creates a new database needed for processing captchas when run using fcgi or mod_python, so you'll have to run 37 {{{ 38 trac-admin /path/to/project/environment upgrade 39 }}} 40 before you can use the plugin. Once installed and the environment is upgraded, the plugin must be enabled by adding a line to the ''components'' section in trac.ini: 30 41 {{{ 31 42 [components] 32 43 mathcaptcha.* = enabled 33 44 }}} 45 Finally, give anonymous users any of the following permissions: '''TICKET_CREATE''', '''TICKET_MODIFY''', '''WIKI_CREATE''', or '''WIKI_MODIFY'''. Anonymous users will then be prompted to solve a math problem before being allowed to submit it, while authenticated users will not see the captcha. 34 46 35 to the ''components'' section in trac.ini. 47 == Source == 36 48 49 You can check out MathCaptchaPlugin from [http://trac-hacks.org/svn/mathcaptchaplugin here] using Subversion, or [source:mathcaptchaplugin browse the source] with Trac. 37 50 38 51 == Recent Changes ==