equal
deleted
inserted
replaced
201 global $db; |
201 global $db; |
202 if (!is_valid_ipv4($master_ip) && !is_valid_ipv6($master_ip)) { |
202 if (!is_valid_ipv4($master_ip) && !is_valid_ipv6($master_ip)) { |
203 error(ERR_DNS_IP); |
203 error(ERR_DNS_IP); |
204 return false; |
204 return false; |
205 } |
205 } |
206 if (!is_valid_hostname($ns_name)) { |
206 if (!is_valid_hostname($ns_name,0)) { |
207 error(ERR_DNS_HOSTNAME); |
207 error(ERR_DNS_HOSTNAME); |
208 return false; |
208 return false; |
209 } |
209 } |
210 if (!validate_account($account)) { |
210 if (!validate_account($account)) { |
211 error(sprintf(ERR_INV_ARGC, "add_supermaster", "given account name is invalid (alpha chars only)")); |
211 error(sprintf(ERR_INV_ARGC, "add_supermaster", "given account name is invalid (alpha chars only)")); |
639 */ |
639 */ |
640 function domain_exists($domain) |
640 function domain_exists($domain) |
641 { |
641 { |
642 global $db; |
642 global $db; |
643 |
643 |
644 if (is_valid_hostname_fqdn($domain)) { |
644 if (is_valid_hostname_fqdn($domain,0)) { |
645 $result = $db->query("SELECT id FROM domains WHERE name=".$db->quote($domain)); |
645 $result = $db->query("SELECT id FROM domains WHERE name=".$db->quote($domain)); |
646 if ($result->numRows() == 0) { |
646 if ($result->numRows() == 0) { |
647 return false; |
647 return false; |
648 } elseif ($result->numRows() >= 1) { |
648 } elseif ($result->numRows() >= 1) { |
649 return true; |
649 return true; |