Author: allyb
Date: 2010-02-03 15:42:05 +0100 (Wed, 03 Feb 2010)
New Revision: 27495

Modified:
   
plugins/sfEasyAuthPlugin/trunk/modules/sfEasyAuth/lib/BasesfEasyAuthActions.class.php
Log:
Added another event that can be used to redirect users who are already logged 
in and try to log in again

Modified: 
plugins/sfEasyAuthPlugin/trunk/modules/sfEasyAuth/lib/BasesfEasyAuthActions.class.php
===================================================================
--- 
plugins/sfEasyAuthPlugin/trunk/modules/sfEasyAuth/lib/BasesfEasyAuthActions.class.php
       2010-02-03 14:03:20 UTC (rev 27494)
+++ 
plugins/sfEasyAuthPlugin/trunk/modules/sfEasyAuth/lib/BasesfEasyAuthActions.class.php
       2010-02-03 14:42:05 UTC (rev 27495)
@@ -22,8 +22,19 @@
     // user is already authenticated, so send them to the success url
     if ($sfUser->isAuthenticated())
     {
-      $this->logMessage('User is already authenticated. Redirecting.', 
'debug');
-      $this->redirect(sfConfig::get('app_sf_easy_auth_login_success_url', 
'@homepage'));
+      $url = sfConfig::get('app_sf_easy_auth_login_success_url', '@homepage');
+
+      // call an event after logging the user out and before redirecting them
+      $url = $this->getContext()->getEventDispatcher()->filter(new sfEvent(
+        $this,
+        'sf_easy_auth.filter_login_already_authenticated_redirect_url',
+        array(
+          'sfUser' => $sfUser,
+        )
+      ), $url)->getReturnValue();
+
+      $this->logMessage('User is already authenticated. Redirecting to ' . 
$url, 'debug');
+      $this->redirect($url);
     }
     
     if ($this->handleLogIn($request))

-- 
You received this message because you are subscribed to the Google Groups 
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/symfony-svn?hl=en.

Reply via email to