[Jifty-commit] r740 - in wifty/trunk: lib/Wifty web/templates/_elements web/templates/let

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Sat Mar 25 15:01:07 EST 2006


Author: alexmv
Date: Sat Mar 25 15:01:06 2006
New Revision: 740

Modified:
   wifty/trunk/   (props changed)
   wifty/trunk/lib/Wifty/Dispatcher.pm
   wifty/trunk/web/templates/_elements/sidebar
   wifty/trunk/web/templates/let/confirm_email

Log:
 r11848 at zoq-fot-pik:  chmrr | 2006-03-25 15:00:54 -0500
  * Fix LetMes -- the dispatcher code needs to be abstracted out still, though


Modified: wifty/trunk/lib/Wifty/Dispatcher.pm
==============================================================================
--- wifty/trunk/lib/Wifty/Dispatcher.pm	(original)
+++ wifty/trunk/lib/Wifty/Dispatcher.pm	Sat Mar 25 15:01:06 2006
@@ -91,7 +91,6 @@
     set 'next' => Jifty->web->request->continuation
         || Jifty::Continuation->new(
         request => Jifty::Request->new( path => "/" ) );
-
 };
 
 # Log out
@@ -102,5 +101,26 @@
     );
 };
 
-    
+
+## LetMes
+before qr'^/let/(.*)' => run {
+    Jifty->web->deny_actions(qr/.*/);
+
+    my $let_me = Jifty::LetMe->new();
+    $let_me->from_token($1);
+    redirect '/error/let_me/invalid_token' unless $let_me->validate;
+
+    Jifty->web->temporary_current_user($let_me->validated_current_user);
+
+    my %args = %{$let_me->args};
+    set $_ => $args{$_} for keys %args;
+    set let_me => $let_me;
+};
+
+on qr'^/let/', => run {
+    my $let_me = get 'let_me';
+    show '/let/' . $let_me->path;
+};
+
+
 1;

Modified: wifty/trunk/web/templates/_elements/sidebar
==============================================================================
--- wifty/trunk/web/templates/_elements/sidebar	(original)
+++ wifty/trunk/web/templates/_elements/sidebar	Sat Mar 25 15:01:06 2006
@@ -1,7 +1,7 @@
 <div id="salutation">
 % if (Jifty->web->current_user->id and Jifty->web->current_user->user_object) {
 Hiya, <span class="user"><%Jifty->web->current_user->user_object->name%></span>.<br />
-(<% Jifty->web->tangent( label => q{Logout}, url => '/logout' )%>)
+(<% Jifty->web->link( label => q{Logout}, url => '/logout' )%>)
 % }  else {
 <% Jifty->web->tangent( label => q{You're not currently signed in.}, url => '/login' )%>
 % }

Modified: wifty/trunk/web/templates/let/confirm_email
==============================================================================
--- wifty/trunk/web/templates/let/confirm_email	(original)
+++ wifty/trunk/web/templates/let/confirm_email	Sat Mar 25 15:01:06 2006
@@ -1,14 +1,8 @@
-<%method setup_actions>
-<%perl>
+<%init>
 Jifty->web->allow_actions( 'Wifty::Action::ConfirmEmail'); 
-Jifty->web->request->add_action(
+Jifty->web->new_action(
     moniker => 'confirm_email',
     class   => 'Wifty::Action::ConfirmEmail',
-);
-Jifty->web->request->add_action(
-    moniker   => 'next_page',
-    class     => 'Jifty::Action::Redirect',
-    arguments => {url => "/"},
-);
-</%perl>
-</%method>
+)->run;
+Jifty->web->redirect("/");
+</%init>


More information about the Jifty-commit mailing list