mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 18:49:21 -07:00
equalize with master
This commit is contained in:
parent
4fa549c570
commit
b2f2caf3bb
1 changed files with 1 additions and 3 deletions
|
@ -1,19 +1,18 @@
|
|||
<?php
|
||||
// Init
|
||||
define('NO_AUTH_REQUIRED',true);
|
||||
define('NO_AUTH_REQUIRED2',true);
|
||||
error_reporting(NULL);
|
||||
|
||||
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
|
||||
|
||||
// Checking IP of incoming connection, checking is it NAT address
|
||||
//echo '<pre>'; print_r($_SERVER); exit;
|
||||
$ok=0;
|
||||
$ip=$_SERVER['REMOTE_ADDR'];
|
||||
exec (VESTA_CMD."v-list-sys-ips json", $output, $return_var);
|
||||
$output=implode('', $output);
|
||||
$arr=json_decode($output, true);
|
||||
foreach ($arr as $arr_key => $arr_val) {
|
||||
// search for NAT IPs and allow them
|
||||
if ($ip==$arr_key || $ip==$arr_val['NAT']) {
|
||||
$ok=1;
|
||||
break;
|
||||
|
@ -22,7 +21,6 @@ foreach ($arr as $arr_key => $arr_val) {
|
|||
if ($ip == $_SERVER['SERVER_ADDR']) $ok=1;
|
||||
if ($ip == '127.0.0.1') $ok=1;
|
||||
if ($ok==0) exit;
|
||||
if (isset($_SERVER['HTTP_X_REAL_IP']) || isset($_SERVER['HTTP_X_FORWARDED_FOR'])) exit;
|
||||
|
||||
//
|
||||
// sourceforge.net/projects/postfixadmin/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue