formatting
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Tue, 21 Nov 2006 01:40:47 +0000 (01:40 +0000)
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Tue, 21 Nov 2006 01:40:47 +0000 (01:40 +0000)
IkiWiki/CGI.pm
IkiWiki/Plugin/openid.pm

index b031aef56d4b744242c10f690f8cd3684c4b121a..54c526c2cbf6402b4cf8205d6cb1caef8db48dac 100644 (file)
@@ -654,7 +654,12 @@ sub userlink ($) { #{{{
            eval q{use Net::OpenID::VerifiedIdentity; 1} && !$@) {
                # Munge user-urls, as used by eg, OpenID.
                my $oid=Net::OpenID::VerifiedIdentity->new(identity => $user);
-               return "<a href=\"$user\">".escapeHTML($oid->display)."</a>";
+               my $display=$oid->display;
+               # Convert "user.somehost.com" to "user [somehost.com]".
+               if ($display !~ /\[/) {
+                       $display=~s/^(.*?)\.([^.]+.[^.]+)$/$1 [$2]/;
+               }
+               return "<a href=\"$user\">".escapeHTML($display)."</a>";
        }
        else {
                return htmllink("", "", escapeHTML($user), 1);
index 7ea67c5ca4a34aeaac6f17d0fe23137878fb80e4..75f13f878626e5b86cf632e13053170aa03facdb 100644 (file)
@@ -56,6 +56,12 @@ sub formbuilder_setup (@) { #{{{
                        }
                }
        }
+       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);
+               }
+       }
 }
 
 sub validate ($$$;$) { #{{{