-}
-
-sub checkconfig () {
- if ($config{cgi}) {
- # Intercept normal signin form, so the openid selector
- # can be displayed.
- #
- # When other auth hooks are registered, give the selector
- # a reference to the normal signin form.
- require IkiWiki::CGI;
- my $real_cgi_signin;
- my $otherform_label=gettext("Other");
- if (keys %{$IkiWiki::hooks{auth}} > 1) {
- $real_cgi_signin=\&IkiWiki::cgi_signin;
- my %h=%{$IkiWiki::hooks{auth}};
- delete $h{openid};
- delete $h{emailauth};
- if (keys %h == 1 && exists $h{passwordauth}) {
- $otherform_label=gettext("Password");
- }
- }
- inject(name => "IkiWiki::cgi_signin", call => sub ($$) {
- openid_selector($real_cgi_signin, $otherform_label, @_);
- });
- }
+ IkiWiki::loadplugin("emailauth");
+ IkiWiki::loadplugin("loginselector");
+ IkiWiki::Plugin::loginselector::register_login_plugin(
+ "openid",
+ \&openid_setup,
+ \&openid_check_input,
+ \&openid_auth,
+ );