aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/openid.pm
diff options
context:
space:
mode:
authorSimon McVittie <smcv@ http://smcv.pseudorandom.co.uk/>2009-06-21 12:12:30 +0100
committerJoey Hess <joey@gnu.kitenet.net>2009-07-07 13:38:04 -0400
commitea4686a565067b8c9a4cd1f1a76c205c7a38bfed (patch)
treeda9620306f7bc884c3eec66b7638f075e4c29666 /IkiWiki/Plugin/openid.pm
parentf35f7358e0d86e20031e74ab25f61ae03352fdc6 (diff)
downloadikiwiki-ea4686a565067b8c9a4cd1f1a76c205c7a38bfed.tar
ikiwiki-ea4686a565067b8c9a4cd1f1a76c205c7a38bfed.tar.gz
Update IkiWiki::openiduser to work with Net::OpenID 2.x
openiduser previously used a constructor that no longer works in 2.x. However, all we actually want is the (undocumented) DisplayOfURL function that is invoked by the display method, so try to use that. (cherry picked from commit c3dd0ff5c7c10743107f203a5b456fdcd1b171df)
Diffstat (limited to 'IkiWiki/Plugin/openid.pm')
-rw-r--r--IkiWiki/Plugin/openid.pm14
1 files changed, 12 insertions, 2 deletions
diff --git a/IkiWiki/Plugin/openid.pm b/IkiWiki/Plugin/openid.pm
index 5424c57e2..87569915b 100644
--- a/IkiWiki/Plugin/openid.pm
+++ b/IkiWiki/Plugin/openid.pm
@@ -189,8 +189,18 @@ sub openiduser ($) {
if ($user =~ m!^https?://! &&
eval q{use Net::OpenID::VerifiedIdentity; 1} && !$@) {
- my $oid=Net::OpenID::VerifiedIdentity->new(identity => $user);
- my $display=$oid->display;
+ my $display;
+
+ if (Net::OpenID::VerifiedIdentity->can("DisplayOfURL")) {
+ # this works in at least 2.x
+ $display = Net::OpenID::VerifiedIdentity::DisplayOfURL($user);
+ }
+ else {
+ # this only works in 1.x
+ my $oid=Net::OpenID::VerifiedIdentity->new(identity => $user);
+ $display=$oid->display;
+ }
+
# Convert "user.somehost.com" to "user [somehost.com]"
# (also "user.somehost.co.uk")
if ($display !~ /\[/) {