]> scripts.mit.edu Git - www/ikiwiki.git/blobdiff - IkiWiki/Plugin/lockedit.pm
lockedit: Detect if no authentication plugins are enabled, and die with an error...
[www/ikiwiki.git] / IkiWiki / Plugin / lockedit.pm
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;