From: Jess Robinson Date: Fri, 11 May 2012 16:49:34 +0000 (+0000) Subject: Update to allow openid-based users (url as key) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=031a15f48238c07d47fbbe16b0f46ce424c2e2b9;p=scpubgit%2Fstemmatology.git Update to allow openid-based users (url as key) --- diff --git a/lib/Text/Tradition/UserStore.pm b/lib/Text/Tradition/UserStore.pm index f2b4aea..5493d82 100644 --- a/lib/Text/Tradition/UserStore.pm +++ b/lib/Text/Tradition/UserStore.pm @@ -97,7 +97,7 @@ sub add_user { =head3 find_user -Takes a hashref of C. +Takes a hashref of C, optionally C. Fetches the user object for the given username and returns it. @@ -105,7 +105,10 @@ Fetches the user object for the given username and returns it. sub find_user { my ($self, $userinfo) = @_; - my $username = $userinfo->{username}; + ## url or display? + # 'display' => 'castaway.myopenid.com', + # 'url' => 'http://castaway.myopenid.com/', + my $username = $userinfo->{url} || $userinfo->{username}; my $scope = $self->new_scope; return $self->lookup(Text::Tradition::User->id_for_user($username));