we are developing site (unfortunately on Joomla), where we need to restrict access to some content - articles (and also categories if possible).
Ideally, this content should be hidden even from menu. It will be enough if we were able to specify three access levels for our articles:
- public visibility
- visible only for intranet
- visible only for extranet
Unfortunately we found no extension that could meet our requirements. Do you have any suggestions, where we should implement this IP filter (detect IP address and check if it is from intranet or extranet is simple task, but we are quite new to Joomla API).
Approach 1 would be a System plugin, as @Lodder suggested. It would pick
$_SERVER['REMOTE_ADDR']
(check this, as if you're behind a proxy, another variable might need checking - likeX-FORWARDED-FOR
or another). Then you can check it vs. conditions set for the article or category — yet to decide how exactly you would mark a particular article as 'Intranet only'. In case of 'access denied' just redirect visitors to the home page. All articles would be open to all by default, and can be market either 'intranet' or 'extranet'.Approach 2 would be to have two sites instead of one, sharing same database. They can use individual template files, picking different module positions to place menus. Thus there will be two sets of menus in the system: one for Intranet, one for Extranet. Of course in this case anyone with a correct link would be able to access any article, no matter what IP he comes from. So its just a decoration.