Fix reading of server list on page load

This commit is contained in:
Stephen Beaver 2016-01-02 20:52:51 -05:00
parent 5ab32eac07
commit d54d028f63
2 changed files with 8 additions and 4 deletions

View File

@ -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) {

View File

@ -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));
}
}