Added a field on the Client Options page for the DHCP server identifier
authorJamie Cameron <jcameron@webmin.com>
Tue, 15 May 2007 22:45:03 +0000 (22:45 +0000)
committerJamie Cameron <jcameron@webmin.com>
Tue, 15 May 2007 22:45:03 +0000 (22:45 +0000)
dhcpd/CHANGELOG
dhcpd/edit_options.cgi
dhcpd/lang/en
dhcpd/params-lib.pl
dhcpd/save_options.cgi

index 183ed90..ae089e0 100644 (file)
@@ -15,3 +15,5 @@ Hosts with multiple fixed addresses have them all listed on the module's main pa
 Added checboxes and buttons for deleting multiple subnets, shared networks, hosts and groups at once.
 Fixed a bug that caused the display of large numbers of hosts and subnets to be slow.
 Changed the Module Config PID file setting to allow None to be selected, which tells the module to look at the dhcpd process instead (as on OpenBSD).
+---- Changes since 1.320 ----
+Added a field on the Client Options page for the DHCP server identifier.
index aefd66b..9a84d1d 100755 (executable)
@@ -115,6 +115,7 @@ print "</tr>\n";
 
 print "<tr>\n";
 print &option_input($text{'eopt_toffset'}, "time-offset", \@opts, 1);
+print &option_input($text{'plib_serverid'}, "dhcp-server-identifier", \@opts, 3);
 print "</tr>\n";
 
 print "<tr>\n";
index aee7872..8be92e2 100644 (file)
@@ -228,6 +228,7 @@ plib_nbns=NetBIOS name servers
 plib_nbscope=NetBIOS scope
 plib_nbntype=NetBIOS node type
 plib_toffset=Time offset
+plib_serverid=DHCP server identifier
 plib_ddnsdom=Dynamic DNS domain name
 plib_ddnsrevdom=Dynamic DNS reverse domain
 plib_ddnsup=Dynamic DNS enabled?
index 2895d7d..bec4b9e 100644 (file)
@@ -188,127 +188,5 @@ sub check_domain
 return $_[0] =~ /^[A-Za-z0-9\.\-]+$/ ? undef : &text('plib_invaliddom', $_[0]);
 }
 
