X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/bb93fccf0690344aa77f9538a508959a6de09847..3f520da78aeda38e47b43b28023b52f321f71291:/IkiWiki/Plugin/openid.pm diff --git a/IkiWiki/Plugin/openid.pm b/IkiWiki/Plugin/openid.pm index 2933c9ed9..dc0e0f48e 100644 --- a/IkiWiki/Plugin/openid.pm +++ b/IkiWiki/Plugin/openid.pm @@ -4,7 +4,7 @@ package IkiWiki::Plugin::openid; use warnings; use strict; -use IkiWiki 2.00; +use IkiWiki 3.00; sub import { hook(type => "getopt", id => "openid", call => \&getopt); @@ -180,31 +180,4 @@ sub getobj ($$) { ); } -package IkiWiki; - -# This is not used by this plugin, but this seems the best place to put it. -# Used elsewhere to pretty-display the name of an openid user. -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; -} - 1