]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/passwordauth.pm
web commit by hb
[git.ikiwiki.info.git] / IkiWiki / Plugin / passwordauth.pm
index a2e774c36e96c694207ec0505f2faddcdb7bc884..1520cea837c5a5b014bcab4b4763930ac0059cdb 100644 (file)
@@ -26,6 +26,7 @@ sub formbuilder_setup (@) { #{{{
                
                if ($form->submitted eq "Register" || $form->submitted eq "Create Account") {
                        $form->field(name => "confirm_password", type => "password");
                
                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("");
                        $form->field(name => "email", size => 50);
                        $form->title("register");
                        $form->text("");
@@ -51,6 +52,13 @@ sub formbuilder_setup (@) { #{{{
                                                shift eq $form->field("password");
                                        },
                                );
                                                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",
                                $form->field(
                                        name => "email",
                                        validate => "EMAIL",