X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/035c1a24499e3ba2c0301337160d63b69d9e5376..bed518378afafa626d98260a7754bfae7cdb8327:/IkiWiki/Plugin/loginselector.pm diff --git a/IkiWiki/Plugin/loginselector.pm b/IkiWiki/Plugin/loginselector.pm index 1a322a53a..17539ce8a 100644 --- a/IkiWiki/Plugin/loginselector.pm +++ b/IkiWiki/Plugin/loginselector.pm @@ -21,12 +21,13 @@ sub register_login_plugin ($$$$) { # This sub is passed a cgi object, and should return true # if it looks like the user is logging in using the plugin. my $plugin_check_input=shift; - # This sub is passed a cgi object, a session object, and an error - # display callback, and should handle the actual authentication. - # It can either exit w/o returning, if it is able to handle - # auth, or it can pass an error message to the error display - # callback to make the openid selector form be re-disiplayed with - # an error message on it. + # This sub is passed a cgi object, a session object, an error + # display callback, and an info display callback, and should + # handle the actual authentication. It can either exit w/o + # returning, if it is able to handle auth, or it can pass an + # error message to the error display callback to make the + # openid selector form be re-disiplayed with an error message + # on it. my $plugin_auth=shift; $login_plugins{$plugin_name}={ setup => $plugin_setup, @@ -56,6 +57,8 @@ sub login_selector { if ($login_plugins{$plugin}->{check_input}->($q)) { $login_plugins{$plugin}->{auth}->($q, $session, sub { $template->param(login_error => shift()); + }, sub { + $template->param(login_info => shift()); }); last; } @@ -91,7 +94,6 @@ sub checkconfig () { my $real_cgi_signin; 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. @@ -103,6 +105,9 @@ sub checkconfig () { if (keys %h == 1 && exists $h{passwordauth}) { $otherform_label=gettext("Password"); } + if (keys %h > 0) { + $real_cgi_signin=\&IkiWiki::cgi_signin; + } } inject(name => "IkiWiki::cgi_signin", call => sub ($$) { login_selector($real_cgi_signin, $otherform_label, @_);