From 870adf3bbf459e3f234fb06322b750582ab47912 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 30 Jan 2008 02:39:17 -0500 Subject: move openiduser function to the openid plugin --- IkiWiki.pm | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) (limited to 'IkiWiki.pm') diff --git a/IkiWiki.pm b/IkiWiki.pm index 016c664b5..050d4e5b2 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -613,33 +613,10 @@ sub htmllink ($$$;@) { #{{{ return "$linktext"; } #}}} -sub openiduser ($) { #{{{ - my $user=shift; - - if ($user =~ m!^https?://! && - eval q{use Net::OpenID::VerifiedIdentity; 1} && !$@) { - my $oid=Net::OpenID::VerifiedIdentity->new(identity => $user); - my $display=$oid->display; - # Convert "user.somehost.com" to "user [somehost.com]". - if ($display !~ /\[/) { - $display=~s/^(.*?)\.([^.]+\.[a-z]+)$/$1 [$2]/; - } - # Convert "http://somehost.com/user" to "user [somehost.com]". - if ($display !~ /\[/) { - $display=~s/^https?:\/\/(.+)\/([^\/]+)$/$2 [$1]/; - } - $display=~s!^https?://!!; # make sure this is removed - eval q{use CGI 'escapeHTML'}; - error($@) if $@; - return escapeHTML($display); - } - return; -} - sub userlink ($) { #{{{ my $user=shift; - my $oiduser=openiduser($user); + my $oiduser=eval { openiduser($user) }; if (defined $oiduser) { return "$oiduser"; } -- cgit v1.2.3