JomSocial Login Failed Redirect

Working with JomSocial you may have noticed that when the Login fails for whatever reason instead of being redirected to the Login form that was originally used a new form is displayed that may well be styled differently.

I really do not like to make core hacks however when an extension has some serious flaws in its process flow the only way to solve the problem is by correcting the flaw.

IMHO when a user's login attempt fails they should be sent back to where they came from with a suitable error message.

To achieve this the following file needs to be modified : /components/com_community/controllers/controller.php

On line 77 you should find the blockUnregister function currently if $my-> == 0 it loads the 'guests.denied' JomSocial template which in turn displays a login form but lacks the variables that were available from the primary login ('frontpage.guests').

Both of the potential fixes involve hacking the core:

The first one would be to rework the 'guests.denied' template to reflect the same formatting as the 'frontpage.guests' template, however that means that any changes will have to be perfomed in two places, so scrap that idea.

The second option involves deleting or at least commenting out all the existing code in the if ($my->id == 0) block with the exception of the return true; line and replaceing it with these two lines.

$fp = $this->getView();


The default view is the 'frontpage'. The variable name $fp is my choice you can use any name that is not used in that function.

Hope this helps.

All the best - John