I need to check for a condition on each page I visit on the website.
Basically, the user account’s have a time limit, and if the user account has expired I need to redirect them to the renew page, this way they can log in to the system but can only access the renew page.
I could just make a function and call it on every action for every controller, but this doesn’t make any sense, I could also do some hacking on bootstrap, but this doesn’t seem the right solution also.
How can i do this the right way? Or maybe the bootstrap is the right way?
I think the best way to achieve that is to add
Zend_Controller_Plugin_Abstractto your application and implement the logic in thepreDispatchmethod.You will be able to do the checks and redirect the user with the Redirector helper.
$redirector = Zend_Controller_Action_HelperBroker::getStaticHelper('Redirector'); $redirector->gotoSimpleAndExit('myaction', 'mycontroller', 'mymodule');