Actually, I now have a third way to do this and it just uses a phpblock. Go into lib-custom.php and add this function to the end:
Text Formatted Code
function phpblock_no_anonymous_access()<br />{<br /> global $_USER;<br /> <br /> if (!isset($_USER) || !isset($_USER['uid']) || $_USER['uid'] == 1)<br /> {<br /> $split = explode('?', $_SERVER['PHP_SELF']);<br /> if (basename($split[0]) != 'users.php')<br /> {<br /> echo COM_refresh($_CONF['site_url'] . '/users.php');<br /> exit;<br /> }<br /> }<br /> return '';<br />}<br />
Then login as admin and create a new block as follows:
Title: No Anonymous Access
Enabled: checked
Block Name: no_anonymous_access
Topic: All
Side: Left
Block Order: 1
Type: PHP Block
PHP Block Options
Block Function: phpblock_no_anonymous_access
In the access rights section, remove the checkmark from Group Read and Members Read. (This isn't necessary, it just skips the block for users who are already logged in.)
If you don't want anonymous users to see any of your content, you should move any custom content out of the left side block. If you don't care, don't worry about it. With this block active the only pages an anonymous user can see are the users.php pages that handle login and registration.
The benefit to blocking access this way (rather than removing read from anonymous all throughout the system) is that if at some later date you want to open the system, all you have to do is disable this block.
Enjoy.