From d54d028f6344cea2c916f6d5f7d659dec288652a Mon Sep 17 00:00:00 2001 From: Stephen Beaver Date: Sat, 2 Jan 2016 20:52:51 -0500 Subject: Fix reading of server list on page load --- src/usr/local/www/services_dhcp_relay.php | 4 +++- src/usr/local/www/services_dhcpv6_relay.php | 8 +++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/usr/local/www/services_dhcp_relay.php b/src/usr/local/www/services_dhcp_relay.php index ada2eae..2ddbd6e 100644 --- a/src/usr/local/www/services_dhcp_relay.php +++ b/src/usr/local/www/services_dhcp_relay.php @@ -149,6 +149,8 @@ if ($_POST) { } } +$pconfig['server'] = $config['dhcrelay']['server']; + $pgtitle = array(gettext("Services"), gettext("DHCP Relay")); $shortcut_section = "dhcp"; include("head.inc"); @@ -212,7 +214,7 @@ function createDestinationServerInputGroup($value = null) { return $group; } -if (!isset($pconfig['server']) || count($pconfig['server']) < 1) { +if (!isset($pconfig['server'])) { $section->add(createDestinationServerInputGroup()); } else { foreach (explode(',', $pconfig['server']) as $server) { diff --git a/src/usr/local/www/services_dhcpv6_relay.php b/src/usr/local/www/services_dhcpv6_relay.php index 62a4f5b..93ca9e9 100644 --- a/src/usr/local/www/services_dhcpv6_relay.php +++ b/src/usr/local/www/services_dhcpv6_relay.php @@ -147,6 +147,8 @@ if ($_POST) { } } +$pconfig['server'] = $config['dhcrelay6']['server']; + $pgtitle = array(gettext("Services"), gettext("DHCPv6 Relay")); $shortcut_section = "dhcp6"; include("head.inc"); @@ -211,11 +213,11 @@ function createDestinationServerInputGroup($value = null) { return $group; } -if (!isset($pconfig['server']) || count($pconfig['server']) < 1) { +if (!isset($pconfig['server'])) { $section->add(createDestinationServerInputGroup()); } else { - foreach ($pconfig['server'] as $server) { - $section->add(createDestinationServerInputGroup($server[0])); + foreach (explode(',', $pconfig['server']) as $server) { + $section->add(createDestinationServerInputGroup($server)); } } -- cgit v1.1