Skip to content

Commit ed9450f

Browse files
authored
Commenting previously added code in /web/add/index.php
1 parent 4bb8a3f commit ed9450f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

web/add/web/index.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,15 @@
4747
// Define domain ip address
4848
$v_ip = escapeshellarg($_POST['v_ip']);
4949

50+
// Using public IP instead of internal IP when creating DNS
51+
// Gets public IP from 'v-list-user-ips' command (that reads /vesta/data/ips/ip), precisely from 'NAT' field
5052
$v_public_ip = $v_ip;
51-
$v_temp_ip = $_POST['v_ip'];
53+
$v_clean_ip = $_POST['v_ip']; // clean_ip = IP without quotas
5254
exec (VESTA_CMD."v-list-user-ips ".$user." json", $output, $return_var);
5355
$ips = json_decode(implode('', $output), true);
5456
unset($output);
55-
if (isset($ips[$v_temp_ip]) && isset($ips[$v_temp_ip]['NAT']) && trim($ips[$v_temp_ip]['NAT'])!='') {
56-
$v_public_ip = trim($ips[$v_temp_ip]['NAT']);
57+
if (isset($ips[$v_clean_ip]) && isset($ips[$v_clean_ip]['NAT']) && trim($ips[$v_clean_ip]['NAT'])!='') {
58+
$v_public_ip = trim($ips[$v_clean_ip]['NAT']);
5759
$v_public_ip = escapeshellarg($v_public_ip);
5860
}
5961

0 commit comments

Comments
 (0)