File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments