[feladat @ 267]
authorrejo
Tue, 13 May 2008 20:59:32 +0000
changeset 161 0832d846bf8e
parent 160 19cc35549204
child 162 e109f389316c
[feladat @ 267] Fixing the previous bugfix. Should really close #51. Additionaly, allow for IPv6 master if zone is a new slave zone.
add_zone_master.php
add_zone_slave.php
inc/record.inc.php
--- a/add_zone_master.php	Tue May 13 20:37:32 2008 +0000
+++ b/add_zone_master.php	Tue May 13 20:59:32 2008 +0000
@@ -49,7 +49,7 @@
 
         if(!$empty) {
                 $empty = 0;
-                if(!eregi('in-addr.arpa', $domain) && (!is_valid_ip($webip) || !is_valid_ip($mailip)) ) {
+                if(!eregi('in-addr.arpa', $domain) && (!is_valid_ipv4($webip) || !is_valid_ipv4($mailip)) ) {
                         error(_('IP address of web- or mailserver is invalid.')); 
 			$error = "1";
                 }
--- a/add_zone_slave.php	Tue May 13 20:37:32 2008 +0000
+++ b/add_zone_slave.php	Tue May 13 20:59:32 2008 +0000
@@ -38,7 +38,7 @@
 		error(ERR_DNS_HOSTNAME);
 	} elseif (domain_exists($zone)) {
 		error(ERR_DOMAIN_EXISTS);
-	} elseif (!is_valid_ip($master)) {
+	} elseif (!is_valid_ipv4($master) || !is_valid_ipv6($master)) {
 		error(ERR_DNS_IP);
 	} else {
 		if(add_domain($zone, $owner, $webip, $mailip, $empty, $type, $master)) {
--- a/inc/record.inc.php	Tue May 13 20:37:32 2008 +0000
+++ b/inc/record.inc.php	Tue May 13 20:59:32 2008 +0000
@@ -199,7 +199,7 @@
 function add_supermaster($master_ip, $ns_name, $account)
 {
         global $db;
-        if (!is_valid_ipv4$master_ip) && !is_valid_ipv6($master_ip)) {
+        if (!is_valid_ipv4($master_ip) && !is_valid_ipv6($master_ip)) {
                 error(ERR_DNS_IP);
 		return false;
         }
@@ -222,7 +222,7 @@
 
 function delete_supermaster($master_ip) {
 	global $db;
-        if (is_valid_ipv4$master_ip) || is_valid_ipv6($master_ip))
+        if (is_valid_ipv4($master_ip) || is_valid_ipv6($master_ip))
         {
                 $db->query("DELETE FROM supermasters WHERE ip = ".$db->quote($master_ip));
                 return true;
@@ -236,7 +236,7 @@
 function get_supermaster_info_from_ip($master_ip)
 {
 	global $db;
-        if (is_valid_ipv4$master_ip) || is_valid_ipv6($master_ip))
+        if (is_valid_ipv4($master_ip) || is_valid_ipv6($master_ip))
 	{
 	        $result = $db->queryRow("SELECT ip,nameserver,account FROM supermasters WHERE ip = ".$db->quote($master_ip));
 
@@ -679,7 +679,7 @@
 function supermaster_exists($master_ip)
 {
         global $db;
-        if (is_valid_ipv4$master_ip) || is_valid_ipv6($master_ip))
+        if (is_valid_ipv4($master_ip) || is_valid_ipv6($master_ip))
         {
                 $result = $db->query("SELECT ip FROM supermasters WHERE ip = ".$db->quote($master_ip));
                 if ($result->numRows() == 0)
@@ -1039,7 +1039,7 @@
 function change_zone_slave_master($zone_id, $ip_slave_master) {
 	global $db;
         if (is_numeric($zone_id)) {
-       		if (is_valid_ipv4$ip_slave_master) || is_valid_ipv6($ip_slave_master)) {
+       		if (is_valid_ipv4($ip_slave_master) || is_valid_ipv6($ip_slave_master)) {
 			$result = $db->query("UPDATE domains SET master = " .$db->quote($ip_slave_master). " WHERE id = ".$db->quote($zone_id));
 		} else {
 			error(sprintf(ERR_INV_ARGC, "change_domain_ip_slave_master", "This is not a valid IPv4 or IPv6 address: $ip_slave_master"));