Nick, 
You'll need to urlencode the string to use it when you append it to the post
url.

-----Original Message-----
From: symfony-users@googlegroups.com [mailto:symfony-us...@googlegroups.com]
On Behalf Of nick
Sent: 15 May 2009 20:23
To: symfony users
Subject: [symfony-users] Re: do i directly edit sfGuardAuth signinSucess.php
if I want to customize the signing form, or do I override it elsewhere?




On May 15, 5:23 am, "David Ashwood" <da...@inspiredthinking.co.uk>
wrote:
> Most people append the
> referrer to the URL as a parameter for this because unless you're careful
> you'll lose the information if you try to store it in the session/cookie
> (logging in will create a new session - so you'll need to transfer the
> information from the existing session if you don't want to lose the data).

Actually, I'm having trouble escaping the URL. I tried this:

 return $this->redirect('sfGuardAuth/proceedToUrl?redirect='. urlencode
($request->getUri()));

Came up with this:

  public function executeProceedToUrl($request) {
    $redirect = $request->getParameter("redirect");
  }

Not sure how to redirect to $redirect, but that doesn't matter,
because I never get that far. Instead I get a 404 error:

The requested URL /mybailiwick/web/frontend_dev.php/sfGuardAuth/
proceedToUrl/redirect/http://192.148.1.160/mybailiwick/web/
frontend_dev.php/login

If I understand things correctly, Symfony/sfGuard works like this:

1.) You attempt to go to a secure page, but you are not logged in, so
you get redirected to executeSignin().

2.) You fill in the login form and hit submit.

3.) You are still not yet logged in, so the code again redirects you
to executeSignin(). But the page you just came from was the login
screen.

4.) Now you are logged in. The code now wants to send you some place.
getUri() now points to the page you just came from, which was the
login screen. Redirecting to getUri() will lead to an infinite loop.
getReferer() is empty, so the only other option is to redirect to the
homepage. Check out this line from BasesfGuardAuthActions:

$signinUrl = sfConfig::get('app_sf_guard_plugin_success_signin_url',
$user->getReferer('@homepage'));

This code will return the URL for the homepage everytime.

I can not figure out how to break out of this cycle.











> -----Original Message-----
> From: symfony-users@googlegroups.com
[mailto:symfony-us...@googlegroups.com]
>
> On Behalf Of H. Tuttle
> Sent: 15 May 2009 03:49
> To: symfony users
> Subject: [symfony-users] Re: do i directly edit sfGuardAuth
signinSucess.php
> if I want to customize the signing form, or do I override it elsewhere?
>
> Yes, that's right.  You can make your own sfGuardAuth module.
>
> The other question almost as important is how do you overload the
> sfGuardUser class?  I have tried making my own sfGuardUser.php in the /
> lib/model directory but with no success.  I'd like to be able to stay
> completely out of the plugin folders.
>
> On May 14, 7:42 pm, Sid Bachtiar <sid.bacht...@gmail.com> wrote:
> > That should be the default behaviour of sfGuardPlugin
>
> > But if you want to customize the signinSuccess.php, don't do it on the
> > plugin directory.
>
> > Do it be creating
> > "myproject/myapp/modules/sfGuardAuth/templates/signinSuccess.php" (do
> > this manually, don't use symfony command line, e.g.: don't use symfony
> > init-module).
>
> > This should override the plugin's signinSuccess.php
>
> > On Fri, May 15, 2009 at 12:23 PM, nick <lal...@teamlalala.com> wrote:
>
> > > If someone tries to go to a secure page, and they are not logged in,
> > > they get redirected to the login page, which has this template:
>
> > > plugins/sfGuardPlugin/modules/sfGuardAuth/templates/signinSucess.php
>
> > > I'd like to remember where the user was coming from, and then send
> > > them there if they log in successfully. Do I directly edit
> > > signinSuccess.php, or do I override it somewhere else?
>
> > --
> > Blue Horn Ltd - System Developmenthttp://bluehorn.co.nz


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to