3

I currently work on a project where all the users have unique usernames but not unique email addresses.

This is a problem when using the Reset Password feature because out of the box you need to enter your e-mail address in the 1st step.

So basically I´m looking for a solution where you enter username instead of e-mail address in the 1st step of Reset Password.

Does anyone know of a good way to make this happen (without core hacks)?

2

After digging around for alternative solutions I found a way to override the model, thanks to this documentation: https://docs.joomla.org/How_to_override_the_component_mvc_from_the_Joomla!_core

Step by step on how I did it:

  1. Download and install and enable this plugin (MVC Override): https://gruz.ml/en/extensions/mvcoverride.html

  2. Copy the model file from: /components/com_users/models/reset.php to: /templates/[templatename]/code/com_users/models/reset.php

And there you have it. Now you can make all the changes you like to the file: /templates/[templatename]/code/com_users/models/reset.php

Note that this is a template override solution, so you need to copy the override file to any other templates you may use (if you use multiple front-end templates for your site).

You must also be aware that updating Joomla to a newer version may render your override file incompatible with the system, depending on the changes you´ve made and the fixes / changes contained in the Joomla update. So it´s always a good idea to revisit your override files every time you perform a Joomla update.

You may ask yourself, then why even bother with an override solution? Well, a big upside to using an override method is that you have an easily manageable overview of all your modifications, that is easier to keep track of than your own "core hacks change-log".

After discovering the MVC Override plugin I´m more than likely going to use it on most, if not all, future Joomla projects.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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