Redirect user to a pre-requested page that requires Login

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Redirect user to a pre-requested page that requires Login

SalmaRayan
If there is a page that requires Login, so i made a pre-dispatch function . I want after the user makes successful login, i want him to be redirected to the pre-requested page
Any Ideas, i tried using Zend_Controller_Action::getRequest()->getActionName();
but it doesnt work plz help. thanks
Reply | Threaded
Open this post in threaded view
|

Re: Re[fw-auth] direct user to a pre-requested page that requires Login

Abraham Block
You can either store the prereqested page in a session variable, or put it as a query parameter when you redirect to the login page. If you just forwarded to the login action instead of redirecting, then you just read the url on top. The latter way gets tricky, however, because you have to figure out how to deal with a failed login attempt.

On Sun, Jul 26, 2009 at 10:59 PM, salmarayan <[hidden email]> wrote:

If there is a page that requires Login, so i made a pre-dispatch function . I
want after the user makes successful login, i want him to be redirected to
the pre-requested page
Any Ideas, i tried using
Zend_Controller_Action::getRequest()->getActionName();
but it doesnt work plz help. thanks
--
View this message in context: http://www.nabble.com/Redirect-user-to-a-pre-requested-page-that-requires-Login-tp24672911p24672911.html
Sent from the Zend Auth mailing list archive at Nabble.com.


Reply | Threaded
Open this post in threaded view
|

Re: Re[fw-auth] direct user to a pre-requested page that requires Login

Cezary Draus
I do it like that (login action when login succesful):

$front = $this->getFrontController();
$request = $front->getRequest();
$params = $request->getParams();
$this->_redirect($params[1]);

If redirection is to same page I redirect it to main page.

Hope its helpful.

2009/7/27 Abraham Block <[hidden email]>:

> You can either store the prereqested page in a session variable, or put it
> as a query parameter when you redirect to the login page. If you just
> forwarded to the login action instead of redirecting, then you just read the
> url on top. The latter way gets tricky, however, because you have to figure
> out how to deal with a failed login attempt.
>
> On Sun, Jul 26, 2009 at 10:59 PM, salmarayan <[hidden email]> wrote:
>>
>> If there is a page that requires Login, so i made a pre-dispatch function
>> . I
>> want after the user makes successful login, i want him to be redirected to
>> the pre-requested page
>> Any Ideas, i tried using
>> Zend_Controller_Action::getRequest()->getActionName();
>> but it doesnt work plz help. thanks
>> --
>> View this message in context:
>> http://www.nabble.com/Redirect-user-to-a-pre-requested-page-that-requires-Login-tp24672911p24672911.html
>> Sent from the Zend Auth mailing list archive at Nabble.com.
>>
>
>