Commenting previously added code in /web/add/index.php

This commit is contained in:
dpeca 2016-11-11 13:06:12 +01:00 committed by GitHub
commit ed9450f117

View file

@ -47,13 +47,15 @@ if (!empty($_POST['ok'])) {
// Define domain ip address // Define domain ip address
$v_ip = escapeshellarg($_POST['v_ip']); $v_ip = escapeshellarg($_POST['v_ip']);
// Using public IP instead of internal IP when creating DNS
// Gets public IP from 'v-list-user-ips' command (that reads /vesta/data/ips/ip), precisely from 'NAT' field
$v_public_ip = $v_ip; $v_public_ip = $v_ip;
$v_temp_ip = $_POST['v_ip']; $v_clean_ip = $_POST['v_ip']; // clean_ip = IP without quotas
exec (VESTA_CMD."v-list-user-ips ".$user." json", $output, $return_var); exec (VESTA_CMD."v-list-user-ips ".$user." json", $output, $return_var);
$ips = json_decode(implode('', $output), true); $ips = json_decode(implode('', $output), true);
unset($output); unset($output);
if (isset($ips[$v_temp_ip]) && isset($ips[$v_temp_ip]['NAT']) && trim($ips[$v_temp_ip]['NAT'])!='') { if (isset($ips[$v_clean_ip]) && isset($ips[$v_clean_ip]['NAT']) && trim($ips[$v_clean_ip]['NAT'])!='') {
$v_public_ip = trim($ips[$v_temp_ip]['NAT']); $v_public_ip = trim($ips[$v_clean_ip]['NAT']);
$v_public_ip = escapeshellarg($v_public_ip); $v_public_ip = escapeshellarg($v_public_ip);
} }