]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/lockedit.pm
Allow jumping directly into account registration process by going to ikiwiki.cgi...
[git.ikiwiki.info.git] / IkiWiki / Plugin / lockedit.pm
index 8914ba49802b1f2d60fbe5142c0e24180981c387..74ddbb1537929189206f675fdb49bfbf9247837c 100644 (file)
@@ -7,7 +7,6 @@ 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);
 }
 
@@ -27,12 +26,6 @@ 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;
@@ -46,8 +39,9 @@ sub canedit ($$) {
                    user => $session->param("name"),
                    ip => $ENV{REMOTE_ADDR},
            )) {
-               if (! defined $user ||
-                   ! IkiWiki::userinfo_get($session->param("name"), "regdate")) {
+               if ((! defined $user ||
+                   ! IkiWiki::userinfo_get($session->param("name"), "regdate")) &&
+                   exists $IkiWiki::hooks{auth}) {
                        return sub { IkiWiki::needsignin($cgi, $session) };
                }
                else {