Bug #13088 ยป vpn_openvpn_csc.patch
| src/usr/local/www/vpn_openvpn_csc.php | ||
|---|---|---|
|
'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',
|
||
| ... | ... | |
|
<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);
|
||
| ... | ... | |
|
// ---------- 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();
|
||
| ... | ... | |
|
// ---------- On initial page load ------------------------------------------------------------
|
||
|
setNetbios();
|
||
|
dnsdomain_change();
|
||
|
dnsservers_change();
|
||
|
ntpservers_change();
|
||
|
});
|
||
|
//]]>
|
||
|
</script>
|
||