aboutsummaryrefslogtreecommitdiffstats
path: root/config/tinydns/new_zone_wizard.xml
diff options
context:
space:
mode:
authorMichael <mhasse@PowerBook.local>2009-04-11 18:45:45 -0700
committerMichael <mhasse@PowerBook.local>2009-04-11 18:45:45 -0700
commitcc35718b7a40563e349761db1cb428ffb09d2ae7 (patch)
treec85308b085b0d9d516814ea5f964ad3090113dcf /config/tinydns/new_zone_wizard.xml
parent81372f3fb6e45543837b7e0746b9c5f4f2b50c93 (diff)
downloadpfsense-packages-cc35718b7a40563e349761db1cb428ffb09d2ae7.tar.gz
pfsense-packages-cc35718b7a40563e349761db1cb428ffb09d2ae7.tar.bz2
pfsense-packages-cc35718b7a40563e349761db1cb428ffb09d2ae7.zip
Next release
Diffstat (limited to 'config/tinydns/new_zone_wizard.xml')
-rw-r--r--config/tinydns/new_zone_wizard.xml29
1 files changed, 23 insertions, 6 deletions
diff --git a/config/tinydns/new_zone_wizard.xml b/config/tinydns/new_zone_wizard.xml
index 82d8d62b..0f75291f 100644
--- a/config/tinydns/new_zone_wizard.xml
+++ b/config/tinydns/new_zone_wizard.xml
@@ -92,7 +92,7 @@
<name>Mail exchanger record IP address</name>
<type>input</type>
<arraynum>1</arraynum>
- <description>Enter the IP address of your Mail exchanger (MX) - (example: 9.10.11.12)</description>
+ <description>Enter the IP address of your Mail exchanger (MX) - (not needed if hostname above is in a different domain)</description>
</field>
<field>
<name>First A record (optional)</name>
@@ -151,12 +151,14 @@
<![CDATA[
$changed = false;
-
+
if($_POST['domainname'] and $_POST['primarynameserver']) {
$tmp = array();
$tmp['hostname'] = $_POST['domainname'];
- $tmp['recordtype'] = "SOA";
+ $tmp['recordtype'] = "SOA";
$tmp['ipaddress'] = $_POST['primarynameserver'];
+ if(!preg_match("/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/",$tmp['ipaddress']) && substr($tmp['ipaddress'],-1) != ".")
+ $tmp['ipaddress'] = $tmp['ipaddress'] . ".";
$config['installedpackages']['tinydnsdomains']['config'][] = $tmp;
unset($tmp);
$changed = true;
@@ -167,6 +169,8 @@
$tmp['hostname'] = $_POST['domainname'];
$tmp['recordtype'] = "SOA";
$tmp['ipaddress'] = $_POST['secondarynameserver'];
+ if(!preg_match("/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/",$tmp['ipaddress']) && substr($tmp['ipaddress'],-1) != ".")
+ $tmp['ipaddress'] = $tmp['ipaddress'] . ".";
$config['installedpackages']['tinydnsdomains']['config'][] = $tmp;
unset($tmp);
$changed = true;
@@ -202,13 +206,26 @@
$changed = true;
}
- if($_POST['mailexchangerrecordipaddress'] and $_POST['mailexchangerrecordhostname']) {
+ if($_POST['mailexchangerrecordhostname']) {
$tmp = array();
- $tmp['hostname'] = $_POST['mailexchangerrecordhostname'];
+ $tmp['hostname'] = $_POST['domainname'];
$tmp['recordtype'] = "MX";
- $tmp['ipaddress'] = $_POST['secondarecordipaddress'];
+ $tmp['ipaddress'] = $_POST['mailexchangerrecordhostname'];
+ if(substr($tmp['ipaddress'],-1) != ".")
+ $tmp['ipaddress'] = $tmp['ipaddress'] . ".";
+ $config['installedpackages']['tinydnsdomains']['config'][] = $tmp;
unset($tmp);
$changed = true;
+
+ if($_POST['mailexchangerrecordipaddress']) {
+ $tmp = array();
+ $tmp['hostname'] = $_POST['mailexchangerrecordhostname'];
+ $tmp['recordtype'] = "A";
+ $tmp['ipaddress'] = $_POST['mailexchangerrecordipaddress'];
+ $config['installedpackages']['tinydnsdomains']['config'][] = $tmp;
+ unset($tmp);
+ $changed = true;
+ }
}
if($changed) {