In one of my project, there is requirement of redirect the customer to his/her account to dashboard for changing the password even after click of any links. Actually the customer password is being expired after 30 days.

So, customer can login with the old password even after 30 days but he/she can't browse any thing without changing his/her password.

So, problem is how can we redirect customer to the customer account dashboard change password screen after login and even after click of any links.

Any suggestions on fixing the issue?

  • Thank you murtuza for Formatting changes. I will keep in mind from the next time. Thank you again.. May 31, 2016 at 12:40

1 Answer 1


For this you need to use an observer which gets called on the controller_action_predispatch event and check if the customer is logged in or not and if customer is logged in check for your password expiration condition and redirect to customers dashboard.

you can use the following files for your reference.

1) app\etc\modules\TutsPlus_Demo.xml

<?xml version="1.0" encoding="UTF-8" ?>

2) app\code\local\TutsPlus\Demo\etc\config.xml

<?xml version="1.0" encoding="UTF-8" ?>

3) app\code\local\TutsPlus\Demo\Model\Observer.php


class TutsPlus_Demo_Model_Observer
    public function checkLogin(Varien_Event_Observer $observer)
        $controller = strtolower(Mage::app()->getRequest()->getControllerName());
            if ($controller == 'account') {
                return $this; //if in allowed actions do nothing.
            } else {
                //Your password expiration code goes here
        return $this;

Hope this will help you.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.