summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin
diff options
context:
space:
mode:
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r--IkiWiki/Plugin/passwordauth.pm8
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",
);