Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Name: Guest Handler
- * About: Handles certain internet protocal addresses by allowing them access to the site
- */
- // Checking if it's already defined
- if(!defined("GUEST_HANDLER_ON")) {
- define("GUEST_HANDLER_ON", true); // On by default
- if(GUEST_HANDLER_ON == true) {
- $sql = "SELECT pa FROM members"; // Get users' protocol address
- $query = mysql_query($sql);
- while($row = mysql_fetch_array($query)) {
- $ip = $row['pa'];
- }
- if($_SERVER['REMOTE_ADDR'] == ($ip | "127.0.0.1")) {
- echo "allowed > ";
- } else {
- echo "not allowed > ";
- }
- echo $_SERVER['REMOTE_ADDR'] . " Does not match " . $ip;
- //header("Location: " . siteinfo('home_url') . "404.php");
- }
- }
- ?>
Add Comment
Please, Sign In to add comment