File tree Expand file tree Collapse file tree 1 file changed +1
-3
lines changed
Expand file tree Collapse file tree 1 file changed +1
-3
lines changed Original file line number Diff line number Diff line change 11<?php
22// Init
33define ('NO_AUTH_REQUIRED ' ,true );
4- define ('NO_AUTH_REQUIRED2 ' ,true );
54error_reporting (NULL );
65
76include ($ _SERVER ['DOCUMENT_ROOT ' ]."/inc/main.php " );
87
98// Checking IP of incoming connection, checking is it NAT address
10- //echo '<pre>'; print_r($_SERVER); exit;
119$ ok =0 ;
1210$ ip =$ _SERVER ['REMOTE_ADDR ' ];
1311exec (VESTA_CMD ."v-list-sys-ips json " , $ output , $ return_var );
1412$ output =implode ('' , $ output );
1513$ arr =json_decode ($ output , true );
1614foreach ($ arr as $ arr_key => $ arr_val ) {
15+ // search for NAT IPs and allow them
1716 if ($ ip ==$ arr_key || $ ip ==$ arr_val ['NAT ' ]) {
1817 $ ok =1 ;
1918 break ;
2221if ($ ip == $ _SERVER ['SERVER_ADDR ' ]) $ ok =1 ;
2322if ($ ip == '127.0.0.1 ' ) $ ok =1 ;
2423if ($ ok ==0 ) exit ;
25- if (isset ($ _SERVER ['HTTP_X_REAL_IP ' ]) || isset ($ _SERVER ['HTTP_X_FORWARDED_FOR ' ])) exit ;
2624
2725//
2826// sourceforge.net/projects/postfixadmin/
You can’t perform that action at this time.
0 commit comments