From b8d7ae91d0199003173ea3c581404d66538a3fba Mon Sep 17 00:00:00 2001 From: joshtriplett Date: Wed, 9 May 2007 02:05:32 +0000 Subject: * 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. --- IkiWiki/Plugin/passwordauth.pm | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'IkiWiki') 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(""); @@ -51,6 +52,13 @@ sub formbuilder_setup (@) { #{{{ shift eq $form->field("password"); }, ); + $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", -- cgit v1.2.3