]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
move stub auth hook to loginselector
authorJoey Hess <joeyh@joeyh.name>
Wed, 13 May 2015 22:52:47 +0000 (18:52 -0400)
committerJoey Hess <joeyh@joeyh.name>
Wed, 13 May 2015 22:54:13 +0000 (18:54 -0400)
IkiWiki/Plugin/emailauth.pm
IkiWiki/Plugin/loginselector.pm

index 62c9fe877d733958c56b8413a875f9385cd8e333..3946ace03aadee7b6a4d4224da6bc0535c85b75f 100644 (file)
@@ -8,7 +8,6 @@ use IkiWiki 3.00;
 
 sub import {
        hook(type => "getsetup", id => "emailauth", "call" => \&getsetup);
-       hook(type => "auth", id => "emailauth", call => \&auth);
        IkiWiki::loadplugin("loginselector");
        IkiWiki::Plugin::loginselector::register_login_plugin(
                "emailauth",
@@ -55,10 +54,4 @@ sub email_auth ($$$) {
        error "EMAIL AUTH";
 }
 
-sub auth ($$) {
-       # While this hook is not currently used, it needs to exist
-       # so ikiwiki knows that the wiki supports logins, and will
-       # enable the Preferences page.
-}
-
 1
index b5e2056a409a4351c9a01119e5226079c997364c..1a322a53a918a3f59c33deb4ecab44037cf4856f 100644 (file)
@@ -77,6 +77,7 @@ sub import {
        add_underlay("jquery");
        hook(type => "getsetup", id => "loginselector",  call => \&getsetup);
        hook(type => "checkconfig", id => "loginselector", call => \&checkconfig);
+       hook(type => "auth", id => "loginselector", call => \&authstub);
 }
 
 sub checkconfig () {
@@ -91,13 +92,14 @@ sub checkconfig () {
                my $otherform_label=gettext("Other");
                if (keys %{$IkiWiki::hooks{auth}} > 1) {
                        $real_cgi_signin=\&IkiWiki::cgi_signin;
+                       # Special case to avoid labeling password auth as
+                       # "Other" when it's the only auth plugin not
+                       # integrated with the loginselector.
                        my %h=%{$IkiWiki::hooks{auth}};
                        foreach my $p (keys %login_plugins) {
                                delete $h{$p};
                        }
-                       # Special case to avoid labeling password auth as
-                       # "Other" when it's the only auth plugin not
-                       # integrated with the loginselector.
+                       delete $h{loginselector};
                        if (keys %h == 1 && exists $h{passwordauth}) {
                                $otherform_label=gettext("Password");
                        }
@@ -118,4 +120,10 @@ sub getsetup () {
                },
 }
 
+sub authstub ($$) {
+       # While this hook is not currently used, it needs to exist
+       # so ikiwiki knows that the wiki supports logins, and will
+       # enable the Preferences page.
+}
+
 1