We help IT Professionals succeed at work.

Show Joomla Login Module on Restricted Pages Instead of Error Message

baadayakazi
baadayakazi asked
on
I'm running Joomla on my server and I want for people to have to login in when the reach a restricted page. I only want to show the login module on the restricted pages. I also don't want it to throw up the "you are not authorized" words. I'd rather put in my own instructions telling them to register and/or login.
Comment
Watch Question

Joomla really, really sucks at doing user access control.  The best option for you is to install something like JACL which will give decent control over user accounts and permissions.

You can get Joomla here: http://www.joomlaresource.com/Joomla_Addons/Joomla_Components/JACL_Plus_Component/
Sorry, that should have said you can get *JACL* here.

Author

Commented:
I just looked at this component and since it requires major hacking of the core Joomla files (according to the download agreement), I'd rather not take my chances.

Is there something I can do to change the way the current installation responds to users who are not logged in? Instead of showing text that says to log in, it show a module...the login one.
Not without hacking the core Joomla files!

Author

Commented:
I don't mind going in and altering a few lines of code in the core Joomla files, especially since I can easily make backups. I'm just afraid of installing a component that will alter a bunch of files automatically that I may have to go track down if/when there's a problem. It's about control ;)

Commented:
I had to do this too for Joomla 1.5 - I wrote my own template and component which basically centered around these lines of code:
if ( $user->guest) {
    include('div-login-required.php');
} else {
    include('div-contentarea.php');
} ?>
The contentarea is the usual content that you'd see.

Explore More ContentExplore courses, solutions, and other research materials related to this topic.