Feature #13085 » expose_nbdd_servers-v1.0.patch
| src/usr/local/www/vpn_openvpn_server.php | ||
|---|---|---|
|
}
|
||
|
$pconfig['nbdd_server1'] = $a_server[$id]['nbdd_server1'];
|
||
|
if ($pconfig['nbdd_server1']) {
|
||
|
$pconfig['nbdd_server2'] = $a_server[$id]['nbdd_server2'];
|
||
|
if ($pconfig['nbdd_server1'] ||
|
||
|
$pconfig['nbdd_server2']) {
|
||
|
$pconfig['nbdd_server_enable'] = true;
|
||
|
}
|
||
| ... | ... | |
|
$input_errors[] = gettext("The field 'WINS Server #2' must contain a valid IP address");
|
||
|
}
|
||
|
}
|
||
|
if ($pconfig['nbdd_server_enable']) {
|
||
|
if (!empty($pconfig['nbdd_server1']) && !is_ipaddr(trim($pconfig['nbdd_server1']))) {
|
||
|
$input_errors[] = gettext("The field 'NetBIOS Data Distribution Server #1' must contain a valid IP address");
|
||
|
}
|
||
|
if (!empty($pconfig['nbdd_server2']) && !is_ipaddr(trim($pconfig['nbdd_server2']))) {
|
||
|
$input_errors[] = gettext("The field 'NetBIOS Data Distribution Server #2' must contain a valid IP address");
|
||
|
}
|
||
|
}
|
||
|
if (!empty($pconfig['netbios_ntype']) &&
|
||
|
!array_key_exists($pconfig['netbios_ntype'], $netbios_nodetypes)) {
|
||
| ... | ... | |
|
}
|
||
|
$server['netbios_enable'] = $pconfig['netbios_enable'];
|
||
|
if ($pconfig['netbios_enable']) {
|
||
|
$server['netbios_ntype'] = $pconfig['netbios_ntype'];
|
||
|
$server['netbios_scope'] = $pconfig['netbios_scope'];
|
||
|
$server['create_gw'] = $pconfig['create_gw'];
|
||
|
$server['verbosity_level'] = $pconfig['verbosity_level'];
|
||
|
if ($pconfig['netbios_enable']) {
|
||
|
if ($pconfig['wins_server_enable']) {
|
||
|
$server['wins_server1'] = $pconfig['wins_server1'];
|
||
|
$server['wins_server2'] = $pconfig['wins_server2'];
|
||
|
}
|
||
|
if ($pconfig['dns_server_enable']) {
|
||
|
if ($pconfig['nbdd_server_enable']) {
|
||
|
$server['nbdd_server1'] = $pconfig['nbdd_server1'];
|
||
|
$server['nbdd_server2'] = $pconfig['nbdd_server2'];
|
||
|
}
|
||
|
}
|
||
|
$server['create_gw'] = $pconfig['create_gw'];
|
||
|
$server['verbosity_level'] = $pconfig['verbosity_level'];
|
||
|
if ($_POST['duplicate_cn'] == "yes") {
|
||
|
$server['duplicate_cn'] = true;
|
||
|
}
|
||
| ... | ... | |
|
$section->addInput(new Form_Checkbox(
|
||
|
'wins_server_enable',
|
||
|
'WINS server enable',
|
||
|
'WINS servers',
|
||
|
'Provide a WINS server list to clients',
|
||
|
$pconfig['wins_server_enable']
|
||
|
));
|
||
|
$section->addInput(new Form_Input(
|
||
|
$group = new Form_Group(null);
|
||
|
$group->add(new Form_Input(
|
||
|
'wins_server1',
|
||
|
'WINS Server 1',
|
||
|
null,
|
||
|
'text',
|
||
|
$pconfig['wins_server1']
|
||
|
));
|
||
|
))->setHelp('Server 1');
|
||
|
$section->addInput(new Form_Input(
|
||
|
$group->add(new Form_Input(
|
||
|
'wins_server2',
|
||
|
'WINS Server 2',
|
||
|
null,
|
||
|
'text',
|
||
|
$pconfig['wins_server2']
|
||
|
))->setHelp('Server 2');
|
||
|
$group->addClass('winsservers');
|
||
|
$section->add($group);
|
||
|
$section->addInput(new Form_Checkbox(
|
||
|
'nbdd_server_enable',
|
||
|
'NBDD servers',
|
||
|
'Provide a NetBIOS over TCP/IP Datagram Distribution Servers list to clients',
|
||
|
$pconfig['nbdd_server_enable']
|
||
|
));
|
||
|
$group = new Form_Group(null);
|
||
|
$group->add(new Form_Input(
|
||
|
'nbdd_server1',
|
||
|
null,
|
||
|
'text',
|
||
|
$pconfig['nbdd_server1']
|
||
|
))->setHelp('Server 1');
|
||
|
$group->add(new Form_Input(
|
||
|
'nbdd_server2',
|
||
|
null,
|
||
|
'text',
|
||
|
$pconfig['nbdd_server2']
|
||
|
))->setHelp('Server 2');
|
||
|
$group->addClass('nbddservers');
|
||
|
$section->add($group);
|
||
|
$form->add($section);
|
||
|
$section = new Form_Section('Advanced Configuration');
|
||
| ... | ... | |
|
}
|
||
|
function wins_server_change() {
|
||
|
var hide = ! $('#wins_server_enable').prop('checked')
|
||
|
hideClass('winsservers', ! $('#wins_server_enable').prop('checked'));
|
||
|
}
|
||
|
hideInput('wins_server1', hide);
|
||
|
hideInput('wins_server2', hide);
|
||
|
function nbdd_server_change() {
|
||
|
hideClass('nbddservers', ! $('#nbdd_server_enable').prop('checked'));
|
||
|
}
|
||
|
function ntp_server_change() {
|
||
|
var hide = ! $('#ntp_server_enable').prop('checked')
|
||
| ... | ... | |
|
}
|
||
|
function netbios_change() {
|
||
|
var hide = ! $('#netbios_enable').prop('checked')
|
||
|
hideInput('netbios_ntype', hide);
|
||
|
hideInput('netbios_scope', hide);
|
||
|
hideCheckbox('wins_server_enable', hide);
|
||
|
if ($('#netbios_enable').prop('checked')) {
|
||
|
hideInput('netbios_ntype', false);
|
||
|
hideInput('netbios_scope', false);
|
||
|
hideCheckbox('wins_server_enable', false);
|
||
|
wins_server_change();
|
||
|
hideCheckbox('nbdd_server_enable', false);
|
||
|
nbdd_server_change();
|
||
|
} else {
|
||
|
hideInput('netbios_ntype', true);
|
||
|
hideInput('netbios_scope', true);
|
||
|
hideCheckbox('wins_server_enable', true);
|
||
|
hideClass('winsservers', true);
|
||
|
hideCheckbox('nbdd_server_enable', true);
|
||
|
hideClass('nbddservers', true);
|
||
|
}
|
||
|
}
|
||
|
function tuntap_change() {
|
||
| ... | ... | |
|
wins_server_change();
|
||
|
});
|
||
|
// NBDD server port
|
||
|
$('#nbdd_server_enable').click(function () {
|
||
|
nbdd_server_change();
|
||
|
});
|
||
|
// DNS server port
|
||
|
$('#dns_server_enable').click(function () {
|
||
|
dns_server_change();
|
||
| ... | ... | |
|
dns_domain_change();
|
||
|
dns_server_change();
|
||
|
wins_server_change();
|
||
|
nbdd_server_change
|
||
|
ntp_server_change();
|
||
|
netbios_change();
|
||
|
tuntap_change();
|
||
|
-- a/src/usr/local/www/vpn_openvpn_csc.php
|
||
|
++ b/src/usr/local/www/vpn_openvpn_csc.php
|
||
| ... | ... | |
|
exit;
|
||
|
}
|
||
|
if (!$user_can_edit_advanced && !empty($a_csc[$id]['custom_options'])) {
|
||
|
if (!$user_can_edit_advanced && !empty_field($a_csc[$id]['custom_options'])) {
|
||
|
$input_errors[] = gettext("This user does not have sufficient privileges to delete an instance with Advanced options set.");
|
||
|
} else {
|
||
|
$wc_msg = sprintf(gettext('Deleted OpenVPN client specific override %1$s %2$s'), $a_csc[$id]['common_name'], $a_csc[$id]['description']);
|
||
| ... | ... | |
|
$pconfig['remove_route'] = $a_csc[$id]['remove_route'];
|
||
|
$pconfig['dns_domain'] = $a_csc[$id]['dns_domain'];
|
||
|
if ($pconfig['dns_domain']) {
|
||
|
if (!empty_field($pconfig['dns_domain'])) {
|
||
|
$pconfig['dns_domain_enable'] = true;
|
||
|
}
|
||
| ... | ... | |
|
$pconfig['dns_server3'] = $a_csc[$id]['dns_server3'];
|
||
|
$pconfig['dns_server4'] = $a_csc[$id]['dns_server4'];
|
||
|
if ($pconfig['dns_server1'] ||
|
||
|
$pconfig['dns_server2'] ||
|
||
|
$pconfig['dns_server3'] ||
|
||
|
$pconfig['dns_server4']) {
|
||
|
if (!empty_field($pconfig['dns_server1']) ||
|
||
|
!empty_field($pconfig['dns_server2']) ||
|
||
|
!empty_field($pconfig['dns_server3']) ||
|
||
|
!empty_field($pconfig['dns_server4'])) {
|
||
|
$pconfig['dns_server_enable'] = true;
|
||
|
}
|
||
|
$pconfig['ntp_server1'] = $a_csc[$id]['ntp_server1'];
|
||
|
$pconfig['ntp_server2'] = $a_csc[$id]['ntp_server2'];
|
||
|
if ($pconfig['ntp_server1'] ||
|
||
|
$pconfig['ntp_server2']) {
|
||
|
if (!empty_field($pconfig['ntp_server1']) ||
|
||
|
!empty_field($pconfig['ntp_server2'])) {
|
||
|
$pconfig['ntp_server_enable'] = true;
|
||
|
}
|
||
| ... | ... | |
|
$pconfig['wins_server1'] = $a_csc[$id]['wins_server1'];
|
||
|
$pconfig['wins_server2'] = $a_csc[$id]['wins_server2'];
|
||
|
if ($pconfig['wins_server1'] ||
|
||
|
$pconfig['wins_server2']) {
|
||
|
if (!empty_field($pconfig['wins_server1']) ||
|
||
|
!empty_field($pconfig['wins_server2'])) {
|
||
|
$pconfig['wins_server_enable'] = true;
|
||
|
}
|
||
|
$pconfig['nbdd_server1'] = $a_csc[$id]['nbdd_server1'];
|
||
|
if ($pconfig['nbdd_server1']) {
|
||
|
$pconfig['nbdd_server2'] = $a_csc[$id]['nbdd_server2'];
|
||
|
if (!empty_field($pconfig['nbdd_server1']) ||
|
||
|
!empty_field($pconfig['nbdd_server2'])) {
|
||
|
$pconfig['nbdd_server_enable'] = true;
|
||
|
}
|
||
|
}
|
||
| ... | ... | |
|
!$user_can_edit_advanced) {
|
||
|
$input_errors[] = gettext("This user does not have sufficient privileges to edit Advanced options on this instance.");
|
||
|
}
|
||
|
if (!$user_can_edit_advanced && !empty($a_csc[$id]['custom_options'])) {
|
||
|
if (!$user_can_edit_advanced && !empty_field($a_csc[$id]['custom_options'])) {
|
||
|
// restore custom options field to its original value
|
||
|
$pconfig['custom_options'] = $a_csc[$id]['custom_options'];
|
||
|
}
|
||
| ... | ... | |
|
}
|
||
|
}
|
||
|
if (!empty($pconfig['tunnel_network']) && !openvpn_validate_tunnel_network($pconfig['tunnel_network'], 'ipv4')) {
|
||
|
if (!empty_field($pconfig['tunnel_network']) && !openvpn_validate_tunnel_network($pconfig['tunnel_network'], 'ipv4')) {
|
||
|
$input_errors[] = gettext("The field 'IPv4 Tunnel Network' must contain a valid IPv4 subnet with CIDR mask or an alias with a single IPv4 subnet with CIDR mask.");
|
||
|
}
|
||
|
if (!empty($pconfig['tunnel_networkv6']) && !openvpn_validate_tunnel_network($pconfig['tunnel_networkv6'], 'ipv6')) {
|
||
|
if (!empty_field($pconfig['tunnel_networkv6']) && !openvpn_validate_tunnel_network($pconfig['tunnel_networkv6'], 'ipv6')) {
|
||
|
$input_errors[] = gettext("The field 'IPv6 Tunnel Network' must contain a valid IPv6 prefix or an alias with a single IPv6 prefix.");
|
||
|
}
|
||
| ... | ... | |
|
}
|
||
|
if ($pconfig['dns_server_enable']) {
|
||
|
if (!empty($pconfig['dns_server1']) && !is_ipaddr(trim($pconfig['dns_server1']))) {
|
||
|
if (!empty_field($pconfig['dns_server1']) && !is_ipaddr(trim($pconfig['dns_server1']))) {
|
||
|
$input_errors[] = gettext("The field 'DNS Server #1' must contain a valid IP address");
|
||
|
}
|
||
|
if (!empty($pconfig['dns_server2']) && !is_ipaddr(trim($pconfig['dns_server2']))) {
|
||
|
if (!empty_field($pconfig['dns_server2']) && !is_ipaddr(trim($pconfig['dns_server2']))) {
|
||
|
$input_errors[] = gettext("The field 'DNS Server #2' must contain a valid IP address");
|
||
|
}
|
||
|
if (!empty($pconfig['dns_server3']) && !is_ipaddr(trim($pconfig['dns_server3']))) {
|
||
|
if (!empty_field($pconfig['dns_server3']) && !is_ipaddr(trim($pconfig['dns_server3']))) {
|
||
|
$input_errors[] = gettext("The field 'DNS Server #3' must contain a valid IP address");
|
||
|
}
|
||
|
if (!empty($pconfig['dns_server4']) && !is_ipaddr(trim($pconfig['dns_server4']))) {
|
||
|
if (!empty_field($pconfig['dns_server4']) && !is_ipaddr(trim($pconfig['dns_server4']))) {
|
||
|
$input_errors[] = gettext("The field 'DNS Server #4' must contain a valid IP address");
|
||
|
}
|
||
|
}
|
||
|
if ($pconfig['ntp_server_enable']) {
|
||
|
if (!empty($pconfig['ntp_server1']) && !is_ipaddr(trim($pconfig['ntp_server1']))) {
|
||
|
if (!empty_field($pconfig['ntp_server1']) && !is_ipaddr(trim($pconfig['ntp_server1']))) {
|
||
|
$input_errors[] = gettext("The field 'NTP Server #1' must contain a valid IP address");
|
||
|
}
|
||
|
if (!empty($pconfig['ntp_server2']) && !is_ipaddr(trim($pconfig['ntp_server2']))) {
|
||
|
if (!empty_field($pconfig['ntp_server2']) && !is_ipaddr(trim($pconfig['ntp_server2']))) {
|
||
|
$input_errors[] = gettext("The field 'NTP Server #2' must contain a valid IP address");
|
||
|
}
|
||
|
if (!empty($pconfig['ntp_server3']) && !is_ipaddr(trim($pconfig['ntp_server3']))) {
|
||
|
if (!empty_field($pconfig['ntp_server3']) && !is_ipaddr(trim($pconfig['ntp_server3']))) {
|
||
|
$input_errors[] = gettext("The field 'NTP Server #3' must contain a valid IP address");
|
||
|
}
|
||
|
if (!empty($pconfig['ntp_server4']) && !is_ipaddr(trim($pconfig['ntp_server4']))) {
|
||
|
if (!empty_field($pconfig['ntp_server4']) && !is_ipaddr(trim($pconfig['ntp_server4']))) {
|
||
|
$input_errors[] = gettext("The field 'NTP Server #4' must contain a valid IP address");
|
||
|
}
|
||
|
}
|
||
|
if ($pconfig['netbios_enable']) {
|
||
|
if ($pconfig['wins_server_enable']) {
|
||
|
if (!empty($pconfig['wins_server1']) && !is_ipaddr(trim($pconfig['wins_server1']))) {
|
||
|
if (!empty_field($pconfig['wins_server1']) && !is_ipaddr(trim($pconfig['wins_server1']))) {
|
||
|
$input_errors[] = gettext("The field 'WINS Server #1' must contain a valid IP address");
|
||
|
}
|
||
|
if (!empty($pconfig['wins_server2']) && !is_ipaddr(trim($pconfig['wins_server2']))) {
|
||
|
if (!empty_field($pconfig['wins_server2']) && !is_ipaddr(trim($pconfig['wins_server2']))) {
|
||
|
$input_errors[] = gettext("The field 'WINS Server #2' must contain a valid IP address");
|
||
|
}
|
||
|
}
|
||
|
if ($pconfig['nbdd_server_enable']) {
|
||
|
if (!empty($pconfig['nbdd_server1']) && !is_ipaddr(trim($pconfig['nbdd_server1']))) {
|
||
|
if (!empty_field($pconfig['nbdd_server1']) && !is_ipaddr(trim($pconfig['nbdd_server1']))) {
|
||
|
$input_errors[] = gettext("The field 'NetBIOS Data Distribution Server #1' must contain a valid IP address");
|
||
|
}
|
||
|
if (!empty_field($pconfig['nbdd_server2']) && !is_ipaddr(trim($pconfig['nbdd_server2']))) {
|
||
|
$input_errors[] = gettext("The field 'NetBIOS Data Distribution Server #2' must contain a valid IP address");
|
||
|
}
|
||
|
}
|
||
|
if (!empty($pconfig['netbios_ntype']) &&
|
||
|
!array_key_exists($pconfig['netbios_ntype'], $netbios_nodetypes)) {
|
||
| ... | ... | |
|
}
|
||
|
$csc['netbios_enable'] = $pconfig['netbios_enable'];
|
||
|
if ($pconfig['netbios_enable']) {
|
||
|
$csc['netbios_ntype'] = $pconfig['netbios_ntype'];
|
||
|
$csc['netbios_scope'] = $pconfig['netbios_scope'];
|
||
|
if ($pconfig['netbios_enable']) {
|
||
|
if ($pconfig['wins_server_enable']) {
|
||
|
$csc['wins_server1'] = $pconfig['wins_server1'];
|
||
|
$csc['wins_server2'] = $pconfig['wins_server2'];
|
||
|
}
|
||
|
if ($pconfig['dns_server_enable']) {
|
||
|
if ($pconfig['nbdd_server_enable']) {
|
||
|
$csc['nbdd_server1'] = $pconfig['nbdd_server1'];
|
||
|
$csc['nbdd_server2'] = $pconfig['nbdd_server2'];
|
||
|
}
|
||
|
}
|
||
| ... | ... | |
|
$wc_msg = sprintf(gettext('Added OpenVPN client specific override %1$s %2$s'), $csc['common_name'], $csc['description']);
|
||
|
}
|
||
|
if (!empty($old_csc['common_name'])) {
|
||
|
if (!empty_field($old_csc['common_name'])) {
|
||
|
openvpn_delete_csc($old_csc);
|
||
|
}
|
||
|
openvpn_resync_csc($csc);
|
||
| ... | ... | |
|
'DNS Default Domain',
|
||
|
'Provide a default domain name to clients',
|
||
|
$pconfig['dns_domain_enable']
|
||
|
))->toggles('.dnsdomain');
|
||
|
));
|
||
|
$group = new Form_Group('DNS Domain');
|
||
|
$group->addClass('dnsdomain');
|
||
| ... | ... | |
|
'DNS Servers',
|
||
|
'Provide a DNS server list to clients',
|
||
|
$pconfig['dns_server_enable']
|
||
|
))->toggles('.dnsservers');
|
||
|
));
|
||
|
$group = new Form_Group(null);
|
||
|
$group->addClass('dnsservers');
|
||
| ... | ... | |
|
'NTP Servers',
|
||
|
'Provide an NTP server list to clients',
|
||
|
$pconfig['ntp_server_enable']
|
||
|
))->toggles('.ntpservers');
|
||
|
));
|
||
|
$group = new Form_Group(null);
|
||
|
$group->addClass('ntpservers');
|
||
| ... | ... | |
|
$section->add($group);
|
||
|
// NTP servers - For this section we need to use Javascript hiding since there
|
||
|
// Netbios - For this section we need to use Javascript hiding since there
|
||
|
// are nested toggles
|
||
|
$section->addInput(new Form_Checkbox(
|
||
|
'netbios_enable',
|
||
| ... | ... | |
|
$section->add($group);
|
||
|
$section->addInput(new Form_Checkbox(
|
||
|
'nbdd_server_enable',
|
||
|
'NBDD servers',
|
||
|
'Provide a NetBIOS over TCP/IP Datagram Distribution Servers list to clients',
|
||
|
$pconfig['nbdd_server_enable']
|
||
|
));
|
||
|
$group = new Form_Group(null);
|
||
|
$group->add(new Form_Input(
|
||
|
'nbdd_server1',
|
||
|
null,
|
||
|
'text',
|
||
|
$pconfig['nbdd_server1']
|
||
|
))->setHelp('Server 1');
|
||
|
$group->add(new Form_Input(
|
||
|
'nbdd_server2',
|
||
|
null,
|
||
|
'text',
|
||
|
$pconfig['nbdd_server2']
|
||
|
))->setHelp('Server 2');
|
||
|
$group->addClass('nbddservers');
|
||
|
$section->add($group);
|
||
|
$custops = new Form_Textarea(
|
||
|
'custom_options',
|
||
|
'Advanced',
|
||
| ... | ... | |
|
<script type="text/javascript">
|
||
|
//<![CDATA[
|
||
|
events.push(function() {
|
||
|
function dnsdomain_change() {
|
||
|
if ($('#dns_domain_enable').prop('checked')) {
|
||
|
hideClass('dnsdomain', false);
|
||
|
} else {
|
||
|
hideClass('dnsdomain', true);
|
||
|
}
|
||
|
}
|
||
|
// Hide/show that section, but have to also respect the wins_server_enable checkbox
|
||
|
function dnsservers_change() {
|
||
|
if ($('#dns_server_enable').prop('checked')) {
|
||
|
hideClass('dnsservers', false);
|
||
|
} else {
|
||
|
hideClass('dnsservers', true);
|
||
|
}
|
||
|
}
|
||
|
function ntpservers_change() {
|
||
|
if ($('#ntp_server_enable').prop('checked')) {
|
||
|
hideClass('ntpservers', false);
|
||
|
} else {
|
||
|
hideClass('ntpservers', true);
|
||
|
}
|
||
|
}
|
||
|
// Hide/show that section, but have to also respect the wins_server_enable and nbdd_server_enable checkboxes
|
||
|
function setNetbios() {
|
||
|
if ($('#netbios_enable').prop('checked')) {
|
||
|
hideInput('netbios_ntype', false);
|
||
|
hideInput('netbios_scope', false);
|
||
|
hideCheckbox('wins_server_enable', false);
|
||
|
setWins();
|
||
|
hideCheckbox('nbdd_server_enable', false);
|
||
|
setNbdds();
|
||
|
} else {
|
||
|
hideInput('netbios_ntype', true);
|
||
|
hideInput('netbios_scope', true);
|
||
|
hideCheckbox('wins_server_enable', true);
|
||
|
hideClass('winsservers', true);
|
||
|
hideCheckbox('nbdd_server_enable', true);
|
||
|
hideClass('nbddservers', true);
|
||
|
}
|
||
|
}
|
||
| ... | ... | |
|
hideClass('winsservers', ! $('#wins_server_enable').prop('checked'));
|
||
|
}
|
||
|
function setNbdds() {
|
||
|
hideClass('nbddservers', ! $('#nbdd_server_enable').prop('checked'));
|
||
|
}
|
||
|
// ---------- Click checkbox handlers ---------------------------------------------------------
|
||
|
// On clicking DNS Default Domain
|
||
|
$('#dns_domain_enable').click(function () {
|
||
|
dnsdomain_change();
|
||
|
});
|
||
|
// On clicking DNS Servers
|
||
|
$('#dns_server_enable').click(function () {
|
||
|
dnsservers_change();
|
||
|
});
|
||
|
// On clicking NTP Servers
|
||
|
$('#ntp_server_enable').click(function () {
|
||
|
ntpservers_change();
|
||
|
});
|
||
|
// On clicking the netbios_enable checkbox
|
||
|
$('#netbios_enable').click(function () {
|
||
|
setNetbios();
|
||
| ... | ... | |
|
setWins();
|
||
|
});
|
||
|
// On clicking the nbdd_server_enable checkbox
|
||
|
$('#nbdd_server_enable').click(function () {
|
||
|
setNbdds();
|
||
|
});
|
||
|
// ---------- On initial page load ------------------------------------------------------------
|
||
|
setNetbios();
|
||
|
dnsdomain_change();
|
||
|
dnsservers_change();
|
||
|
ntpservers_change();
|
||
|
});
|
||
|
//]]>
|
||
|
</script>
|
||
|
-- a/src/etc/inc/openvpn.inc
|
||
|
++ b/src/etc/inc/openvpn.inc
|
||
| ... | ... | |
|
$openvpn_exit_notify_client[$i] = sprintf(gettext("Retry %dx"), $i);
|
||
|
}
|
||
|
// check if submitted form field is not empty
|
||
|
function empty_field($str) {
|
||
|
$has_text = !is_bool($str) && strlen($str) > 0;
|
||
|
return !$has_text;
|
||
|
}
|
||
|
function openvpn_build_mode_list() {
|
||
|
global $openvpn_server_modes;
|
||
| ... | ... | |
|
if ($settings['netbios_enable']) {
|
||
|
if (!empty($settings['dhcp_nbttype']) && ($settings['dhcp_nbttype'] != 0)) {
|
||
|
$conf .= "push \"dhcp-option NBT {$settings['dhcp_nbttype']}\"\n";
|
||
|
if (!empty($settings['netbios_ntype']) && ($settings['netbios_ntype'] != 0)) {
|
||
|
$conf .= "push \"dhcp-option NBT {$settings['netbios_ntype']}\"\n";
|
||
|
}
|
||
|
if (!empty($settings['dhcp_nbtscope'])) {
|
||
|
$conf .= "push \"dhcp-option NBS {$settings['dhcp_nbtscope']}\"\n";
|
||
|
if (!empty($settings['netbios_scope'])) {
|
||
|
$conf .= "push \"dhcp-option NBS {$settings['netbios_scope']}\"\n";
|
||
|
}
|
||
|
if (!empty($settings['wins_server1'])) {
|
||
| ... | ... | |
|
if (!empty($settings['nbdd_server1'])) {
|
||
|
$conf .= "push \"dhcp-option NBDD {$settings['nbdd_server1']}\"\n";
|
||
|
}
|
||
|
if (!empty($settings['nbdd_server2'])) {
|
||
|
$conf .= "push \"dhcp-option NBDD {$settings['nbdd_server2']}\"\n";
|
||
|
}
|
||
|
}
|
||