3

Is there any way to force a redirect after a user has reset their password without modifying core files?

From what I can tell, there aren't really any variables that Joomla! sends back confirming a successful reset that I can use to force a redirect. Additionally, I can't find any variables referenced in the model/controller/helper that I could set to tell Joomla! to return to a different page.

The closest I've come to finding a variable I can set to let the component know that I want to redirect was JFactory::getApplication()->getUserState('com_users.edit.profile.redirect'). This didn't seem to work.

3
  • 2
    I'd be looking at the onUserAfterSave hook. From the description ("This event is triggered after an update of a user record"), I think this should fire a plugin at the appropriate time.
    – RichardB
    Commented Oct 8, 2016 at 10:25
  • Well, made a plugin and set up a couple of checks in onUserAfterSave, and sure enough I was able to catch a successful password change and redirect to a page I wanted. Thank you.
    – Chaosxmk
    Commented Oct 11, 2016 at 13:28
  • Richard B, post your comment as answer. Otherwise, this question will continue to stay in unanswered category.
    – saibbyweb
    Commented Oct 11, 2016 at 16:30

1 Answer 1

3

The onUserAfterSave hook allows you to access this data at the appropriate time via a plugin.

2
  • (added as an answer, as per Saibbyweb's suggestion)
    – RichardB
    Commented Oct 11, 2016 at 17:32
  • 1
    For anyone using this solution, be extremely careful about how to handle the redirect here. A very, VERY large amount of functions set off the onUserAfterSave hook. Make absolutely sure that your redirect sets off under exact/specific conditions.
    – Chaosxmk
    Commented Oct 17, 2016 at 20:39

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.