[Jifty-commit] r2979 - in jifty/trunk: lib/Jifty

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Fri Mar 16 01:09:30 EDT 2007


Author: jesse
Date: Fri Mar 16 01:09:29 2007
New Revision: 2979

Modified:
   jifty/trunk/   (props changed)
   jifty/trunk/lib/Jifty/LetMe.pm

Log:
 r53501 at pinglin:  jesse | 2007-03-16 00:33:31 -0400
 * LetMes need to deal with user objects as superuser to get their tokens


Modified: jifty/trunk/lib/Jifty/LetMe.pm
==============================================================================
--- jifty/trunk/lib/Jifty/LetMe.pm	(original)
+++ jifty/trunk/lib/Jifty/LetMe.pm	Fri Mar 16 01:09:29 2007
@@ -65,7 +65,8 @@
 sub validated_current_user {
     my $self = shift;
     return undef unless ( $self->validate );
-    return $self->_user_from_email($self->email);
+    my $currentuser = Jifty->app_class("CurrentUser");
+    return Jifty->app_class('CurrentUser')->new( email => $self->email );
 
 }
 
@@ -81,7 +82,10 @@
     my $self = shift;
     my $email = shift;
     my $currentuser_object_class = Jifty->app_class("CurrentUser");
-    return $currentuser_object_class->new( email => $email );
+    my $u = $currentuser_object_class->new( email => $email )->user_object;
+    # we want to be able to get at their auth token.
+    $u->current_user(Jifty->app_class('CurrentUser')->superuser);
+    return $u;
 }
 
 sub _generate_digest {
@@ -217,14 +221,13 @@
 sub _generate_token {
     my $self = shift;
     my %args = (email => undef, @_);
-    return join ('/', 
+    return  join ('/', 
         $args{'email'},
         $self->path,
         (map {URI::Escape::uri_escape_utf8($_)} %{$self->args}),
         (defined $self->until ? ( 'until', $self->until ) : () ), #?
         $self->generate_checksum  
         );
-
 }
 
 


More information about the Jifty-commit mailing list