Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
CaptchaPluginA visual confirmation plugin, known as Captcha, for new user registration. This plugin prevents automated scripts in creating users and spam your wiki with their url's to get a better google ranking. | ||||||||
Line: 32 to 32 | ||||||||
| ||||||||
Added: | ||||||||
> > | Additionally, the following settings can be added to lib/LocalSite.cfg . In time, the above options will be moved to that file too.
| |||||||
Plugin Installation InstructionsNote: 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. | ||||||||
Line: 44 to 49 | ||||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
<Directory "/path/to/twiki/pub/TWiki/CaptchaPlugin/_db"> deny from all </Directory> | ||||||||
Added: | ||||||||
> > | <Directory "/path/to/twiki/pub/TWiki/CaptchaPlugin/fonts"> deny from all </Directory> <Directory "/path/to/twiki/pub/TWiki/CaptchaPlugin/img"> deny from all </Directory> | |||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
| ||||||||
Line: 77 to 90 | ||||||||
| ||||||||
Added: | ||||||||
> > | Captcha on topic editIf you want to protect edits by TWikiGuest with a captcha, add the following line to yourlib/LocalSite.cfg :
$TWiki::cfg{Plugins}{CaptchaPlugin}{EnableSave} = 1;Of course, you will need the Twk1CaptchaHash and Twk1CaptchaString input fields somewhere in your edit template. For example, if you are using the default pattern skin, change templates/edit.pattern.tmpl . Find:
%TMPL:DEF{"textarea"}%<textarea class="twikiEditboxStyleProportional" id="topic" name="text" rows="%EDITBOXHEIGHT%" cols="%EDITBOXWIDTH%" style='%EDITBOXSTYLE%' onkeydown='handleKeyDown(event)'>%TEXT%</textarea><script type="text/javascript">initTextAreaHeight();</script> %TMPL:END%and add before TMPL:END: %TMPL:DEF{"textarea"}%<textarea class="twikiEditboxStyleProportional" id="topic" name="text" rows="%EDITBOXHEIGHT%" cols="%EDITBOXWIDTH%" style='%EDITBOXSTYLE%' onkeydown='handleKeyDown(event)'>%TEXT%</textarea><script type="text/javascript">initTextAreaHeight();</script> <IMG SRC="/twiki/pub/TWiki/CaptchaPlugin/img/056326becad45e81c178005b129bfd23.png"/> <input type="hidden" name="Twk1CaptchaHash" value="056326becad45e81c178005b129bfd23"/> <input type="text" name="Twk1CaptchaString" size="5"/> %TMPL:END%You might want to hide the captcha for logged in users (context authenticated), see VarIF for more information on conditional rendering. | |||||||
Manually patching the register binary | ||||||||
Added: | ||||||||
> > | ||||||||
Refer to the patch file.
Guide for TWiki 4.0.5 | ||||||||
Line: 91 to 133 | ||||||||
Insert the code below directly BEFORE the line containing the curly bracket '{':
| ||||||||
Changed: | ||||||||
< < | # check captcha | |||||||
> > | # verify captcha | |||||||
my %database; my $vcHash=$data->{CaptchaHash}; my $vcTxt=$data->{CaptchaString}; | ||||||||
Line: 100 to 143 | ||||||||
dbmopen(%database, &TWiki::Func::getPubDir()."/TWiki/CaptchaPlugin/_db/hashes" ,0644); | ||||||||
Deleted: | ||||||||
< < | if(defined($database{$vcHash})) { throw TWiki::OopsException( 'captcha', web => $data->{webName}, topic => $topic, def => 'expired_vchash', params => [ "expired" ] ); } | |||||||
my ($time,$txt)=split(',',$database{$vcHash}); | ||||||||
Changed: | ||||||||
< < | if(not(lc($txt) eq lc($vcTxt))) { | |||||||
> > | if ( not(lc($txt) eq lc($vcTxt)) || ($txt eq '') ) { dbmclose(%database); close(LOCKFILE); | |||||||
throw TWiki::OopsException( 'captcha', web => $data->{webName}, topic => $topic, | ||||||||
Line: 123 to 160 | ||||||||
close(LOCKFILE); | ||||||||
Added: | ||||||||
> > | Now find:
# 'WikiName' omitted because they can't # change it, and 'Confirm' is a duplicate push( @{$data->{form}}, $form ) unless ($name eq 'WikiName' || $name eq 'Confirm');and change the last line to: # 'WikiName' omitted because they can't # change it, and 'Confirm' is a duplicate push( @{$data->{form}}, $form ) unless ($name eq 'WikiName' || $name eq 'Confirm' || $name eq 'CaptchaHash' || $name eq 'CaptchaString'); | |||||||
Further Development | ||||||||
Deleted: | ||||||||
< < |
| |||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
| ||||||||
Line: 137 to 190 | ||||||||
| ||||||||
Added: | ||||||||
> > |
| |||||||
| ||||||||
Line: 153 to 207 | ||||||||
| ||||||||
Deleted: | ||||||||
< < | -- TWiki:Main.KoenMartens - 03 Aug 2006 |