mirror of
https://github.com/myvesta/vesta
synced 2025-08-20 21:34:12 -07:00
Allow /reset/mail/ only from localhost
This commit is contained in:
parent
f16de5905a
commit
fb2cdf6fe1
1 changed files with 18 additions and 0 deletions
|
@ -6,6 +6,24 @@ error_reporting(NULL);
|
|||
|
||||
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
|
||||
|
||||
//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) {
|
||||
if ($ip==$arr_key || $ip==$arr_val['NAT']) {
|
||||
$ok=1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
//echo '<pre>ip='.$ip."\n".$return_var." = "; print_r($arr); exit;
|
||||
if ($ip == $_SERVER['SERVER_ADDR']) $ok=1;
|
||||
if ($ip == '127.0.0.1') $ok=1;
|
||||
//echo 'ok='.$ok."\n";
|
||||
if ($ok==0) exit;
|
||||
|
||||
//
|
||||
// sourceforge.net/projects/postfixadmin/
|
||||
// md5crypt
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue