summaryrefslogtreecommitdiffstats
path: root/src/usr/local/www/services_dyndns_edit.php
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2016-02-01 12:35:59 -0500
committerjim-p <jimp@pfsense.org>2016-02-01 12:35:59 -0500
commit6635aa0f6c7a166a56a92ea2492930a67e825ce1 (patch)
tree89ef7530c988626b748db3af5946fa553f741443 /src/usr/local/www/services_dyndns_edit.php
parentde22e304d4b00a77089c337e1b8ef88097e9308b (diff)
downloadpfsense-6635aa0f6c7a166a56a92ea2492930a67e825ce1.zip
pfsense-6635aa0f6c7a166a56a92ea2492930a67e825ce1.tar.gz
Change Namecheap dyndns to use split hostname and domain name fields. Upgrade existing entries automatically. Implements #4366
Code should be generic enough that if other DynDNS providers would work better with a separate domain field, they can pick up the feature without too much trouble.
Diffstat (limited to 'src/usr/local/www/services_dyndns_edit.php')
-rw-r--r--src/usr/local/www/services_dyndns_edit.php42
1 files changed, 38 insertions, 4 deletions
diff --git a/src/usr/local/www/services_dyndns_edit.php b/src/usr/local/www/services_dyndns_edit.php
index e28dc3e..8f69251 100644
--- a/src/usr/local/www/services_dyndns_edit.php
+++ b/src/usr/local/www/services_dyndns_edit.php
@@ -92,6 +92,7 @@ if (isset($id) && isset($a_dyndns[$id])) {
$pconfig['username'] = $a_dyndns[$id]['username'];
$pconfig['password'] = $a_dyndns[$id]['password'];
$pconfig['host'] = $a_dyndns[$id]['host'];
+ $pconfig['domainname'] = $a_dyndns[$id]['domainname'];
$pconfig['mx'] = $a_dyndns[$id]['mx'];
$pconfig['type'] = $a_dyndns[$id]['type'];
$pconfig['enable'] = !isset($a_dyndns[$id]['enable']);
@@ -129,6 +130,10 @@ if ($_POST) {
$reqdfieldsn[] = gettext("Password");
$reqdfields[] = "username";
$reqdfieldsn[] = gettext("Username");
+ if ($pconfig['type'] == "namecheap") {
+ $reqdfields[] = "domainname";
+ $reqdfieldsn[] = gettext("Domain Name");
+ }
} else {
$reqdfields[] = "updateurl";
$reqdfieldsn[] = gettext("Update URL");
@@ -173,6 +178,7 @@ if ($_POST) {
$dyndns['password'] = $a_dyndns[$id]['password'];;
}
$dyndns['host'] = $_POST['host'];
+ $dyndns['domainname'] = $_POST['domainname'];
$dyndns['mx'] = $_POST['mx'];
$dyndns['wildcard'] = $_POST['wildcard'] ? true : false;
$dyndns['verboselog'] = $_POST['verboselog'] ? true : false;
@@ -301,15 +307,28 @@ $section->addInput(new Form_Select(
$interfacelist
))->setHelp('This is almost always the same as the Interface to Monitor. ');
-$section->addInput(new Form_Input(
+$group = new Form_Group('Hostname');
+
+$group->add(new Form_Input(
'host',
'Hostname',
'text',
$pconfig['host']
-))->setHelp('Enter the complete fully qualified domain name. Example: myhost.dyndns.org'. '<br />' .
+));
+$group->add(new Form_Input(
+ 'domainname',
+ 'Domain Name',
+ 'text',
+ $pconfig['domainname']
+));
+
+$group->setHelp('Enter the complete fully qualified domain name. Example: myhost.dyndns.org'. '<br />' .
'he.net tunnelbroker: Enter your tunnel ID' . '<br />' .
'GleSYS: Enter your record ID' . '<br />' .
- 'DNSimple: Enter only the domain name.');
+ 'DNSimple: Enter only the domain name.' . '<br />' .
+ 'Namecheap: Enter the hostname and the domain separately, with the domain being the domain or subdomain zone being handled by Namecheap.');
+
+$section->add($group);
$section->addInput(new Form_Input(
'mx',
@@ -434,6 +453,7 @@ events.push(function() {
switch (service) {
case "custom" :
case "custom-v6" :
+ hideGroupInput('domainname', true);
hideInput('resultmatch', false);
hideInput('updateurl', false);
hideInput('requestif', false);
@@ -448,6 +468,7 @@ events.push(function() {
case "dnsimple":
case "route53":
+ hideGroupInput('domainname', true);
hideInput('resultmatch', true);
hideInput('updateurl', true);
hideInput('requestif', true);
@@ -459,8 +480,21 @@ events.push(function() {
hideInput('zoneid', false);
hideInput('ttl', false);
break;
-
+ case "namecheap":
+ hideGroupInput('domainname', false);
+ hideInput('resultmatch', true);
+ hideInput('updateurl', true);
+ hideInput('requestif', true);
+ hideCheckbox('curl_ipresolve_v4', true);
+ hideCheckbox('curl_ssl_verifypeer', true);
+ hideInput('host', false);
+ hideInput('mx', false);
+ hideCheckbox('wildcard', false);
+ hideInput('zoneid', true);
+ hideInput('ttl', true);
+ break;
default:
+ hideGroupInput('domainname', true);
hideInput('resultmatch', true);
hideInput('updateurl', true);
hideInput('requestif', true);
OpenPOWER on IntegriCloud