- if ($form->title eq "signin") {
- return unless load_openid_module();
-
- # This avoids it displaying a redundant label for the
- # OpenID fieldset.
- $form->fieldsets("OpenID");
-
- $form->field(
- name => "openid_url",
- label => loginlabel(),
- fieldset => "OpenID",
- size => 30,
- comment => ($config{openidsignup} ? " | <a href=\"$config{openidsignup}\">".gettext("Get an OpenID")."</a>" : "")
- );
-
- # Handle submission of an OpenID as validation.
- if ($form->submitted && $form->submitted eq "Login" &&
- defined $form->field("openid_url") &&
- length $form->field("openid_url")) {
- $form->field(
- name => "openid_url",
- validate => sub {
- validate($cgi, $session, shift, sub {
- # Display error in the form.
- $form->field(name => "openid_url", comment => shift);
- });
- },
- );
- # Skip all other required fields in this case.
- foreach my $field ($form->field) {
- next if $field eq "openid_url";
- $form->field(name => $field, required => 0,
- validate => '/.*/');
- }
- }
- }
- elsif ($form->title eq "preferences" &&