Skip to content

Commit fb2cdf6

Browse files
authored
Allow /reset/mail/ only from localhost
1 parent f16de59 commit fb2cdf6

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

web/reset/mail/index.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,24 @@
66

77
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
88

9+
//echo '<pre>'; print_r($_SERVER); exit;
10+
$ok=0;
11+
$ip=$_SERVER['REMOTE_ADDR'];
12+
exec (VESTA_CMD."v-list-sys-ips json", $output, $return_var);
13+
$output=implode('', $output);
14+
$arr=json_decode($output, true);
15+
foreach ($arr as $arr_key => $arr_val) {
16+
if ($ip==$arr_key || $ip==$arr_val['NAT']) {
17+
$ok=1;
18+
break;
19+
}
20+
}
21+
//echo '<pre>ip='.$ip."\n".$return_var." = "; print_r($arr); exit;
22+
if ($ip == $_SERVER['SERVER_ADDR']) $ok=1;
23+
if ($ip == '127.0.0.1') $ok=1;
24+
//echo 'ok='.$ok."\n";
25+
if ($ok==0) exit;
26+
927
//
1028
// sourceforge.net/projects/postfixadmin/
1129
// md5crypt

0 commit comments

Comments
 (0)