[Catalyst-commits] r14239 - trunk/examples/CatalystAdvent/root/2011

caelum at dev.catalyst.perl.org caelum at dev.catalyst.perl.org
Wed Dec 28 06:22:35 GMT 2011


Author: caelum
Date: 2011-12-28 06:22:35 +0000 (Wed, 28 Dec 2011)
New Revision: 14239

Modified:
   trunk/examples/CatalystAdvent/root/2011/15.pod
Log:
improvements for login article from bvierra

Modified: trunk/examples/CatalystAdvent/root/2011/15.pod
===================================================================
--- trunk/examples/CatalystAdvent/root/2011/15.pod	2011-12-25 23:33:48 UTC (rev 14238)
+++ trunk/examples/CatalystAdvent/root/2011/15.pod	2011-12-28 06:22:35 UTC (rev 14239)
@@ -158,7 +158,12 @@
              }
           },
        },
-       'Controller::Login' => { traits => ['-RenderAsTTTemplate'], },
+       'Controller::Login' => {
+           traits => ['-RenderAsTTTemplate'],
+           login_form_args => {
+               authenticate_args => { active => 'Y' },
+           },
+       },
     );
 
 Now we need a login template:
@@ -570,16 +575,6 @@
     sub base : Chained('/login/required') PathPart('') CaptureArgs(0) {
         my ($self, $c) = @_;
 
-        if ($c->user_exists && $c->user->active ne 'Y') {
-            $c->res->redirect($c->uri_for('/login', {
-                status_msg => 'User has been Deactivated',
-                username => $c->user->username,
-                password => 'xxx',
-            }));
-            $c->logout;
-            $c->detach;
-        }
-
         if ($c->action ne $c->controller('User')->action_for('change_password')
             && $c->user_exists
             && $c->user->password_expires
@@ -590,6 +585,8 @@
             }));
             $c->detach;
         }
+
+        return 1;
     }
 
 We are also checking that the user is active.




More information about the Catalyst-commits mailing list