Jump to content
mmclaughlin

IP address lock

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...