Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-06-2007, 07:29 PM
Junior Member
 
Join Date: Dec 2007
Posts: 1
Default login on any page

Hi,

I am fairly new to ZF and not that strong of a php programmer but I have been enjoying developing under ZF for the past few weeks and I am currently stuck on a simple problem.

On my website, I have a login form on every page. I have setup zend auth properly and it works. But when a user logs in I want them to be able to return to the page they were currently on. How do I go about doing that in ZF?

thank you in advance,
Boomba
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-12-2008, 04:18 PM
Junior Member
 
Join Date: Apr 2008
Posts: 1
Wink

Hi,
I have the same problem. First, I tried
PHP Code:
$this->_redirect($_SERVER['HTTP_REFERER']); 
PHP Code:
$this->_redirect($this->getRequest()->getServer('HTTP_REFERER')); 
PHP Code:
$this->_redirect($this->getRequest()->getServer('HTTP_REFERER'false)); 
They didn't work properly after successful login, and asked robinsk & necrogami from #zftalk. Here are what they advised me:

Quote:
<robinsk> that way people could link to your login page, then get redirected to a malicious page on successful login

<robinsk> i find it's better to store "current uri" or "current module, contoller and action" on pages that requires a login, then store this information in session, and redirect to this on successful login

<necrogami> or put the Current Module, Controller and Action into hidden variables in the login form

<necrogami> then recall them after login and redirect

<robinsk>
that's also a possible approach, although it might be altered by a user

Currently, I have not followed what they told me, but I will follow as soon as I get up. I'm really sure this will work.

And it's 01:24, and need to get rest ^.^

(hope you will share your experience if you try this)

Last edited by beregu : 04-16-2008 at 06:02 PM. Reason: just to make more readable
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 11:39 AM.