-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.php
28 lines (28 loc) · 905 Bytes
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
if ($_SERVER['SERVER_NAME'] == 'test.greenhealtheugene.com') {
// Only display errors on the test server
error_reporting(E_ALL ^ E_NOTICE);
ini_set('display_errors', '1');
// Also restrict access on the test server
if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
$userIP = $_SERVER['HTTP_CLIENT_IP'];
} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$userIP = $_SERVER['HTTP_X_FORWARDED_FOR'];
} else {
$userIP = $_SERVER['REMOTE_ADDR'];
}
$testOkayIPs = array('67.189.2.252', '50.137.133.184', '67.170.165.87');
// Fine to view locally
if (stristr($userIP, '192.168.') === FALSE) {
if (!in_array($userIP, $testOkayIPs)) {
echo 'Access is restricted for '.$userIP.'.';
exit();
}
}
}
// END ERROR DISPLAY SETTINGS
require_once('controller/master.controller.php');
require_once('controller/controller.controller.php');
$mcp = new MasterController;
$mcp->loadController();
?>