|
Whole Website only for Registered |
|
|
|
|
Written by Administrator
|
|
Sunday, 23 April 2006 |
|
Do you want that your whole Joomla is only accessable for registered people? But you can't find an option to set this up in Joomla 1.0.x and you can't wait for some 1.x release which gives you this possibility? Then you're reading the correct article.
To block the page for all Viewers which aren't logged in we need only to check if there's the var $my->gid. If not you give your own buffer out and not the one with the site content in it.
We need to open the index.php file for that(this file can be found in the joomla root).
Now move to this line:
$_MOS_OPTION['buffer'] = ob_get_contents();
And this is simply putted into an if-Block, and for the false part, when no $my->id is set we give just our own buffer out.
if ($my->gid==0){
$buffer="To View this site and content you need to login at first!<br /$gt;\n";
$buffer.="You can use the login form on the side panel for it!";
$_MOS_OPTION['buffer']=$buffer;
}else{
//show the content for the persons which are looged in
$_MOS_OPTION['buffer'] = ob_get_contents();
}
That's already everything we need to block the access to all Content if you're not logged in. I tried it also to display the login form in the content area, but as I encountered problems with the Internet Explorer and AOL-Browser. I just use advise the light version as the pro version isn't working correct, at least not with J!1.0.8(not tested for other versions). |
|
Last Updated ( Sunday, 23 April 2006 )
|