|
|
@@ -1,8 +1,11 @@
|
|
|
<?php
|
|
|
-$allowed_host = 'admin.seecure.ch';
|
|
|
-$host = parse_url($_SERVER['HTTP_REFERER'], PHP_URL_HOST);
|
|
|
-if(substr($host, 0 - strlen($allowed_host)) != $allowed_host) {
|
|
|
- die("This file cannot be accessed directly");
|
|
|
+define('IS_AJAX', isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest');
|
|
|
+if(!IS_AJAX) {
|
|
|
+ die('Restricted access');
|
|
|
+}
|
|
|
+$pos = strpos($_SERVER['HTTP_REFERER'],getenv('HTTP_HOST'));
|
|
|
+if($pos===false) {
|
|
|
+ die('Restricted access');
|
|
|
}
|
|
|
|
|
|
require_once(__DIR__ . '/../../../init.php');
|