Multi-value options support

This commit is contained in:
Jamie Cameron
2010-05-06 22:20:44 -07:00
parent 29cbb306c0
commit ac39c49ec4
3 changed files with 5 additions and 2 deletions

View File

@@ -35,3 +35,5 @@ Converted buttons on the module's main page to use the Webmin UI library.
Expired leases are no longer counted towards usage on the DHCP Leases page.
Added a mode to the DHCP Leases page to show usage by subnet, thanks to a suggestion by Coles.
When applying the configuration fails with an error mentioning a line in the config file, 10 lines around that will also be displayed by Webmin in the error.
---- Changes since 1.510 ----
Added support for multi-value options, thanks to a patch from Luke Suchocki.

View File

@@ -147,8 +147,9 @@ if ($config{'dhcpd_version'} >= 3) {
printf "<input name=dnum_$i size=4 value='%s'>\n",
$o->{'values'}->[2];
print "$text{'eopt_dtype'}\n";
my $a=scalar(@{$o->{'values'}})-1;
printf "<input name=dtype_$i size=10 value='%s'>\n",
$o->{'values'}->[4];
join(" ",@{$o->{'values'}}[4..$a]);
print "</td> </tr>\n";
}

View File

@@ -98,7 +98,7 @@ if ($config{'dhcpd_version'} >= 3) {
&error(&text('sopt_edname', $in{"dname_$i"}));
$in{"dnum_$i"} =~ /^\d+$/ ||
&error(&text('sopt_ednum', $in{"dnum_$i"}));
$in{"dtype_$i"} =~ /^[a-z0-9\.\-\_]+$/i ||
$in{"dtype_$i"} =~ /^[a-z0-9\s\.\-\_]+$/i ||
&error(&text('sopt_edtype', $in{"dtype_$i"}));
push(@newdefs, { 'name' => 'option',
'values' => [ $in{"dname_$i"}, "code",