From 702b8721d360ca132ff5c8f43d332757694b98da Mon Sep 17 00:00:00 2001 From: joey Date: Mon, 20 Nov 2006 02:46:58 +0000 Subject: * Add an openid plugin to support logging in using OpenID. * Web commits by OpenID users will record the full OpenID url for the user, but in recentchanges, these urls will be converted to a simplified display form+link. * Modified svn, git, tla backends to recognise such web commits. --- IkiWiki/CGI.pm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'IkiWiki/CGI.pm') diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm index def0549c5..fe1c5153e 100644 --- a/IkiWiki/CGI.pm +++ b/IkiWiki/CGI.pm @@ -85,7 +85,16 @@ sub cgi_recentchanges ($) { #{{{ my $changelog=[rcs_recentchanges(100)]; foreach my $change (@$changelog) { $change->{when} = concise(ago($change->{when})); - $change->{user} = htmllink("", "", escapeHTML($change->{user}), 1); + + if ($change->{user} =~ m!^https?://! && + eval q{use Net::OpenID::VerifiedIdentity; 1} && !$@) { + # Munge user-urls, as used by eg, OpenID. + my $oid=Net::OpenID::VerifiedIdentity->new(identity => $change->{user}); + $change->{user} = "{user}."\">".escapeHTML($oid->display).""; + } + else { + $change->{user} = htmllink("", "", escapeHTML($change->{user}), 1); + } my $is_excess = exists $change->{pages}[10]; # limit pages to first 10 delete @{$change->{pages}}[10 .. @{$change->{pages}}] if $is_excess; -- cgit v1.2.3