-- Shaun Farrell <[email protected]> wrote
(on Monday, 07 December 2009, 06:31 AM -0500):
> Ok so here is what I am doing. Before dispatch if the user is logged in and
> they have to reset their password then it will set the action and the
> controller to the correct controller/action.
> This code below works fine. However, the url in the browser doesn't change.
> So if I come into the system at www.abc.com/profile and i need to reset my
> pwd
> it will keep the url at www.abc.com/profile but the page that shows is
> www.abc.com/login/resetpassword
>
> anyone know how to reset the url so that it changes. Can I use
>
> return $this->_helper->redirector();
>
> public function preDispatch(Zend_Controller_Request_Abstract $request)
> {
>
> if (Zend_Auth::getInstance()->hasIdentity()) {
> //checks to make sure that the password doesn't need to be reset.
> if ("Y" === Zend_Auth::getInstance()->hasIdentity()->
> Reset_Password) {
> $request->setActionName('resetpassword')->setControllerName
> ('Login');
> return;
> }
>From within plugins, you have no direct access to the action helper
broker; however, you can get to it statically:
$redirector =
Zend_Controller_Action_HelperBroker::getStaticHelper('Redirector');
$redirector->....
Simply call the method you want to use (gotoRoute(), gotoSimple(),
etc.).
But yes, you will need to redirect for the URL to change.
--
Matthew Weier O'Phinney
Project Lead | [email protected]
Zend Framework | http://framework.zend.com/