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!
<Sources: Joomlatools.com>
So, a
Pingback: One year anniversary « Joomla and more
Nice one, was looking for something like this without having to convert everything to a Registered Menu Item, Article, Section, Category and Module :P.
Yeah, that’s a serious pain in the ass. Just FYI: people won’t be able to register using this setup, though.
And you might have to make the changes again if you upgrade to a newer version of Joomla since the file you edit might be overwritten.
Thanks for the detailed tip, looking for a solution to my problem posed by the customer. Good job, thank you.
Thanks for your tip.
There are a problem with the component sh404.
it’s not good with the profil register…
A solution ???
Are you saying you’re having problems with the user registration component?
The modification 23 to 18 + sh404 component in case of offline simply allows only the administrators to register. the records will not pass . oups !
a simple register no work
ok avec cette option pour intranet, j’ai utilisé JOOMSEF
I confirm that this will not work with sh404 installed also if component and security functions are disabled. I have to remove it completly to let it work.
How to register if site is Offline? If you are hacking this file, you cant eather register.?
It seems to work also in J1.6 when you do this:
open /includes/application.php
find: if ($this->getCfg(‘offline’) && !$user->authorise(‘core.admin’)
change ‘core.admin’ to ‘core.login.site’
Please confirm
Pingback: Anonymous
does this also apply to Joomla 2.5?
Hi guys! Recently my company has launched a new software product called Undiscuss. Undiscuss is an affordable and on-premise enterprise social networking software built on PHP and the award winning Joomla! CMS with a simple pricing and business model.
Undiscuss’s unique pricing isn’t tied to the number of active or non-active users which is a big concern for many organizations using enterprise social networking web applications or software.
The best part of Undiscuss is the fact that you’ve got more than 6,000 extensions available to your disposal from the Joomla! Extensions site. Although not all are going to function smoothly right away with Undiscuss, but at least we’re starting from somewhere and it’s important that the developer community continues to build upon this initiative.
If you have any issues, don’t hesitate to contact me.
Hi Nabil, I took a quick look at your site (and demo) and it looks very interesting. Looks like a powerful tool to build an intranet on.
Sorry about not publishing your comment before, we’re struggling with spam a LOT lately and didn’t have time to check the false positives. 🙂
Hi Steven,
No worries I understand how overwhelming spam comments can be when you run a blog with a lot of content and visitors.
I would love to connect with you and talk about your feedback on Undiscuss. Looking forward to that!