Add option for domains to search
authorJamie Cameron <jcameron@webmin.com>
Thu, 29 Sep 2011 03:55:11 +0000 (20:55 -0700)
committerJamie Cameron <jcameron@webmin.com>
Thu, 29 Sep 2011 03:55:11 +0000 (20:55 -0700)
https://sourceforge.net/tracker/?func=detail&atid=117457&aid=3415184&group_id=17457

dhcpd/CHANGELOG
dhcpd/edit_options.cgi
dhcpd/lang/en
dhcpd/save_options.cgi

index 1001405..be6edb3 100644 (file)
@@ -43,3 +43,5 @@ Hostname, IP address and MAC address clashes are now only checked for in the sam
 Multiple leases can now be deleted at once, thanks to a suggestion from Berni Elbourn.
 ---- Changes since 1.540 ----
 Added a Module Config option to automatically refresh the lease list every few seconds, and a link to force a manual refresh.
+---- Changes since 1.560 ----
+Added a client option for subnets and groups for DNS domains to search.
index 18688c7..24c0696 100755 (executable)
@@ -81,6 +81,10 @@ print &option_input($text{'eopt_domname'}, "domain-name", \@opts, 3);
 print &option_input($text{'eopt_dnsserv'}, "domain-name-servers", \@opts, 2);
 print "</tr>\n";
 
+print "<tr>\n";
+print &option_input($text{'eopt_domsearch'}, "domain-search", \@opts, 6);
+print "</tr>\n";
+
 print "<tr>\n";
 print &option_input($text{'eopt_timeserv'}, "time-servers", \@opts, 2);
 print &option_input($text{'eopt_logserv'}, "log-servers", \@opts, 2);
@@ -230,6 +234,7 @@ print "<input type=submit value=\"$text{'save'}\"></form>\n"
 #              3  - String
 #              4  - Yes/no flag
 #              5  - IP address pairs
+#              6  - String list
 sub option_input
 {
 local($rv, $v, $i);
@@ -240,7 +245,7 @@ for($i=0; $i<@{$_[2]}; $i++) {
                }
        }
 $rv = "<td><b>$_[0]</b></td>\n";
-if ($_[3] == 5 || $_[4]) { $rv .= "<td colspan=3 nowrap>"; }
+if ($_[3] == 5 || $_[3] == 6 || $_[4]) { $rv .= "<td colspan=3 nowrap>"; }
 else { $rv .= "<td nowrap>"; }
 $rv .= sprintf "<input type=radio name=$_[1]_def value=1 %s> $text{'default'}\n",
        $v ? "" : "checked";
@@ -281,6 +286,10 @@ elsif ($_[3] == 5) {
                }
        $rv .= "\">\n";
        }
+elsif ($_[3] == 6) {
+       @vl = map { s/,//g; $_ } grep { $_ ne "," } @vl;
+       $rv .= "<input name=$_[1] size=50 value=\"".join(" ", @vl)."\">\n";
+       }
 if ($_[4]) {
        $rv .= &ui_checkbox($_[1]."_bool", 1, $_[4], lc($bool) eq "true");
        }
index f4b6e04..3b89310 100644 (file)
@@ -277,6 +277,7 @@ eopt_smask=Subnet mask
 eopt_baddr=Broadcast address
 eopt_domname=Domain name
 eopt_dnsserv=DNS servers
+eopt_domsearch=DNS domains to search
 eopt_timeserv=Time servers
 eopt_logserv=Log servers
 eopt_swapserv=Swap server
index da89e92..482bfe5 100755 (executable)
@@ -49,6 +49,7 @@ else {
 &save_option("broadcast-address", 0, $client, $indent);
 &save_option("domain-name", 3, $client, $indent);
 &save_option("domain-name-servers", 2, $client, $indent);
+&save_option("domain-search", 6, $client, $indent);
 &save_option("time-servers", 2, $client, $indent);
 &save_option("log-servers", 2, $client, $indent);
 &save_option("swap-server", 2, $client, $indent);
@@ -227,8 +228,7 @@ else {
                $nv =~ /^-?\d+$/ || &error("'$nv' $text{'sopt_invalidint'}");
                }
        elsif ($_[1] == 2) {
-               local $ip;
-               foreach $ip (@nv) {
+               foreach my $ip (@nv) {
                        &to_ipaddress($ip) ||
                                &error("'$ip' $text{'sopt_invalidip'}");
                        }
@@ -250,6 +250,9 @@ else {
                        }
                $nv = join(", ", @nnv);
                }
+       elsif ($_[1] == 6) {
+               $nv = join(", ", map { "\"$_\"" } @nv);
+               }
        local @bool = !$_[4] ? ( ) :
                      $in{$_[0]."_bool"} ? ( "true" ) : ( "false" );
        local $dir = { 'name' => 'option',