Hello list!,

I'm using sfGuard for the first time in a project, altough the setup  
was kind of difficult (the wiki docs weren't clear enough for me) I  
got it working fine.

I found some trouble after the login because I need to use a  
different port on that host and sfGuard wasn't expecting it, let me  
explain:

Suppose I'm running the app in http://host:81

I did the login OK, but when sfGuard was trying to send me to the  
initial page the browser will timeout because it was told to go to  
http://host

This is the way I fixed:

--- plugins/sfGuardAuth/lib/BasesfGuardAuthActions.class.php ---
   public function executeSignin()
   {
     if ($this->getRequest()->getMethod() != sfRequest::POST)
     {
       // display the form
       if (!$this->getUser()->hasAttribute('referer'))
       {
         $referer = $this->getContext()->getActionStack()->getSize()  
== 1 ? $this->getRequest()->getReferer() : $this->getRequest()->getUri 
();

         $this->getUser()->setAttribute('referer', $referer);
       }
     }
     else
     {
       // handle the form submission
       // redirect to last page
       $referer = $this->getUser()->getAttribute('referer',  
'@homepage');
       $this->getUser()->getAttributeHolder()->remove('referer');
       $this->redirect('@homepage');
     }
   }
...
-- eof ---

So, the last instruction $this->redirect('@homepage'); was initially  
$this->redirect($referer) and that was the problem since that value  
was set by this:

$referer = $this->getContext()->getActionStack()->getSize() == 1 ?  
$this->getRequest()->getReferer() : $this->getRequest()->getUri();


Is there a way to get the right referer in this case without  
hardcoding it?

I would love to type http://host:81/mymodule/myaction have the login  
screen, after the auth redirect there like spected but using a  
different let me no choice but to always redirect to the first page  
(@homepage).

Thank you all and great work!

Regards,

r.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony developers" 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-devs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to