- elsif ($form->title eq "preferences") {
- if (! defined $form->field(name => "name")) {
- $form->field(name => "OpenID", disabled => 1, value =>
- $session->param("name"), size => 30, force => 1);
- }
+ elsif (defined $q->param("action") && $q->param("action") eq "verify") {
+ validate($q, $session, $openid_url, sub {
+ $openid_error=shift;
+ });
+ }
+
+ my $template=IkiWiki::template("openid-selector.tmpl");
+ $template->param(
+ cgiurl => $config{cgiurl},
+ (defined $openid_error ? (openid_error => $openid_error) : ()),
+ (defined $openid_url ? (openid_url => $openid_url) : ()),
+ ($real_cgi_signin ? (nonopenidform => $real_cgi_signin->($q, $session, 1)) : ()),
+ );
+
+ IkiWiki::printheader($session);
+ print IkiWiki::misctemplate("signin", $template->output);
+ exit;
+}
+
+sub formbuilder_setup (@) {
+ my %params=@_;
+
+ my $form=$params{form};
+ my $session=$params{session};
+ my $cgi=$params{cgi};
+
+ if ($form->title eq "preferences" &&
+ IkiWiki::openiduser($session->param("name"))) {
+ $form->field(name => "openid_identifier", disabled => 1,
+ label => htmllink("", "", "ikiwiki/OpenID", noimageinline => 1),
+ value => $session->param("name"),
+ size => length($session->param("name")), force => 1,
+ fieldset => "login");
+ $form->field(name => "email", type => "hidden");