diff options
Diffstat (limited to 'src/usr/local/www/services_dhcp.php')
-rw-r--r-- | src/usr/local/www/services_dhcp.php | 280 |
1 files changed, 125 insertions, 155 deletions
diff --git a/src/usr/local/www/services_dhcp.php b/src/usr/local/www/services_dhcp.php index e0c2ca4..f77e780 100644 --- a/src/usr/local/www/services_dhcp.php +++ b/src/usr/local/www/services_dhcp.php @@ -136,6 +136,12 @@ if (is_array($config['dhcpd'][$if])) { } else { $dhcpdconf = &$config['dhcpd'][$if]; } + + if (!is_array($config['dhcpd'][$if]['staticmap'])) { + $dhcpdconf['staticmap'] = array(); + } + + $a_maps = &$config['dhcpd'][$if]['staticmap']; } if (is_array($dhcpdconf)) { // Global Options @@ -156,12 +162,6 @@ if (is_array($dhcpdconf)) { } $pconfig['dhcpleaseinlocaltime'] = $dhcpleaseinlocaltime; - - if (!is_array($dhcpdconf['staticmap'])) { - $dhcpdconf['staticmap'] = array(); - } - - $a_maps = &$dhcpdconf['staticmap']; } else { // Options that exist only in pools $pconfig['descr'] = $dhcpdconf['descr']; @@ -181,6 +181,7 @@ if (is_array($dhcpdconf)) { list($pconfig['wins1'], $pconfig['wins2']) = $dhcpdconf['winsserver']; list($pconfig['dns1'], $pconfig['dns2'], $pconfig['dns3'], $pconfig['dns4']) = $dhcpdconf['dnsserver']; $pconfig['denyunknown'] = isset($dhcpdconf['denyunknown']); + $pconfig['nonak'] = isset($dhcpdconf['nonak']); $pconfig['ddnsdomain'] = $dhcpdconf['ddnsdomain']; $pconfig['ddnsdomainprimary'] = $dhcpdconf['ddnsdomainprimary']; $pconfig['ddnsdomainkeyname'] = $dhcpdconf['ddnsdomainkeyname']; @@ -230,7 +231,7 @@ if (isset($_POST['submit'])) { $numbervalue = array(); $numbervalue['number'] = htmlspecialchars($_POST["number{$x}"]); $numbervalue['type'] = htmlspecialchars($_POST["itemtype{$x}"]); - $numbervalue['value'] = str_replace('"', '"', htmlspecialchars($_POST["value{$x}"])); + $numbervalue['value'] = base64_encode($_POST["value{$x}"]); $numberoptions['item'][] = $numbervalue; } } @@ -292,7 +293,7 @@ if (isset($_POST['submit'])) { } if ($cpdata['timeout'] > $deftime) { $input_errors[] = sprintf(gettext( - "The Captive Portal zone '%s' has Hard Timeout parameter set to a value bigger than Default lease time (%s)."), $cpZone, $deftime); + 'The Captive Portal zone (%1$s) has Hard Timeout parameter set to a value bigger than Default lease time (%2$s).'), $cpZone, $deftime); } } } @@ -369,30 +370,31 @@ if (isset($_POST['submit'])) { } if ($_POST['staticarp'] && $noip) { - $input_errors[] = "Cannot enable static ARP when you have static map entries without IP addresses. Ensure all static maps have IP addresses and try again."; + $input_errors[] = gettext("Cannot enable static ARP when you have static map entries without IP addresses. Ensure all static maps have IP addresses and try again."); } if (is_array($pconfig['numberoptions']['item'])) { foreach ($pconfig['numberoptions']['item'] as $numberoption) { - if ($numberoption['type'] == 'text' && strstr($numberoption['value'], '"')) { + $numberoption_value = base64_decode($numberoption['value']); + if ($numberoption['type'] == 'text' && strstr($numberoption_value, '"')) { $input_errors[] = gettext("Text type cannot include quotation marks."); - } else if ($numberoption['type'] == 'string' && !preg_match('/^"[^"]*"$/', $numberoption['value']) && !preg_match('/^[0-9a-f]{2}(?:\:[0-9a-f]{2})*$/i', $numberoption['value'])) { + } else if ($numberoption['type'] == 'string' && !preg_match('/^"[^"]*"$/', $numberoption_value) && !preg_match('/^[0-9a-f]{2}(?:\:[0-9a-f]{2})*$/i', $numberoption_value)) { $input_errors[] = gettext("String type must be enclosed in quotes like \"this\" or must be a series of octets specified in hexadecimal, separated by colons, like 01:23:45:67:89:ab:cd:ef"); - } else if ($numberoption['type'] == 'boolean' && $numberoption['value'] != 'true' && $numberoption['value'] != 'false' && $numberoption['value'] != 'on' && $numberoption['value'] != 'off') { + } else if ($numberoption['type'] == 'boolean' && $numberoption_value != 'true' && $numberoption_value != 'false' && $numberoption_value != 'on' && $numberoption_value != 'off') { $input_errors[] = gettext("Boolean type must be true, false, on, or off."); - } else if ($numberoption['type'] == 'unsigned integer 8' && (!is_numeric($numberoption['value']) || $numberoption['value'] < 0 || $numberoption['value'] > 255)) { + } else if ($numberoption['type'] == 'unsigned integer 8' && (!is_numeric($numberoption_value) || $numberoption_value < 0 || $numberoption_value > 255)) { $input_errors[] = gettext("Unsigned 8-bit integer type must be a number in the range 0 to 255."); - } else if ($numberoption['type'] == 'unsigned integer 16' && (!is_numeric($numberoption['value']) || $numberoption['value'] < 0 || $numberoption['value'] > 65535)) { + } else if ($numberoption['type'] == 'unsigned integer 16' && (!is_numeric($numberoption_value) || $numberoption_value < 0 || $numberoption_value > 65535)) { $input_errors[] = gettext("Unsigned 16-bit integer type must be a number in the range 0 to 65535."); - } else if ($numberoption['type'] == 'unsigned integer 32' && (!is_numeric($numberoption['value']) || $numberoption['value'] < 0 || $numberoption['value'] > 4294967295)) { + } else if ($numberoption['type'] == 'unsigned integer 32' && (!is_numeric($numberoption_value) || $numberoption_value < 0 || $numberoption_value > 4294967295)) { $input_errors[] = gettext("Unsigned 32-bit integer type must be a number in the range 0 to 4294967295."); - } else if ($numberoption['type'] == 'signed integer 8' && (!is_numeric($numberoption['value']) || $numberoption['value'] < -128 || $numberoption['value'] > 127)) { + } else if ($numberoption['type'] == 'signed integer 8' && (!is_numeric($numberoption_value) || $numberoption_value < -128 || $numberoption_value > 127)) { $input_errors[] = gettext("Signed 8-bit integer type must be a number in the range -128 to 127."); - } else if ($numberoption['type'] == 'signed integer 16' && (!is_numeric($numberoption['value']) || $numberoption['value'] < -32768 || $numberoption['value'] > 32767)) { + } else if ($numberoption['type'] == 'signed integer 16' && (!is_numeric($numberoption_value) || $numberoption_value < -32768 || $numberoption_value > 32767)) { $input_errors[] = gettext("Signed 16-bit integer type must be a number in the range -32768 to 32767."); - } else if ($numberoption['type'] == 'signed integer 32' && (!is_numeric($numberoption['value']) || $numberoption['value'] < -2147483648 || $numberoption['value'] > 2147483647)) { + } else if ($numberoption['type'] == 'signed integer 32' && (!is_numeric($numberoption_value) || $numberoption_value < -2147483648 || $numberoption_value > 2147483647)) { $input_errors[] = gettext("Signed 32-bit integer type must be a number in the range -2147483648 to 2147483647."); - } else if ($numberoption['type'] == 'ip-address' && !is_ipaddrv4($numberoption['value']) && !is_hostname($numberoption['value'])) { + } else if ($numberoption['type'] == 'ip-address' && !is_ipaddrv4($numberoption_value) && !is_hostname($numberoption_value)) { $input_errors[] = gettext("IP address or host type must be an IP address or host name."); } } @@ -403,20 +405,17 @@ if (isset($_POST['submit'])) { $subnet_start = ip2ulong(long2ip32(ip2long($ifcfgip) & gen_subnet_mask_long($ifcfgsn))); $subnet_end = ip2ulong(long2ip32(ip2long($ifcfgip) | (~gen_subnet_mask_long($ifcfgsn)))); - if ((ip2ulong($_POST['range_from']) < $subnet_start) || (ip2ulong($_POST['range_from']) > $subnet_end) || - (ip2ulong($_POST['range_to']) < $subnet_start) || (ip2ulong($_POST['range_to']) > $subnet_end)) { - $input_errors[] = gettext("The specified range lies outside of the current subnet."); - } - if (ip2ulong($_POST['range_from']) > ip2ulong($_POST['range_to'])) { $input_errors[] = gettext("The range is invalid (first element higher than second element)."); } - if (is_numeric($pool) || ($act == "newpool")) { - $rfrom = $config['dhcpd'][$if]['range']['from']; - $rto = $config['dhcpd'][$if]['range']['to']; + if (ip2ulong($_POST['range_from']) < $subnet_start || ip2ulong($_POST['range_to']) > $subnet_end) { + $input_errors[] = gettext("The specified range lies outside of the current subnet."); + } - if (is_inrange_v4($_POST['range_from'], $rfrom, $rto) || is_inrange_v4($_POST['range_to'], $rfrom, $rto)) { + if (is_numeric($pool) || ($act == "newpool")) { + if (!((ip2ulong($_POST['range_from']) > ip2ulong($config['dhcpd'][$if]['range']['to'])) || + (ip2ulong($_POST['range_to']) < ip2ulong($config['dhcpd'][$if]['range']['from'])))) { $input_errors[] = gettext("The specified range must not be within the DHCP range for this interface."); } } @@ -426,8 +425,8 @@ if (isset($_POST['submit'])) { continue; } - if (is_inrange_v4($_POST['range_from'], $p['range']['from'], $p['range']['to']) || - is_inrange_v4($_POST['range_to'], $p['range']['from'], $p['range']['to'])) { + if (!((ip2ulong($_POST['range_from']) > ip2ulong($p['range']['to'])) || + (ip2ulong($_POST['range_to']) < ip2ulong($p['range']['from'])))) { $input_errors[] = gettext("The specified range must not be within the range configured on a DHCP pool for this interface."); break; } @@ -445,8 +444,8 @@ if (isset($_POST['submit'])) { if (empty($map['ipaddr'])) { continue; } - if ((ip2ulong($map['ipaddr']) > $dynsubnet_start) && - (ip2ulong($map['ipaddr']) < $dynsubnet_end)) { + if ((ip2ulong($map['ipaddr']) >= $dynsubnet_start) && + (ip2ulong($map['ipaddr']) <= $dynsubnet_end)) { $input_errors[] = sprintf(gettext("The DHCP range cannot overlap any static DHCP mappings.")); break; } @@ -539,6 +538,7 @@ if (isset($_POST['submit'])) { $dhcpdconf['domain'] = $_POST['domain']; $dhcpdconf['domainsearchlist'] = $_POST['domainsearchlist']; $dhcpdconf['denyunknown'] = ($_POST['denyunknown']) ? true : false; + $dhcpdconf['nonak'] = ($_POST['nonak']) ? true : false; $dhcpdconf['ddnsdomain'] = $_POST['ddnsdomain']; $dhcpdconf['ddnsdomainprimary'] = $_POST['ddnsdomainprimary']; $dhcpdconf['ddnsdomainkeyname'] = $_POST['ddnsdomainkeyname']; @@ -660,7 +660,7 @@ function build_pooltable() { $pooltbl .= '<th>' . gettext("Pool Start") . '</th>'; $pooltbl .= '<th>' . gettext("Pool End") . '</th>'; $pooltbl .= '<th>' . gettext("Description") . '</th>'; - $pooltbl .= '<th></th>'; + $pooltbl .= '<th>' . gettext("Actions") . '</th>'; $pooltbl .= '</tr>'; $pooltbl .= '</thead>'; $pooltbl .= '<tbody>'; @@ -679,9 +679,9 @@ function build_pooltable() { $pooltbl .= '<td ondblclick="document.location=\'services_dhcp.php?if=' . htmlspecialchars($if) . '&pool=' . $i . '\';">' . htmlspecialchars($poolent['descr']) . '</td>'; - $pooltbl .= '<td><a class="btn btn-xs btn-info" href="services_dhcp.php?if=' . htmlspecialchars($if) . '&pool=' . $i . '" />' . gettext('Edit') . '</a>'; + $pooltbl .= '<td><a class="fa fa-pencil" title="'. gettext("Edit pool") . '" href="services_dhcp.php?if=' . htmlspecialchars($if) . '&pool=' . $i . '"></a>'; - $pooltbl .= '<a class="btn btn-xs btn-danger" href="services_dhcp.php?if=' . htmlspecialchars($if) . '&act=delpool&id=' . $i . '" />' . gettext('Delete') . '</a></td>'; + $pooltbl .= ' <a class="fa fa-trash" title="'. gettext("Delete pool") . '" href="services_dhcp.php?if=' . htmlspecialchars($if) . '&act=delpool&id=' . $i . '"></a></td>'; $pooltbl .= '</tr>'; } $i++; @@ -715,7 +715,7 @@ if (isset($config['dhcrelay']['enable'])) { } if (is_subsystem_dirty('staticmaps')) { - print_info_box_np(gettext("The static mapping configuration has been changed") . ".<br />" . gettext("You must apply the changes in order for them to take effect.")); + print_apply_box(gettext("The static mapping configuration has been changed.") . "<br />" . gettext("You must apply the changes in order for them to take effect.")); } /* active tabs */ @@ -777,6 +777,14 @@ $section->addInput(new Form_Checkbox( $pconfig['denyunknown'] )); +$section->addInput(new Form_Checkbox( + 'nonak', + 'Ignore denied clients', + 'Denied clients will be ignored rather than rejected.', + $pconfig['nonak'] +)); + + if (is_numeric($pool) || ($act == "newpool")) { $section->addInput(new Form_Input( 'descr', @@ -806,7 +814,7 @@ $range_to--; $rangestr = long2ip32($range_from) . ' - ' . long2ip32($range_to); if (is_numeric($pool) || ($act == "newpool")) { - $rangestr .= '<br />' . 'In-use DHCP Pool Ranges:'; + $rangestr .= '<br />' . gettext('In-use DHCP Pool Ranges:'); if (is_array($config['dhcpd'][$if]['range'])) { $rangestr .= '<br />' . $config['dhcpd'][$if]['range']['from'] . ' - ' . $config['dhcpd'][$if]['range']['to']; } @@ -940,8 +948,8 @@ if (!is_numeric($pool) && !($act == "newpool")) { 'failover_peerip', 'Failover peer IP', $pconfig['failover_peerip'] - ))->setHelp('Leave blank to disable. Enter the interface IP address of the other machine. Machines must be using CARP.' . - 'Interface\'s advskew determines whether the DHCPd process is Primary or Secondary. Ensure one machine\'s advskew < 20 (and the other is > 20).'); + ))->setHelp('Leave blank to disable. Enter the interface IP address of the other machine. Machines must be using CARP. ' . + 'Interface\'s advskew determines whether the DHCPd process is Primary or Secondary. Ensure one machine\'s advskew < 20 (and the other is > 20).'); } if (!is_numeric($pool) && !($act == "newpool")) { @@ -950,7 +958,7 @@ if (!is_numeric($pool) && !($act == "newpool")) { 'Static ARP', 'Enable Static ARP entries', $pconfig['staticarp'] - ))->setHelp('This option persists even if DHCP server is disabled. Only the machines listed below will be able to communicate with the firewall on this NIC.'); + ))->setHelp('This option persists even if DHCP server is disabled. Only the machines listed below will be able to communicate with the firewall on this interface.'); $section->addInput(new Form_Checkbox( 'dhcpleaseinlocaltime', @@ -973,7 +981,7 @@ $btnadv = new Form_Button( 'Advanced' ); -$btnadv->removeClass('btn-primary')->addClass('btn-default btn-sm'); +$btnadv->removeClass('btn-primary')->addClass('btn-info btn-sm'); $section->addInput(new Form_StaticText( 'Dynamic DNS', @@ -990,7 +998,7 @@ $section->addInput(new Form_Checkbox( $section->addInput(new Form_Input( 'ddnsdomain', 'DDNS Domain', - 'number', + 'text', $pconfig['ddnsdomain'] ))->setHelp('Leave blank to disable dynamic DNS registration.' . '<br />' . 'Enter the dynamic DNS domain which will be used to register client names in the DNS server.'); @@ -1021,7 +1029,7 @@ $btnadv = new Form_Button( 'Advanced' ); -$btnadv->removeClass('btn-primary')->addClass('btn-default btn-sm'); +$btnadv->removeClass('btn-primary')->addClass('btn-info btn-sm'); $section->addInput(new Form_StaticText( 'MAC address control', @@ -1030,14 +1038,14 @@ $section->addInput(new Form_StaticText( $section->addInput(new Form_Input( 'mac_allow', - 'Allow', + 'MAC Allow', 'text', $pconfig['mac_allow'] ))->setHelp('List of partial MAC addresses to allow, comma separated, no spaces, e.g.: 00:00:00,01:E5:FF'); $section->addInput(new Form_Input( 'mac_deny', - 'Deny', + 'MAC Deny', 'text', $pconfig['mac_deny'] ))->setHelp('List of partial MAC addresses to deny access, comma separated, no spaces, e.g.: 00:00:00,01:E5:FF'); @@ -1048,24 +1056,24 @@ $btnadv = new Form_Button( 'Advanced' ); -$btnadv->removeClass('btn-primary')->addClass('btn-default btn-sm'); +$btnadv->removeClass('btn-primary')->addClass('btn-info btn-sm'); $section->addInput(new Form_StaticText( - 'NTP servers', + 'NTP', $btnadv )); $section->addInput(new Form_IpAddress( 'ntp1', - null, + 'NTP Server 1', $pconfig['ntp1'] -))->setAttribute('placeholder', 'NTP Server 1'); +)); $section->addInput(new Form_IpAddress( 'ntp2', - null, + 'NTP Server 2', $pconfig['ntp2'] -))->setAttribute('placeholder', 'NTP Server 2'); +)); // Advanced TFTP $btnadv = new Form_Button( @@ -1073,16 +1081,16 @@ $btnadv = new Form_Button( 'Advanced' ); -$btnadv->removeClass('btn-primary')->addClass('btn-default btn-sm'); +$btnadv->removeClass('btn-primary')->addClass('btn-info btn-sm'); $section->addInput(new Form_StaticText( - 'TFTP server', + 'TFTP', $btnadv )); $section->addInput(new Form_IpAddress( 'tftp', - null, + 'TFTP Server', $pconfig['tftp'] ))->setHelp('Leave blank to disable. Enter a full hostname or IP for the TFTP server')->setPattern('[.a-zA-Z0-9_]+'); @@ -1092,74 +1100,21 @@ $btnadv = new Form_Button( 'Advanced' ); -$btnadv->removeClass('btn-primary')->addClass('btn-default btn-sm'); +$btnadv->removeClass('btn-primary')->addClass('btn-info btn-sm'); $section->addInput(new Form_StaticText( - 'LDAP URI', + 'LDAP', $btnadv )); $section->addInput(new Form_Input( 'ldap', - null, + 'LDAP Server URI', 'text', $pconfig['ldap'] ))->setHelp('Leave blank to disable. Enter a full URI for the LDAP server in the form ldap://ldap.example.com/dc=example,dc=com '); -// Advanced NETBOOT -$btnadv = new Form_Button( - 'btnadvboot', - 'Advanced' -); - -$btnadv->removeClass('btn-primary')->addClass('btn-default btn-sm'); - -$section->addInput(new Form_StaticText( - 'Network booting', - $btnadv -)); - -$section->addInput(new Form_Checkbox( - 'netboot', - null, - 'Enables network booting', - $pconfig['netboot'] -)); - -$section->addInput(new Form_IpAddress( - 'nextserver', - 'Next Server', - $pconfig['nextserver'] -))->setHelp('Enter the IP address of the next server'); - -$section->addInput(new Form_Input( - 'filename', - 'Default BIOS file name', - 'text', - $pconfig['filename'] -)); - -$section->addInput(new Form_Input( - 'filename32', - 'UEFI 32 bit file name', - 'text', - $pconfig['filename32'] -)); - -$section->addInput(new Form_Input( - 'filename64', - 'UEFI 64 bit file name', - 'text', - $pconfig['filename64'] -))->setHelp('You need both a filename and a boot server configured for this to work! ' . - 'You will need all three filenames and a boot server configured for UEFI to work! '); - -$section->addInput(new Form_Input( - 'rootpath', - 'Root path', - 'text', - $pconfig['rootpath'] -))->setHelp('string-format: iscsi:(servername):(protocol):(port):(LUN):targetname '); +$form->add($section); // Advanced Additional options $btnadv = new Form_Button( @@ -1167,22 +1122,20 @@ $btnadv = new Form_Button( 'Advanced' ); -$btnadv->removeClass('btn-primary')->addClass('btn-default btn-sm'); +$btnadv->removeClass('btn-primary')->addClass('btn-info btn-sm'); $section->addInput(new Form_StaticText( 'Additional BOOTP/DHCP Options', $btnadv )); -$form->add($section); - $section = new Form_Section('Additional BOOTP/DHCP Options'); $section->addClass('adnlopts'); $section->addInput(new Form_StaticText( null, - '<div class="alert alert-info"> ' . gettext('Enter the DHCP option number and the value for each item you would like to include in the DHCP lease information. ' . - 'For a list of available options please visit this ') . '<a href="http://www.iana.org/assignments/bootp-dhcp-parameters/" target="_blank">' . gettext("URL") . '</a></div>' + '<div class="alert alert-info"> ' . gettext('Enter the DHCP option number and the value for each item you would like to include in the DHCP lease information.') . ' ' . + sprintf(gettext('For a list of available options please visit this %1$s URL%2$s'), '<a href="http://www.iana.org/assignments/bootp-dhcp-parameters/" target="_blank">', '</a></div>') )); if (!$pconfig['numberoptions']) { @@ -1203,7 +1156,7 @@ $numrows = count($pconfig['numberoptions']['item']) -1; foreach ($pconfig['numberoptions']['item'] as $item) { $number = $item['number']; $itemtype = $item['type']; - $value = $item['value']; + $value = base64_decode($item['value']); $group = new Form_Group(($counter == 0) ? 'Option':null); $group->addClass('repeatable'); @@ -1247,6 +1200,57 @@ $section->addInput(new Form_Button( $form->add($section); +if ($pconfig['netboot']) { + $sectate = COLLAPSIBLE|SEC_OPEN; +} else { + $sectate = COLLAPSIBLE|SEC_CLOSED; +} +$section = new Form_Section("Network booting", nwkbootsec, $sectate); + +$section->addInput(new Form_Checkbox( + 'netboot', + 'Enable', + 'Enables network booting', + $pconfig['netboot'] +)); + +$section->addInput(new Form_IpAddress( + 'nextserver', + 'Next Server', + $pconfig['nextserver'] +))->setHelp('Enter the IP address of the next server'); + +$section->addInput(new Form_Input( + 'filename', + 'Default BIOS file name', + 'text', + $pconfig['filename'] +)); + +$section->addInput(new Form_Input( + 'filename32', + 'UEFI 32 bit file name', + 'text', + $pconfig['filename32'] +)); + +$section->addInput(new Form_Input( + 'filename64', + 'UEFI 64 bit file name', + 'text', + $pconfig['filename64'] +))->setHelp('You need both a filename and a boot server configured for this to work! ' . + 'You will need all three filenames and a boot server configured for UEFI to work! '); + +$section->addInput(new Form_Input( + 'rootpath', + 'Root path', + 'text', + $pconfig['rootpath'] +))->setHelp('string-format: iscsi:(servername):(protocol):(port):(LUN):targetname '); + +$form->add($section); + if ($act == "newpool") { $form->addGlobal(new Form_Input( 'act', @@ -1394,7 +1398,6 @@ events.push(function() { hideInput('mac_allow', !showadvmac && !hide); hideInput('mac_deny', !showadvmac && !hide); - hideInput('btnadvmac', hide); showadvmac = !showadvmac; } @@ -1402,7 +1405,7 @@ events.push(function() { $('#btnadvmac').prop('type', 'button'); $('#btnadvmac').click(function(event) { - show_advmac(); + show_advmac(true); }); // Show advanced NTP options ====================================================================================== @@ -1432,7 +1435,7 @@ events.push(function() { }); // Show advanced TFTP options ====================================================================================== - var showadvtftp = false; + var showtftp = false; function show_advtftp() { <?php @@ -1444,10 +1447,9 @@ events.push(function() { ?> var hide = <?php if ($hide) {echo 'true';} else {echo 'false';} ?>; - hideInput('tftp', !showadvtftp && !hide); - hideInput('btnadvtftp', hide); + hideInput('tftp', !showtftp & !hide); - showadvtftp = !showadvtftp; + showtftp = !showtftp; } $('#btnadvtftp').prop('type', 'button'); @@ -1481,37 +1483,6 @@ events.push(function() { show_advldap(); }); - // Show advanced NETBOOT options =================================================================================== - var showadvboot = false; - - function show_advboot() { -<?php - if (!$pconfig['netboot'] && empty($pconfig['nextserver']) && empty($pconfig['filename']) && empty($pconfig['filename32']) && - empty($pconfig['filename64']) && empty($pconfig['rootpath'])) { - $hide = false; - } else { - $hide = true; - } -?> - var hide = <?php if ($hide) {echo 'true';} else {echo 'false';} ?>; - - hideCheckbox('netboot', !showadvboot && !hide); - hideInput('nextserver', !showadvboot && !hide); - hideInput('filename', !showadvboot && !hide); - hideInput('filename32', !showadvboot && !hide); - hideInput('filename64', !showadvboot && !hide); - hideInput('rootpath', !showadvboot && !hide); - hideInput('btnadvboot', hide); - - showadvboot = !showadvboot; - } - - $('#btnadvboot').prop('type', 'button'); - - $('#btnadvboot').click(function(event) { - show_advboot(); - }); - // Show advanced additional opts options =========================================================================== var showadvopts = false; @@ -1545,7 +1516,6 @@ events.push(function() { show_advntp(); show_advtftp(); show_advldap(); - show_advboot(); show_advopts(); // Suppress "Delete row" button if there are fewer than two rows |