While still pondering on the e-mail I came up with an idea. What if I forced people to log in before they could visit the website itself? Since they didn’t have an “open registration” that should pose little problems. The only difficulty was to transform this idea into reality. I Googled for a possible solution, and of course the Joomla Community delivered.
A blog post on Joomlatools offers a solution that works. It involves a hack of one of the core files. I’ve tested this just today, and it works perfectly. I’ve made a minor change to their solution, to ensure that users – should there be any – will still be able to visit the site while you make this minor change.
How to get it done
- Open the file in /includes/application.php
- Find the following line: if ($this ->getCfg(‘offline’)&& $user -> get(‘gid’) <’23’
- Change the line to: if ($this ->getCfg(‘offline’)&& $user -> get(‘gid’) <’18’
- Save the file, and overwrite the original file.
- Once this is done, set your Joomla site to “Offline”.
You’ve now made a change to how Joomla behaves when the site is set to offline. Normally, only the super administrators can still visit the site when it’s put offline – but this change will allow registered users to visit the site, when they log in. A login screen will also appear; which is just what we need!
If you feel like changing the way this login screen looks, the people at joomlatools mention that you can edit the file in /templates/system/offline.php and copy it to /templates/(your template)/offline.php.
Once you follow these steps, you’ve transformed Joomla to a site that’s reserved for registered users only!