* Add an account-creation password as a simple anti-spam mechanism. If
authorjoshtriplett <joshtriplett@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Wed, 9 May 2007 02:05:32 +0000 (02:05 +0000)
committerjoshtriplett <joshtriplett@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Wed, 9 May 2007 02:05:32 +0000 (02:05 +0000)
  set in the wiki setup, passwordauth will require the password in
  order to create an account.

IkiWiki.pm
IkiWiki/Plugin/passwordauth.pm
debian/changelog
doc/ikiwiki.setup

index 1d764bae268896aac2dfc8d0c88fb75ec5c1165b..aea5b7abf95da33edfd9fc9164622214d61cda91 100644 (file)
@@ -78,6 +78,7 @@ sub defaultconfig () { #{{{
        userdir => "",
        usedirs => 1,
        numbacklinks => 10,
+       account_creation_password => "",
 } #}}}
    
 sub checkconfig () { #{{{
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");
+                       $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",
index 7e0058c987ae0ac59bd99008fd7d0e13e415e8b4..455e3e7f08a94e477c88ecc34a7590cdf32a0069 100644 (file)
@@ -1,5 +1,6 @@
 ikiwiki (2.1) UNRELEASED; urgency=low
 
+  [ Joey Hess ]
   * Use div layout for the signin and preferences forms, so that they can be
     styled using the stylesheet, rather than by creating signin and prefs
     templates.
@@ -14,7 +15,12 @@ ikiwiki (2.1) UNRELEASED; urgency=low
   * Add the needsbuild hook. Plugins can use this to manipulate which files
     ikiwiki builds when refreshing the wiki.
 
- -- Joey Hess <joeyh@debian.org>  Tue, 08 May 2007 20:44:27 -0400
+  [ Josh Triplett ]
+  * 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.
+
+ -- Josh Triplett <josh@freedesktop.org>  Tue, 08 May 2007 19:05:21 -0700
 
 ikiwiki (2.00) unstable; urgency=low
 
index d498e8dfa158a15419181e686fdba25be8acd5ab..31561e20fd997b8befdf6e924583b8f9cc192fea 100644 (file)
@@ -99,6 +99,8 @@ use IkiWiki::Setup::Standard {
        #userdir => "users",
        # To create output files named page.html rather than page/index.html.
        #usedirs => 0,
+       # Simple spam prevention: require an account-creation password.
+       #account_creation_password => "example",
 
        # To add plugins, list them here.
        #add_plugins => [qw{goodstuff search wikitext camelcase