| | |
| | | //$_db = clone $app->db; |
| | | //$_db->dbName = 'named'; |
| | | |
| | | $app->db->query("DELETE FROM named.records WHERE ispconfig_id = {$data["old"]["id"]}"); |
| | | $app->db->query( "DELETE FROM named.dns_records WHERE zone = '".substr($data['old']['origin'], 0, -1)."'"); |
| | | //unset($_db); |
| | | } |
| | | |
| | |
| | | if ($type == 'MX') { |
| | | $app->db->query("INSERT INTO named.records (zone, ttl, type, host, mx_priority, data, ispconfig_id)". |
| | | " VALUES ('$origin', $ttl, '$type', '$name', {$data["new"]["aux"]}, '$content', $ispconfig_id)"); |
| | | } elseif ($type == 'SRV') { |
| | | $app->db->query("INSERT INTO named.records (zone, ttl, type, data, ispconfig_id)". |
| | | " VALUES ('$origin', $ttl, '$type', '{$data["new"]["aux"]} $content', $ispconfig_id)"); |
| | | } else { |
| | | $app->db->query("INSERT INTO named.records (zone, ttl, type, host, data, ispconfig_id)". |
| | | " VALUES ('$origin', $ttl, '$type', '$name', '$content', $ispconfig_id)"); |
| | |
| | | if ($type == 'MX') { |
| | | $app->db->query("UPDATE named.records SET zone = '$origin', ttl = $ttl, type = '$type', host = '$name', mx_priority = $prio, ". |
| | | "data = '$content' WHERE ispconfig_id = $ispconfig_id AND type != 'SOA'"); |
| | | } elseif ($type == 'SRV') { |
| | | $app->db->query("UPDATE named.records SET zone = '$origin', ttl = $ttl, type = '$type', ". |
| | | "data = '$prio $content' WHERE ispconfig_id = $ispconfig_id AND type != 'SOA'"); |
| | | } else { |
| | | $app->db->query("UPDATE named.records SET zone = '$origin', ttl = $ttl, type = '$type', host = '$name', ". |
| | | "data = '$content' WHERE ispconfig_id = $ispconfig_id AND type != 'SOA'"); |
| | |
| | | //$_db = clone $app->db; |
| | | //$_db->dbName = 'named'; |
| | | |
| | | $app->db->query("DELETE FROM named.records WHERE ispconfig_id = {$data["old"]["id"]} AND type != 'SOA'"); |
| | | $app->db->query( "DELETE FROM named.dns_records WHERE type != 'SOA' AND zone = '".substr($data['old']['origin'], 0, -1)."'"); |
| | | //unset($_db); |
| | | } |
| | | |