Plugin for visual confirmation of new user registration, to prevent automated scripts to create users and spam your wiki with their url's to get a better google ranking.
Plugin settings are stored as preferences variables. To reference a plugin setting write %<plugin>_<setting>%
, i.e. %INTERWIKIPLUGIN_SHORTDESCRIPTION%
data/debug.txt
)
none
for 0): none
for 0): none
for 0%):
Note: You do not need to install anything on the browser to use this plugin. The following instructions are for the administrator who installs the plugin on the server where TWiki is running.
CaptchaPlugin.zip
in your twiki installation directory. Content: File: | Description: |
---|---|
data/TWiki/VisualConfirmPlugin.txt | Plugin topic |
data/TWiki/VisualConfirmPlugin.txt,v | Plugin topic repository |
register.patch | Patch for the register binary |
templates/oopsregvisualconfirm.tmpl | Error template |
lib/TWiki/Plugins/CaptchaPlugin.pm | Plugin Perl module |
register.patch
to bin/register
(alternatively, patch register manual, see section below): visualconfirm
and visualconfirm/db
in your pub/
directory, and make sure it is readable and writable by the user that TWiki is executing as. <Directory "/path/to/twiki/pub/visualconfirm/db"> deny from all </Directory>
.ttf
file in pub/visualconfirm/
<IMG SRC="%VISUALCONFIRMURL%">
and %VISUALCONFIRMHASH%
Twk1VisualConfirm
Twk1VisualConfirmHash
<tr> <td valign="top" align="right"><IMG SRC="%VISUALCONFIRMURL%">: <br /> (..) </td> <td><input type="hidden" name="Twk1VisualConfirmHash" value="%VISUALCONFIRMHASH%"> <input type="text" name="Twk1VisualConfirm" size="5"></td> </tr>
Find the line in bin/register
that says:
# everything OK
Insert the code below directly BEFORE that line:
# check valid visual confirmation for( $x = 0; $x < $formLen; $x++ ) { $vcHash=$formDataValue[$x] unless(not($formDataName[$x] eq "Visual Confirm Hash")); $vcTxt=$formDataValue[$x] unless(not($formDataName[$x] eq "Visual Confirm")); } open(LOCKFILE,">".&TWiki::getPubDir()."/visualconfirm/db/hashes.lock"); flock(LOCKFILE,2); dbmopen(%database, &TWiki::getPubDir()."/visualconfirm/db/hashes" ,0644); if(!defined($database{$vcHash})) { $url = &TWiki::getOopsUrl( $webName, $topic, "oopsregvisualconfirm", "The visual confirmation has expired."); TWiki::redirect( $query, $url ); return; } my ($time,$txt)=split(',',$database{$vcHash}); if(not(lc($txt) eq lc($vcTxt))) { $url = &TWiki::getOopsUrl( $webName, $topic, "oopsregvisualconfirm", "The character string you entered for visual confirmation is incorrect."); TWiki::redirect( $query, $url ); return; } dbmclose(%database); close(LOCKFILE);
Plugin Author: | TWiki:Main.KoenMartens |
Plugin Version: | 03 Jan 2006 (V1.001) |
Change History: | |
07 Oct 2005: | Initial version |
10 Oct 2005: | Strip hash and text from arguments to register binary, or they will end up in the newly created user topic. |
03 Jan 2006: | Fixed some problems with expiry, also optimised according to TWiki:TWiki.TWikiPlugins#FastPluginHints. |
TWiki Dependency: | $TWiki::Plugins::VERSION 1.024 |
CPAN Dependencies: | GD, Digest::MD5 |
Other Dependencies: | none |
Perl Version: | 5.005 |
License: | GPL (GNU General Public License) |
TWiki:Plugins/Benchmark: | GoodStyle 98%, FormattedSearch 98%, TWikiRegistration (patched) 85% |
Plugin Home: | http://TWiki.org/cgi-bin/view/Plugins/CaptchaPlugin |
Feedback: | http://TWiki.org/cgi-bin/view/Plugins/CaptchaPluginDev |
Appraisal: | http://TWiki.org/cgi-bin/view/Plugins/CaptchaPluginAppraisal |
Related Topics: TWikiPreferences, TWikiPlugins
-- TWiki:Main.KoenMartens - 07 Oct 2005