lockedit: Detect if no authentication plugins are enabled, and die with an error...
authorJoey Hess <joey@gnu.kitenet.net>
Mon, 4 Jan 2010 20:01:25 +0000 (15:01 -0500)
committerJoey Hess <joey@gnu.kitenet.net>
Mon, 4 Jan 2010 20:01:25 +0000 (15:01 -0500)
IkiWiki/Plugin/lockedit.pm
debian/changelog

index 0fa329251f0b7eb5e6814e50f68d020eaf047eb8..8914ba49802b1f2d60fbe5142c0e24180981c387 100644 (file)
@@ -7,6 +7,7 @@ use IkiWiki 3.00;
 
 sub import {
        hook(type => "getsetup", id => "lockedit", call => \&getsetup);
+       hook(type => "checkconfig", id => "lockedit", call => \&checkconfig);
        hook(type => "canedit", id => "lockedit", call => \&canedit);
 }
 
@@ -26,6 +27,12 @@ sub getsetup () {
                },
 }
 
+sub checkconfig () {
+       if (! exists $IkiWiki::hooks{auth}) {
+               error gettext("lockedit plugin is enabled, but no authentication plugins are enabled");
+       }
+}
+
 sub canedit ($$) {
        my $page=shift;
        my $cgi=shift;
index aa4f1ac3c94f142ea0c8b3d159a1e7c0999dee10..2c121ef54f7a20e6c97344c60c68d864d516f6fb 100644 (file)
@@ -4,6 +4,8 @@ ikiwiki (3.20100104) UNRELEASED; urgency=low
     (Sjoerd)
   * signinedit: Auto-disable the plugin when all authentication methods
     are disabled.
+  * lockedit: Detect if no authentication plugins are enabled, and
+    die with an error message as this configuration does not make sense.
 
  -- Joey Hess <joeyh@debian.org>  Mon, 04 Jan 2010 12:53:24 -0500