Jump to content

IP address lock


mmclaughlin

Recommended Posts

So what I would love to have is the ability to lock down a Frog site by IP address.  The thought behind this is that we need to be able to prevent students from accessing a specific site unless they are in the school.  It is for testing as well as corrective education.  Can this be done in html?

Matt

Link to comment
Share on other sites

This is a tricky one.  Right now, due to the many different ways it's possible to host Frog, detecting where the user is in relation is not straight-forward.  

However, I do know that the following php code:

<?php

header("Content-Type: text/plain");
print("Your IP address is: " . $_SERVER['REMOTE_ADDR'] . "\n");
print("You connected to: " . $_SERVER['HTTP_HOST'] . "\n");
print("Which internally resolves to: " . gethostbyname($_SERVER['HTTP_HOST']) . "\n");

?>

sits on the Frog server at the top level:

https://yourfrogaddress/ipaddress.php

It might be possible then to use the HTML widget to check this page, split the contents to get the IP address in Javascript, then hide elements based on the result.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...