-# display_options(&config)
-# Display a table of DHCP options
-sub display_options
-{
-print "<table border width=100%>\n";
-print "<tr $tb> <td><b>$text{'plib_copt'}</b></td> </tr>\n";
-print "<tr $cb> <td><table width=100%>\n";
-local @opts = &find("option", $_[0]);
-
-print "<tr>\n";
-print &p_option_input($text{'plib_chname'}, "host-name", \@opts, 3);
-print &p_option_input($text{'plib_defrouters'}, "routers", \@opts, 2);
-print "</tr>\n";
-
-print "<tr>\n";
-print &p_option_input($text{'plib_snmask'}, "subnet-mask", \@opts, 0);
-print &p_option_input($text{'plib_babbr'}, "broadcast-address", \@opts, 0);
-print "</tr>\n";
-
-print "<tr>\n";
-print &p_option_input($text{'plib_domname'}, "domain-name", \@opts, 3);
-print &p_option_input($text{'plib_dnsserv'}, "domain-name-servers", \@opts, 2);
-print "</tr>\n";
-
-print "<tr>\n";
-print &p_option_input($text{'plib_timeserv'}, "time-servers", \@opts, 2);
-print &p_option_input($text{'plib_logserv'}, "log-servers", \@opts, 2);
-print "</tr>\n";
-
-print "<tr>\n";
-print &p_option_input($text{'plib_swapserv'}, "swap-server", \@opts, 3);
-print &p_option_input($text{'plib_rdpath'}, "root-path", \@opts, 3);
-print "</tr>\n";
-
-print "<tr>\n";
-print &p_option_input($text{'plib_nisdom'}, "nis-domain", \@opts, 3);
-print &p_option_input($text{'plib_nisserv'}, "nis-servers", \@opts, 2);
-print "</tr>\n";
-
-print "<tr>\n";
-print &p_option_input($text{'plib_fontserv'}, "font-servers", \@opts, 2);
-print &p_option_input($text{'plib_xdmserv'}, "x-display-manager", \@opts, 2);
-print "</tr>\n";
-
-print "<tr>\n";
-print &p_option_input($text{'plib_statrouters'}, "static-routes", \@opts, 5);
-print "</tr>\n";
-
-print "<tr>\n";
-print &p_option_input($text{'plib_ntpserv'}, "ntp-servers", \@opts, 2);
-print &p_option_input($text{'plib_nbns'}, "netbios-name-servers", \@opts, 2);
-print "</tr>\n";
-
-print "<tr>\n";
-print &p_option_input($text{'plib_nbscope'}, "netbios-scope", \@opts, 3);
-print &p_option_input($text{'plib_nbntype'}, "netbios-node-type", \@opts, 1);
-print "</tr>\n";
-
-print "<tr>\n";
-print &p_option_input($text{'plib_toffset'}, "time-offset", \@opts, 1);
-print "</tr>\n";
-
-print "</table></td></tr></table>\n";
-}
-
-# p_option_input(text, name, &config, type)
-# types values:        0  - IP address
-#              1  - Integer
-#              2  - IP address list
-#              3  - String
-#              4  - Yes/no flag
-#              5  - IP address pairs
-sub p_option_input
-{
-local($rv, $v, $i);
-for($i=0; $i<@{$_[2]}; $i++) {
-       if ($_[2]->[$i]->{'values'}->[0] eq $_[1]) {
-               $v = $_[2]->[$i];
-               last;
-               }
-       }
-$rv = "<td><b>$_[0]</b></td>\n";
-if ($_[3] == 5) { $rv .= "<td colspan=3>"; }
-else { $rv .= "<td>"; }
-$rv .= sprintf "<input type=radio name=$_[1]_def value=1 %s> $text{'default'}\n",
-       $v ? "" : "checked";
-$rv .= sprintf "<input type=radio name=$_[1]_def value=0 %s> ",
-       $v ? "checked" : "";
-local @vl = $v ? @{$v->{'values'}} : ();
-@vl = @vl[1..$#vl];
-if ($_[3] == 0) {
-       $rv .= "<input name=$_[0] size=15 value=\"$vl[0]\">\n";
-       }
-elsif ($_[3] == 1) {
-       $rv .= "<input name=$_[0] size=8 value=\"$vl[0]\">\n";
-       }
-elsif ($_[3] == 2) {
-       @vl = grep { $_ ne "," } @vl;
-       $rv .= "<input name=$_[0] size=25 value=\"".join(" ", @vl)."\">\n";
-       }
-elsif ($_[3] == 3) {
-       local $str = $vl[0] =~ /^[0-9\:]+$/ ? &nvt_to_string($vl[0]) : $vl[0];
-       $rv .= "<input name=$_[0] size=20 value=\"$str\">\n";
-       }
-elsif ($_[3] == 4) {
-       $rv .= sprintf "<input name=$_[0] value=1 %s> $text{'yes'}\n",
-                       $vl[0] eq "1" ? "checked" : "";
-       $rv .= sprintf "<input name=$_[0] value=0 %s> $text{'no'}\n",
-                       $vl[0] eq "0" ? "checked" : "";
-       }
-elsif ($_[3] == 5) {
-       @vl = grep { $_ ne "," } @vl;
-       $rv .= "<input name=$_[0] size=50 value=\"";
-       for($i=0; $i<@vl; $i+=2) {
-               $rv .= $vl[$i]."-".$vl[$i+1];
-               }
-       $rv .= "\">\n";
-       }
-$rv .= "</td>\n";
-return $rv;
-}
-
 1;
 
index c46da18..113d3b2 100755 (executable)
@@ -61,6 +61,7 @@ else {
 &save_option("netbios-scope", 3, $client, $indent);
 &save_option("netbios-node-type", 1, $client, $indent);
 &save_option("time-offset", 1, $client, $indent);
+&save_option("dhcp-server-identifier", 3, $client, $indent);
 &save_option("slp-directory-agent", 2, $client, $indent, 1);
 &save_option("slp-service-scope", 3, $client, $indent, 1);
 if ($in{'level'} eq "global") {