Joomla 3.9.24

There's a similar question here but it deals with changing the language string, whereas I'd like to change the page content and / or redirect.

I have allowed user registration on my site and the New User Account Activation option is set to Admin, so the user will be emailed a link to activate their account before they can log in. Then all users set to receive system emails and who have the permission to create users will be notified to activate the user's account.

This works as expected. However if the user clicks the activation link a second time the following message is displayed;

Error 403 - verification code not found

The same applies to the admin approval stage, e.g. Staff Member A clicks the activation link to approve the user, all fine. Then Staff Member B clicks the same activation link later that day, they see;

Error 403 - verification code not found

It seems logical, and good UX, that rather than a 403 error (which normally means access is forbidden), there should be a custom message displayed to the user e.g.;

Sorry, there was a problem, we couldn't validate that code, it may be:

  • Already validated
  • Expired

Is there any way to display / redirect to a custom URL if the user has already been activated? Preferably without editing core files.

I'm aware that Joomla does not store the activation token once a user has been activated.

Presumably I'd have to check that the activation token didn't exist, then check that the user did exist and was activated? Then display the custom content? Not sure where or how to start this customisation.

Could be reading into this too much but I think it should be a core feature of Joomla? Other sites I've registered on have this functionality (e.g. MailChimp).

  • Preferably without editing core files? No... Those 403 errors are hard coded, and you'd need to edit core files to get rid of them. You can edit the template or language file(s) to change the content, but short of editing core files you'll still have a 403 header error. Feb 25 at 16:42
  • This is possible with a system plugin. Either by "hijacking" the controller task in onAfterRoute event or by setting a custom error handler.
    – Sharky
    Feb 26 at 12:46
  • @Sharky that sounds interesting, have you done anything like this before? Would be interested to know more!
    – jonboy
    Feb 26 at 16:32
  • There are many examples of plugins with onAfterRoute event and for custom error handler take a look at System - Redirect plugin.
    – Sharky
    Mar 1 at 7:01

Your Answer

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

Browse other questions tagged or ask your own question.