Here is a little problem that others may have encountered.
You have a site built with EE and it is within an enterprise, or, in my case a University. A good part of the site is for public view and some is only visible to logged in users, However, they also have an Intranet where access is limited to those within the local network. Now that they see the wonderful INTERNET site built with ExpressionEngine, they now want the same features and functionality for an INTRANET site only visible within the network. They don’t want Intranet users to have to login. They just want it limited by IP address. Now, you could achieve this with .htaccess, but there are problems with this method, so I have created a plugin to achieve the required functionality.
I am not really sure yet if I have done this the right way, so I post here for your perusal and hopefully there may be someone who could check it out? Maybe there is an easier way even!
Here is the way to use it:
{if "{exp:intranet ips='129.84.*.*|211.109.238.74'}"}
<p>You can see this content</p>
{if:else}
<p>You are not allowed to see this content</p>
{/if}
As you may observe, the plugin simply returns true or false depending on whether the user’s IP fits within the give IPs given as a parameter with the plugin. There are some other examples given in the Plugin when you download it.
I have not been able to test fully yet and I do have one little problem:
On one server that is set up by colleagues, I cannot get the server’s IP address. Is there a PHP setting that turns off super globals?
