]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/openid.pm
po: inject custom isselflink to fix selflink detection on translation pages
[git.ikiwiki.info.git] / IkiWiki / Plugin / openid.pm
index 574c42f0ed83efd2e4e4690d2680a4cc1a92df56..dc0e0f48ee98e70313abce4d195092989e5537c6 100644 (file)
@@ -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,33 +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]"
-               # (also "user.somehost.co.uk")
-               if ($display !~ /\[/) {
-                       $display=~s/^([-a-zA-Z0-9]+?)\.([-.a-zA-Z0-9]+\.[a-z]+)$/$1 [$2]/;
-               }
-               # Convert "http://somehost.com/user" to "user [somehost.com]".
-               # (also "https://somehost.com/user/")
-               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