diff options
author | joshtriplett <joshtriplett@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2007-05-09 02:05:32 +0000 |
---|---|---|
committer | joshtriplett <joshtriplett@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2007-05-09 02:05:32 +0000 |
commit | b8d7ae91d0199003173ea3c581404d66538a3fba (patch) | |
tree | 9f59ae4f64f77ecf3e29bcf5d751816bc7724cbd /IkiWiki/Plugin | |
parent | 563ea1c56fbaeb33e0db5c10ed79cd6802927814 (diff) |
* Add an account-creation password as a simple anti-spam mechanism. If
set in the wiki setup, passwordauth will require the password in
order to create an account.
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r-- | IkiWiki/Plugin/passwordauth.pm | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/IkiWiki/Plugin/passwordauth.pm b/IkiWiki/Plugin/passwordauth.pm index a2e774c36..1520cea83 100644 --- a/IkiWiki/Plugin/passwordauth.pm +++ b/IkiWiki/Plugin/passwordauth.pm @@ -26,6 +26,7 @@ sub formbuilder_setup (@) { #{{{ if ($form->submitted eq "Register" || $form->submitted eq "Create Account") { $form->field(name => "confirm_password", type => "password"); + $form->field(name => "account_creation_password", type => "password") if (length $config{account_creation_password}); $form->field(name => "email", size => 50); $form->title("register"); $form->text(""); @@ -52,6 +53,13 @@ sub formbuilder_setup (@) { #{{{ }, ); $form->field( + name => "account_creation_password", + validate => sub { + shift eq $config{account_creation_password}; + }, + required => 1, + ) if (length $config{account_creation_password}); + $form->field( name => "email", validate => "EMAIL", ); |