From 04c7ebea11a4e8f385f13b31f6606e7140914fbf Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Tue, 15 Jul 2008 15:27:56 -0400
Subject: [PATCH] - Completed the mail fiter rules - fixed bugs when websites and dns zones were deleted.
---
interface/web/dns/dns_soa_del.php | 22 ++++++++++++++++++++--
1 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/interface/web/dns/dns_soa_del.php b/interface/web/dns/dns_soa_del.php
index de223fa..0a1944b 100644
--- a/interface/web/dns/dns_soa_del.php
+++ b/interface/web/dns/dns_soa_del.php
@@ -45,7 +45,25 @@
//* Check permissions for module
$app->auth->check_module_permissions('dns');
-$app->uses("tform_actions");
-$app->tform_actions->onDelete();
+$app->uses('tpl,tform,tform_actions');
+$app->load('tform_actions');
+
+class page_action extends tform_actions {
+
+ function onBeforeDelete() {
+ global $app; $conf;
+
+ if($app->tform->checkPerm($this->id,'d') == false) $app->error($app->lng('error_no_delete_permission'));
+
+ // Delete all records that belog to this zone.
+ $records = $app->db->queryAllRecords("SELECT id FROM dns_rr WHERE zone = '".intval($this->id)."'");
+ foreach($records as $rec) {
+ $app->db->datalogDelete('dns_rr','id',$rec['id']);
+ }
+ }
+}
+
+$page = new page_action;
+$page->onDelete();
?>
\ No newline at end of file
--
Gitblit v1.9.1