inc/record.inc.php
changeset 171 2a10febd6af9
parent 170 391e744a1def
child 172 4708e6b152a0
equal deleted inserted replaced
170:391e744a1def 171:2a10febd6af9
  1047 	} else {
  1047 	} else {
  1048                 error(sprintf(ERR_INV_ARG, "change_domain_type", "no or no valid zoneid given"));
  1048                 error(sprintf(ERR_INV_ARG, "change_domain_type", "no or no valid zoneid given"));
  1049         }
  1049         }
  1050 }
  1050 }
  1051 
  1051 
       
  1052 function get_serial_by_zid($zid) {
       
  1053 	global $db;
       
  1054 	if (is_numeric($zid)) {
       
  1055 		$query = "SELECT content FROM records where TYPE = 'SOA' and domain_id = " . $db->quote($zid);
       
  1056 		$rr_soa = $db->queryOne($query);
       
  1057 		if (PEAR::isError($rr_soa)) { error($rr_soa->getMessage()); return false; }
       
  1058 		$rr_soa_fields = explode(" ", $rr_soa);
       
  1059 	} else {
       
  1060 		error(sprintf(ERR_INV_ARGC, "get_serial_by_zid", "id must be a number"));
       
  1061 		return false;
       
  1062 	}
       
  1063 	return $rr_soa_fields[2];
       
  1064 }
  1052 
  1065 
  1053 function validate_account($account) {
  1066 function validate_account($account) {
  1054   	if(preg_match("/^[A-Z0-9._-]+$/i",$account)) {
  1067   	if(preg_match("/^[A-Z0-9._-]+$/i",$account)) {
  1055 		return true;
  1068 		return true;
  1056 	} else {
  1069 	} else {