diff options
author | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2006-11-21 01:40:47 +0000 |
---|---|---|
committer | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2006-11-21 01:40:47 +0000 |
commit | fc0b70e700ca9d029e5aedd013b00de0cf793993 (patch) | |
tree | bd93aa63ef4de2eb6f301a63bd66f7d4c3977b21 | |
parent | 32756798818fbe5345b18d761fea2012b2cff0dd (diff) |
formatting
-rw-r--r-- | IkiWiki/CGI.pm | 7 | ||||
-rw-r--r-- | IkiWiki/Plugin/openid.pm | 6 |
2 files changed, 12 insertions, 1 deletions
diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm index b031aef56..54c526c2c 100644 --- a/IkiWiki/CGI.pm +++ b/IkiWiki/CGI.pm @@ -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); diff --git a/IkiWiki/Plugin/openid.pm b/IkiWiki/Plugin/openid.pm index 7ea67c5ca..75f13f878 100644 --- a/IkiWiki/Plugin/openid.pm +++ b/IkiWiki/Plugin/openid.pm @@ -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 ($$$;$) { #{{{ |