diff --git a/inc/reserveip.class.php b/inc/reserveip.class.php index 3e52368..1954e59 100644 --- a/inc/reserveip.class.php +++ b/inc/reserveip.class.php @@ -184,18 +184,21 @@ function showReservationForm($ip, $id_addressing, $rand) { " . _n("IP address", "IP addresses", 1) . " " . $ip . " "; - $config = new PluginAddressingConfig(); - $config->getFromDB('1'); - $system = $config->fields["used_system"]; - - $ping_equip = new PluginAddressingPing_Equipment(); - list($message, $error) = $ping_equip->ping($system, $ip); - if ($error) { - echo " "; - echo __('Ping: no response - free IP', 'addressing'); - } else { - echo " "; - echo __('Ping: got a response - used IP', 'addressing'); + $ping = $addressing->fields["use_ping"]; + if ($ping == 1) { + $config = new PluginAddressingConfig(); + $config->getFromDB('1'); + $system = $config->fields["used_system"]; + + $ping_equip = new PluginAddressingPing_Equipment(); + list($message, $error) = $ping_equip->ping($system, $ip); + if ($error) { + echo " "; + echo __('Ping: no response - free IP', 'addressing'); + } else { + echo " "; + echo __('Ping: got a response - used IP', 'addressing'); + } } echo ""; echo "";