whoisQuery($domain); $extension = preg_replace('/^.*\.([a-z]+)$/', '\\1', $domain); $ns = array(); switch ($extension) { case 'fr': break; case 'net': break; case 'org': break; case 'com': break; case 'eu': break; case 'be': break; case 'info': break; case 'biz': break; case 'de': break; default: break; } if (empty($ns)) return false; return $ns; } public function add($domain) { // ADD soa DB::uQuery('INSERT INTO '.MYDNS_MYSQL_DATABASE.'.soa (id, origin, ns, mbox, serial, refresh, retry, expire, minimum, ttl, sys_userid) VALUES ("", "'.DB::esc($domain).'.", "'.DB::esc(MYDNS_DEFAULT_NS).'", "'.DB::esc(MYDNS_DEFAULT_MBOX).'", "'.$this->getSerial().'", "'.MYDNS_DEFAULT_REFRESH.'", "'.MYDNS_DEFAULT_RETRY.'", "'.MYDNS_DEFAULT_EXPIRE.'", "'.MYDNS_DEFAULT_MINIMUM.'", "'.MYDNS_DEFAULT_TTL.'", "'.(int) Users::get('uid').'");'); // Insert default MX DB::uQuery(''); // Insert default NS entries $ns_entries = $this->getNSFromWhois($domain); DB::uQuery(''); DB::uQuery(''); if (MYDNS_CREATE_DEFAULT_RR != '') { // FIXME! // domain.tld. IN A IP DB::uQuery('INSERT INTO '.MYDNS_MYSQL_DATABASE.'.rr (...) VALUEs (...);'); // www IN A IP DB::uQuery('INSERT INTO '.MYDNS_MYSQL_DATABASE.'.rr'); // * IN CNAME www DB::uQuery('INSERT INTO '.MYDNS_MYSQL_DATABASE.'.rr'); } return true; } public function delete($domain) { DB::uQuery('DELETE FROM '.MYDNS_MYSQL_DATABASE.'.soa WHERE origin="'.DB::esc($domain).'" AND sys_userid="'.Users::get('uid').'";'); // FIXME: delete rr zones return true; } } ?>