diff --git a/interface/web/dns/dns_a_edit.php b/interface/web/dns/dns_a_edit.php
index 422da4f27d0a7718e77fa7e1cf51297aeae32bcd..f4f017958ccf7f064ed7cca05ac3764fec916f6c 100644
--- a/interface/web/dns/dns_a_edit.php
+++ b/interface/web/dns/dns_a_edit.php
@@ -1,135 +1,134 @@
-<?php
-
-/*
-Copyright (c) 2007, Till Brehm, projektfarm Gmbh
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
-
-    * Redistributions of source code must retain the above copyright notice,
-      this list of conditions and the following disclaimer.
-    * Redistributions in binary form must reproduce the above copyright notice,
-      this list of conditions and the following disclaimer in the documentation
-      and/or other materials provided with the distribution.
-    * Neither the name of ISPConfig nor the names of its contributors
-      may be used to endorse or promote products derived from this software without
-      specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/******************************************
-* Begin Form configuration
-******************************************/
-
-$tform_def_file = "form/dns_a.tform.php";
-
-/******************************************
-* End Form configuration
-******************************************/
-
-require_once('../../lib/config.inc.php');
-require_once('../../lib/app.inc.php');
-
-//* Check permissions for module
-$app->auth->check_module_permissions('dns');
-
-// Loading classes
-$app->uses('tpl,tform,tform_actions,validate_dns');
-$app->load('tform_actions');
-
-class page_action extends tform_actions {
-	
-	function onShowNew() {
-		global $app, $conf;
-		
-		// we will check only users, not admins
-		if($_SESSION["s"]["user"]["typ"] == 'user') {
-			
-			// Get the limits of the client
-			$client_group_id = $_SESSION["s"]["user"]["default_group"];
-			$client = $app->db->queryOneRecord("SELECT limit_dns_record FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
-			
-			// Check if the user may add another mailbox.
-			if($client["limit_dns_record"] >= 0) {
-				$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
-				if($tmp["number"] >= $client["limit_dns_record"]) {
-					$app->error($app->tform->wordbook["limit_dns_record_txt"]);
-				}
-			}
-		}
-		
-		parent::onShowNew();
-	}
-	
-	function onSubmit() {
-		global $app, $conf;
-		
-		// Get the parent soa record of the domain
-		$soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = '".intval($_POST["zone"])."' AND ".$app->tform->getAuthSQL('r'));
-
-		// Check if Domain belongs to user
-		if($soa["id"] != $_POST["zone"]) $app->tform->errorMessage .= $app->tform->wordbook["no_zone_perm"];
-		
-		// Check the client limits, if user is not the admin
-		if($_SESSION["s"]["user"]["typ"] != 'admin') { // if user is not admin
-			// Get the limits of the client
-			$client_group_id = $_SESSION["s"]["user"]["default_group"];
-			$client = $app->db->queryOneRecord("SELECT limit_dns_record FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
-			
-			// Check if the user may add another mailbox.
-			if($this->id == 0 && $client["limit_dns_record"] >= 0) {
-				$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
-				if($tmp["number"] >= $client["limit_dns_record"]) {
-					$app->error($app->tform->wordbook["limit_dns_record_txt"]);
-				}
-			}
-		} // end if user is not admin
-		
-		
-		// Set the server ID of the rr record to the same server ID as the parent record.
-		$this->dataRecord["server_id"] = $soa["server_id"];
-		
-		parent::onSubmit();
-	}
-	
-	function onAfterInsert() {
-		global $app, $conf;
-		
-		// Set the sys_groupid of the rr record to be the same then the sys_groupid of the soa record
-		$soa = $app->db->queryOneRecord("SELECT sys_groupid FROM dns_soa WHERE id = '".intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r'));
-		$app->db->query("UPDATE dns_rr SET sys_groupid = ".$soa['sys_groupid']." WHERE id = ".$this->id);
-
-		// Update the serial number of the SOA record
-		$soa_id = intval($_POST["zone"]);
-		$serial = $app->validate_dns->increase_serial($soa["serial"]);
-		$app->db->query("UPDATE dns_soa SET serial = $serial WHERE id = $soa_id");
-		
-	}
-	
-	function onAfterUpdate() {
-		global $app, $conf;
-		
-		// Update the serial number of the SOA record
-		$soa = $app->db->queryOneRecord("SELECT serial FROM dns_soa WHERE id = '".intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r'));
-		$soa_id = intval($_POST["zone"]);
-		$serial = $app->validate_dns->increase_serial($soa["serial"]);
-		$app->db->query("UPDATE dns_soa SET serial = $serial WHERE id = $soa_id");
-	}
-	
-}
-
-$page = new page_action;
-$page->onLoad();
-
+<?php
+
+/*
+Copyright (c) 2007, Till Brehm, projektfarm Gmbh
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice,
+      this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright notice,
+      this list of conditions and the following disclaimer in the documentation
+      and/or other materials provided with the distribution.
+    * Neither the name of ISPConfig nor the names of its contributors
+      may be used to endorse or promote products derived from this software without
+      specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/******************************************
+* Begin Form configuration
+******************************************/
+
+$tform_def_file = "form/dns_a.tform.php";
+
+/******************************************
+* End Form configuration
+******************************************/
+
+require_once('../../lib/config.inc.php');
+require_once('../../lib/app.inc.php');
+
+//* Check permissions for module
+$app->auth->check_module_permissions('dns');
+
+// Loading classes
+$app->uses('tpl,tform,tform_actions,validate_dns');
+$app->load('tform_actions');
+
+class page_action extends tform_actions {
+	
+	function onShowNew() {
+		global $app, $conf;
+		
+		// we will check only users, not admins
+		if($_SESSION["s"]["user"]["typ"] == 'user') {
+			
+			// Get the limits of the client
+			$client_group_id = $_SESSION["s"]["user"]["default_group"];
+			$client = $app->db->queryOneRecord("SELECT limit_dns_record FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
+			
+			// Check if the user may add another mailbox.
+			if($client["limit_dns_record"] >= 0) {
+				$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
+				if($tmp["number"] >= $client["limit_dns_record"]) {
+					$app->error($app->tform->wordbook["limit_dns_record_txt"]);
+				}
+			}
+		}
+		
+		parent::onShowNew();
+	}
+	
+	function onSubmit() {
+		global $app, $conf;
+		
+		// Get the parent soa record of the domain
+		$soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = '".intval($_POST["zone"])."' AND ".$app->tform->getAuthSQL('r'));
+
+		// Check if Domain belongs to user
+		if($soa["id"] != $_POST["zone"]) $app->tform->errorMessage .= $app->tform->wordbook["no_zone_perm"];
+		
+		// Check the client limits, if user is not the admin
+		if($_SESSION["s"]["user"]["typ"] != 'admin') { // if user is not admin
+			// Get the limits of the client
+			$client_group_id = $_SESSION["s"]["user"]["default_group"];
+			$client = $app->db->queryOneRecord("SELECT limit_dns_record FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
+			
+			// Check if the user may add another mailbox.
+			if($this->id == 0 && $client["limit_dns_record"] >= 0) {
+				$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
+				if($tmp["number"] >= $client["limit_dns_record"]) {
+					$app->error($app->tform->wordbook["limit_dns_record_txt"]);
+				}
+			}
+		} // end if user is not admin
+		
+		
+		// Set the server ID of the rr record to the same server ID as the parent record.
+		$this->dataRecord["server_id"] = $soa["server_id"];
+		
+		parent::onSubmit();
+	}
+	
+	function onAfterInsert() {
+		global $app, $conf;
+		
+		//* Set the sys_groupid of the rr record to be the same then the sys_groupid of the soa record
+		$soa = $app->db->queryOneRecord("SELECT sys_groupid FROM dns_soa WHERE id = '".intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r'));
+		$app->db->datalogUpdate('dns_rr', "sys_groupid = ".$soa['sys_groupid'], 'id', $this->id);
+
+		//* Update the serial number of the SOA record
+		$soa_id = intval($_POST["zone"]);
+		$serial = $app->validate_dns->increase_serial($soa["serial"]);
+		$app->db->datalogUpdate('dns_soa', "serial = $serial", 'id', $soa_id);
+	}
+	
+	function onAfterUpdate() {
+		global $app, $conf;
+		
+		//* Update the serial number of the SOA record
+		$soa = $app->db->queryOneRecord("SELECT serial FROM dns_soa WHERE id = '".intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r'));
+		$soa_id = intval($_POST["zone"]);
+		$serial = $app->validate_dns->increase_serial($soa["serial"]);
+		$app->db->datalogUpdate('dns_soa', "serial = $serial", 'id', $soa_id);
+	}
+	
+}
+
+$page = new page_action;
+$page->onLoad();
+
 ?>
\ No newline at end of file
diff --git a/interface/web/dns/dns_alias_edit.php b/interface/web/dns/dns_alias_edit.php
index 6ada3947940f2f66618883a4941753cf67f4d583..9b64061223fc14c7e9aa45f656c34849243be8d7 100644
--- a/interface/web/dns/dns_alias_edit.php
+++ b/interface/web/dns/dns_alias_edit.php
@@ -1,134 +1,133 @@
-<?php
-
-/*
-Copyright (c) 2007, Till Brehm, projektfarm Gmbh
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
-
-    * Redistributions of source code must retain the above copyright notice,
-      this list of conditions and the following disclaimer.
-    * Redistributions in binary form must reproduce the above copyright notice,
-      this list of conditions and the following disclaimer in the documentation
-      and/or other materials provided with the distribution.
-    * Neither the name of ISPConfig nor the names of its contributors
-      may be used to endorse or promote products derived from this software without
-      specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/******************************************
-* Begin Form configuration
-******************************************/
-
-$tform_def_file = "form/dns_alias.tform.php";
-
-/******************************************
-* End Form configuration
-******************************************/
-
-require_once('../../lib/config.inc.php');
-require_once('../../lib/app.inc.php');
-
-//* Check permissions for module
-$app->auth->check_module_permissions('dns');
-
-// Loading classes
-$app->uses('tpl,tform,tform_actions,validate_dns');
-$app->load('tform_actions');
-
-class page_action extends tform_actions {
-	
-	function onShowNew() {
-		global $app, $conf;
-		
-		// we will check only users, not admins
-		if($_SESSION["s"]["user"]["typ"] == 'user') {
-			
-			// Get the limits of the client
-			$client_group_id = $_SESSION["s"]["user"]["default_group"];
-			$client = $app->db->queryOneRecord("SELECT limit_dns_record FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
-			
-			// Check if the user may add another mailbox.
-			if($client["limit_dns_record"] >= 0) {
-				$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
-				if($tmp["number"] >= $client["limit_dns_record"]) {
-					$app->error($app->tform->wordbook["limit_dns_record_txt"]);
-				}
-			}
-		}
-		
-		parent::onShowNew();
-	}
-	
-	function onSubmit() {
-		global $app, $conf;
-		
-		// Get the parent soa record of the domain
-		$soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = '".intval($_POST["zone"])."' AND ".$app->tform->getAuthSQL('r'));
-
-		// Check if Domain belongs to user
-		if($soa["id"] != $_POST["zone"]) $app->tform->errorMessage .= $app->tform->wordbook["no_zone_perm"];
-		
-		// Check the client limits, if user is not the admin
-		if($_SESSION["s"]["user"]["typ"] != 'admin') { // if user is not admin
-			// Get the limits of the client
-			$client_group_id = $_SESSION["s"]["user"]["default_group"];
-			$client = $app->db->queryOneRecord("SELECT limit_dns_record FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
-			
-			// Check if the user may add another mailbox.
-			if($client["limit_dns_record"] >= 0) {
-				$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
-				if($tmp["number"] >= $client["limit_dns_record"]) {
-					$app->error($app->tform->wordbook["limit_dns_record_txt"]);
-				}
-			}
-		} // end if user is not admin
-		
-		
-		// Set the server ID of the rr record to the same server ID as the parent record.
-		$this->dataRecord["server_id"] = $soa["server_id"];
-		
-		parent::onSubmit();
-	}
-	
-	function onAfterInsert() {
-		global $app, $conf;
-		
-		// Set the sys_groupid of the rr record to be the same then the sys_groupid of the soa record
-		$soa = $app->db->queryOneRecord("SELECT sys_groupid FROM dns_soa WHERE id = '".intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r'));
-		$app->db->query("UPDATE dns_rr SET sys_groupid = ".$soa['sys_groupid']." WHERE id = ".$this->id);
-
-		// Update the serial number of the SOA record
-		$soa_id = intval($_POST["zone"]);
-		$serial = $app->validate_dns->increase_serial($soa["serial"]);
-		$app->db->query("UPDATE dns_soa SET serial = $serial WHERE id = $soa_id");
-		
-	}
-	
-	function onAfterUpdate() {
-		global $app, $conf;
-		
-		// Update the serial number of the SOA record
-		$soa = $app->db->queryOneRecord("SELECT serial FROM dns_soa WHERE id = '".intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r'));
-		$soa_id = intval($_POST["zone"]);
-		$serial = $app->validate_dns->increase_serial($soa["serial"]);
-		$app->db->query("UPDATE dns_soa SET serial = $serial WHERE id = $soa_id");
-	}
-}
-
-$page = new page_action;
-$page->onLoad();
-
+<?php
+
+/*
+Copyright (c) 2007, Till Brehm, projektfarm Gmbh
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice,
+      this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright notice,
+      this list of conditions and the following disclaimer in the documentation
+      and/or other materials provided with the distribution.
+    * Neither the name of ISPConfig nor the names of its contributors
+      may be used to endorse or promote products derived from this software without
+      specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/******************************************
+* Begin Form configuration
+******************************************/
+
+$tform_def_file = "form/dns_alias.tform.php";
+
+/******************************************
+* End Form configuration
+******************************************/
+
+require_once('../../lib/config.inc.php');
+require_once('../../lib/app.inc.php');
+
+//* Check permissions for module
+$app->auth->check_module_permissions('dns');
+
+// Loading classes
+$app->uses('tpl,tform,tform_actions,validate_dns');
+$app->load('tform_actions');
+
+class page_action extends tform_actions {
+	
+	function onShowNew() {
+		global $app, $conf;
+		
+		// we will check only users, not admins
+		if($_SESSION["s"]["user"]["typ"] == 'user') {
+			
+			// Get the limits of the client
+			$client_group_id = $_SESSION["s"]["user"]["default_group"];
+			$client = $app->db->queryOneRecord("SELECT limit_dns_record FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
+			
+			// Check if the user may add another mailbox.
+			if($client["limit_dns_record"] >= 0) {
+				$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
+				if($tmp["number"] >= $client["limit_dns_record"]) {
+					$app->error($app->tform->wordbook["limit_dns_record_txt"]);
+				}
+			}
+		}
+		
+		parent::onShowNew();
+	}
+	
+	function onSubmit() {
+		global $app, $conf;
+		
+		// Get the parent soa record of the domain
+		$soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = '".intval($_POST["zone"])."' AND ".$app->tform->getAuthSQL('r'));
+
+		// Check if Domain belongs to user
+		if($soa["id"] != $_POST["zone"]) $app->tform->errorMessage .= $app->tform->wordbook["no_zone_perm"];
+		
+		// Check the client limits, if user is not the admin
+		if($_SESSION["s"]["user"]["typ"] != 'admin') { // if user is not admin
+			// Get the limits of the client
+			$client_group_id = $_SESSION["s"]["user"]["default_group"];
+			$client = $app->db->queryOneRecord("SELECT limit_dns_record FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
+			
+			// Check if the user may add another mailbox.
+			if($client["limit_dns_record"] >= 0) {
+				$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
+				if($tmp["number"] >= $client["limit_dns_record"]) {
+					$app->error($app->tform->wordbook["limit_dns_record_txt"]);
+				}
+			}
+		} // end if user is not admin
+		
+		
+		// Set the server ID of the rr record to the same server ID as the parent record.
+		$this->dataRecord["server_id"] = $soa["server_id"];
+		
+		parent::onSubmit();
+	}
+	
+	function onAfterInsert() {
+		global $app, $conf;
+		
+		//* Set the sys_groupid of the rr record to be the same then the sys_groupid of the soa record
+		$soa = $app->db->queryOneRecord("SELECT sys_groupid FROM dns_soa WHERE id = '".intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r'));
+		$app->db->datalogUpdate('dns_rr', "sys_groupid = ".$soa['sys_groupid'], 'id', $this->id);
+
+		//* Update the serial number of the SOA record
+		$soa_id = intval($_POST["zone"]);
+		$serial = $app->validate_dns->increase_serial($soa["serial"]);
+		$app->db->datalogUpdate('dns_soa', "serial = $serial", 'id', $soa_id);
+	}
+	
+	function onAfterUpdate() {
+		global $app, $conf;
+		
+		//* Update the serial number of the SOA record
+		$soa = $app->db->queryOneRecord("SELECT serial FROM dns_soa WHERE id = '".intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r'));
+		$soa_id = intval($_POST["zone"]);
+		$serial = $app->validate_dns->increase_serial($soa["serial"]);
+		$app->db->datalogUpdate('dns_soa', "serial = $serial", 'id', $soa_id);
+	}
+}
+
+$page = new page_action;
+$page->onLoad();
+
 ?>
\ No newline at end of file
diff --git a/interface/web/dns/dns_cname_edit.php b/interface/web/dns/dns_cname_edit.php
index 47b7c5f1b87627fbdc8d8cf3df12e5b92a1a1b6a..dc5d811c768e7368d59444a52365a519bc924533 100644
--- a/interface/web/dns/dns_cname_edit.php
+++ b/interface/web/dns/dns_cname_edit.php
@@ -1,134 +1,133 @@
-<?php
-
-/*
-Copyright (c) 2007, Till Brehm, projektfarm Gmbh
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
-
-    * Redistributions of source code must retain the above copyright notice,
-      this list of conditions and the following disclaimer.
-    * Redistributions in binary form must reproduce the above copyright notice,
-      this list of conditions and the following disclaimer in the documentation
-      and/or other materials provided with the distribution.
-    * Neither the name of ISPConfig nor the names of its contributors
-      may be used to endorse or promote products derived from this software without
-      specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/******************************************
-* Begin Form configuration
-******************************************/
-
-$tform_def_file = "form/dns_cname.tform.php";
-
-/******************************************
-* End Form configuration
-******************************************/
-
-require_once('../../lib/config.inc.php');
-require_once('../../lib/app.inc.php');
-
-//* Check permissions for module
-$app->auth->check_module_permissions('dns');
-
-// Loading classes
-$app->uses('tpl,tform,tform_actions,validate_dns');
-$app->load('tform_actions');
-
-class page_action extends tform_actions {
-	
-	function onShowNew() {
-		global $app, $conf;
-		
-		// we will check only users, not admins
-		if($_SESSION["s"]["user"]["typ"] == 'user') {
-			
-			// Get the limits of the client
-			$client_group_id = $_SESSION["s"]["user"]["default_group"];
-			$client = $app->db->queryOneRecord("SELECT limit_dns_record FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
-			
-			// Check if the user may add another mailbox.
-			if($client["limit_dns_record"] >= 0) {
-				$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
-				if($tmp["number"] >= $client["limit_dns_record"]) {
-					$app->error($app->tform->wordbook["limit_dns_record_txt"]);
-				}
-			}
-		}
-		
-		parent::onShowNew();
-	}
-	
-	function onSubmit() {
-		global $app, $conf;
-		
-		// Get the parent soa record of the domain
-		$soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = '".intval($_POST["zone"])."' AND ".$app->tform->getAuthSQL('r'));
-
-		// Check if Domain belongs to user
-		if($soa["id"] != $_POST["zone"]) $app->tform->errorMessage .= $app->tform->wordbook["no_zone_perm"];
-		
-		// Check the client limits, if user is not the admin
-		if($_SESSION["s"]["user"]["typ"] != 'admin') { // if user is not admin
-			// Get the limits of the client
-			$client_group_id = $_SESSION["s"]["user"]["default_group"];
-			$client = $app->db->queryOneRecord("SELECT limit_dns_record FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
-			
-			// Check if the user may add another mailbox.
-			if($this->id == 0 && $client["limit_dns_record"] >= 0) {
-				$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
-				if($tmp["number"] >= $client["limit_dns_record"]) {
-					$app->error($app->tform->wordbook["limit_dns_record_txt"]);
-				}
-			}
-		} // end if user is not admin
-		
-		
-		// Set the server ID of the rr record to the same server ID as the parent record.
-		$this->dataRecord["server_id"] = $soa["server_id"];
-		
-		parent::onSubmit();
-	}
-	
-	function onAfterInsert() {
-		global $app, $conf;
-		
-		// Set the sys_groupid of the rr record to be the same then the sys_groupid of the soa record
-		$soa = $app->db->queryOneRecord("SELECT sys_groupid FROM dns_soa WHERE id = '".intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r'));
-		$app->db->query("UPDATE dns_rr SET sys_groupid = ".$soa['sys_groupid']." WHERE id = ".$this->id);
-
-		// Update the serial number of the SOA record
-		$soa_id = intval($_POST["zone"]);
-		$serial = $app->validate_dns->increase_serial($soa["serial"]);
-		$app->db->query("UPDATE dns_soa SET serial = $serial WHERE id = $soa_id");
-		
-	}
-	
-	function onAfterUpdate() {
-		global $app, $conf;
-		
-		// Update the serial number of the SOA record
-		$soa = $app->db->queryOneRecord("SELECT serial FROM dns_soa WHERE id = '".intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r'));
-		$soa_id = intval($_POST["zone"]);
-		$serial = $app->validate_dns->increase_serial($soa["serial"]);
-		$app->db->query("UPDATE dns_soa SET serial = $serial WHERE id = $soa_id");
-	}
-}
-
-$page = new page_action;
-$page->onLoad();
-
+<?php
+
+/*
+Copyright (c) 2007, Till Brehm, projektfarm Gmbh
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice,
+      this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright notice,
+      this list of conditions and the following disclaimer in the documentation
+      and/or other materials provided with the distribution.
+    * Neither the name of ISPConfig nor the names of its contributors
+      may be used to endorse or promote products derived from this software without
+      specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/******************************************
+* Begin Form configuration
+******************************************/
+
+$tform_def_file = "form/dns_cname.tform.php";
+
+/******************************************
+* End Form configuration
+******************************************/
+
+require_once('../../lib/config.inc.php');
+require_once('../../lib/app.inc.php');
+
+//* Check permissions for module
+$app->auth->check_module_permissions('dns');
+
+// Loading classes
+$app->uses('tpl,tform,tform_actions,validate_dns');
+$app->load('tform_actions');
+
+class page_action extends tform_actions {
+	
+	function onShowNew() {
+		global $app, $conf;
+		
+		// we will check only users, not admins
+		if($_SESSION["s"]["user"]["typ"] == 'user') {
+			
+			// Get the limits of the client
+			$client_group_id = $_SESSION["s"]["user"]["default_group"];
+			$client = $app->db->queryOneRecord("SELECT limit_dns_record FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
+			
+			// Check if the user may add another mailbox.
+			if($client["limit_dns_record"] >= 0) {
+				$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
+				if($tmp["number"] >= $client["limit_dns_record"]) {
+					$app->error($app->tform->wordbook["limit_dns_record_txt"]);
+				}
+			}
+		}
+		
+		parent::onShowNew();
+	}
+	
+	function onSubmit() {
+		global $app, $conf;
+		
+		// Get the parent soa record of the domain
+		$soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = '".intval($_POST["zone"])."' AND ".$app->tform->getAuthSQL('r'));
+
+		// Check if Domain belongs to user
+		if($soa["id"] != $_POST["zone"]) $app->tform->errorMessage .= $app->tform->wordbook["no_zone_perm"];
+		
+		// Check the client limits, if user is not the admin
+		if($_SESSION["s"]["user"]["typ"] != 'admin') { // if user is not admin
+			// Get the limits of the client
+			$client_group_id = $_SESSION["s"]["user"]["default_group"];
+			$client = $app->db->queryOneRecord("SELECT limit_dns_record FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
+			
+			// Check if the user may add another mailbox.
+			if($this->id == 0 && $client["limit_dns_record"] >= 0) {
+				$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
+				if($tmp["number"] >= $client["limit_dns_record"]) {
+					$app->error($app->tform->wordbook["limit_dns_record_txt"]);
+				}
+			}
+		} // end if user is not admin
+		
+		
+		// Set the server ID of the rr record to the same server ID as the parent record.
+		$this->dataRecord["server_id"] = $soa["server_id"];
+		
+		parent::onSubmit();
+	}
+	
+	function onAfterInsert() {
+		global $app, $conf;
+		
+		//* Set the sys_groupid of the rr record to be the same then the sys_groupid of the soa record
+		$soa = $app->db->queryOneRecord("SELECT sys_groupid FROM dns_soa WHERE id = '".intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r'));
+		$app->db->datalogUpdate('dns_rr', "sys_groupid = ".$soa['sys_groupid'], 'id', $this->id);
+
+		//* Update the serial number of the SOA record
+		$soa_id = intval($_POST["zone"]);
+		$serial = $app->validate_dns->increase_serial($soa["serial"]);
+		$app->db->datalogUpdate('dns_soa', "serial = $serial", 'id', $soa_id);
+	}
+	
+	function onAfterUpdate() {
+		global $app, $conf;
+		
+		//* Update the serial number of the SOA record
+		$soa = $app->db->queryOneRecord("SELECT serial FROM dns_soa WHERE id = '".intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r'));
+		$soa_id = intval($_POST["zone"]);
+		$serial = $app->validate_dns->increase_serial($soa["serial"]);
+		$app->db->datalogUpdate('dns_soa', "serial = $serial", 'id', $soa_id);
+	}
+}
+
+$page = new page_action;
+$page->onLoad();
+
 ?>
\ No newline at end of file
diff --git a/interface/web/dns/dns_hinfo_edit.php b/interface/web/dns/dns_hinfo_edit.php
index ae21a9e8afcd4e8ff5f9ac1ef7f51781b93b0d34..e5b2d8905fcd035c5a4c6b5a56de0bb841496089 100644
--- a/interface/web/dns/dns_hinfo_edit.php
+++ b/interface/web/dns/dns_hinfo_edit.php
@@ -1,134 +1,133 @@
-<?php
-
-/*
-Copyright (c) 2007, Till Brehm, projektfarm Gmbh
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
-
-    * Redistributions of source code must retain the above copyright notice,
-      this list of conditions and the following disclaimer.
-    * Redistributions in binary form must reproduce the above copyright notice,
-      this list of conditions and the following disclaimer in the documentation
-      and/or other materials provided with the distribution.
-    * Neither the name of ISPConfig nor the names of its contributors
-      may be used to endorse or promote products derived from this software without
-      specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/******************************************
-* Begin Form configuration
-******************************************/
-
-$tform_def_file = "form/dns_hinfo.tform.php";
-
-/******************************************
-* End Form configuration
-******************************************/
-
-require_once('../../lib/config.inc.php');
-require_once('../../lib/app.inc.php');
-
-//* Check permissions for module
-$app->auth->check_module_permissions('dns');
-
-// Loading classes
-$app->uses('tpl,tform,tform_actions,validate_dns');
-$app->load('tform_actions');
-
-class page_action extends tform_actions {
-	
-	function onShowNew() {
-		global $app, $conf;
-		
-		// we will check only users, not admins
-		if($_SESSION["s"]["user"]["typ"] == 'user') {
-			
-			// Get the limits of the client
-			$client_group_id = $_SESSION["s"]["user"]["default_group"];
-			$client = $app->db->queryOneRecord("SELECT limit_dns_record FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
-			
-			// Check if the user may add another mailbox.
-			if($client["limit_dns_record"] >= 0) {
-				$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
-				if($tmp["number"] >= $client["limit_dns_record"]) {
-					$app->error($app->tform->wordbook["limit_dns_record_txt"]);
-				}
-			}
-		}
-		
-		parent::onShowNew();
-	}
-	
-	function onSubmit() {
-		global $app, $conf;
-		
-		// Get the parent soa record of the domain
-		$soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = '".intval($_POST["zone"])."' AND ".$app->tform->getAuthSQL('r'));
-
-		// Check if Domain belongs to user
-		if($soa["id"] != $_POST["zone"]) $app->tform->errorMessage .= $app->tform->wordbook["no_zone_perm"];
-		
-		// Check the client limits, if user is not the admin
-		if($_SESSION["s"]["user"]["typ"] != 'admin') { // if user is not admin
-			// Get the limits of the client
-			$client_group_id = $_SESSION["s"]["user"]["default_group"];
-			$client = $app->db->queryOneRecord("SELECT limit_dns_record FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
-			
-			// Check if the user may add another mailbox.
-			if($this->id == 0 && $client["limit_dns_record"] >= 0) {
-				$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
-				if($tmp["number"] >= $client["limit_dns_record"]) {
-					$app->error($app->tform->wordbook["limit_dns_record_txt"]);
-				}
-			}
-		} // end if user is not admin
-		
-		
-		// Set the server ID of the rr record to the same server ID as the parent record.
-		$this->dataRecord["server_id"] = $soa["server_id"];
-		
-		parent::onSubmit();
-	}
-	
-	function onAfterInsert() {
-		global $app, $conf;
-		
-		// Set the sys_groupid of the rr record to be the same then the sys_groupid of the soa record
-		$soa = $app->db->queryOneRecord("SELECT sys_groupid FROM dns_soa WHERE id = '".intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r'));
-		$app->db->query("UPDATE dns_rr SET sys_groupid = ".$soa['sys_groupid']." WHERE id = ".$this->id);
-
-		// Update the serial number of the SOA record
-		$soa_id = intval($_POST["zone"]);
-		$serial = $app->validate_dns->increase_serial($soa["serial"]);
-		$app->db->query("UPDATE dns_soa SET serial = $serial WHERE id = $soa_id");
-		
-	}
-	
-	function onAfterUpdate() {
-		global $app, $conf;
-		
-		// Update the serial number of the SOA record
-		$soa = $app->db->queryOneRecord("SELECT serial FROM dns_soa WHERE id = '".intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r'));
-		$soa_id = intval($_POST["zone"]);
-		$serial = $app->validate_dns->increase_serial($soa["serial"]);
-		$app->db->query("UPDATE dns_soa SET serial = $serial WHERE id = $soa_id");
-	}
-}
-
-$page = new page_action;
-$page->onLoad();
-
+<?php
+
+/*
+Copyright (c) 2007, Till Brehm, projektfarm Gmbh
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice,
+      this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright notice,
+      this list of conditions and the following disclaimer in the documentation
+      and/or other materials provided with the distribution.
+    * Neither the name of ISPConfig nor the names of its contributors
+      may be used to endorse or promote products derived from this software without
+      specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/******************************************
+* Begin Form configuration
+******************************************/
+
+$tform_def_file = "form/dns_hinfo.tform.php";
+
+/******************************************
+* End Form configuration
+******************************************/
+
+require_once('../../lib/config.inc.php');
+require_once('../../lib/app.inc.php');
+
+//* Check permissions for module
+$app->auth->check_module_permissions('dns');
+
+// Loading classes
+$app->uses('tpl,tform,tform_actions,validate_dns');
+$app->load('tform_actions');
+
+class page_action extends tform_actions {
+	
+	function onShowNew() {
+		global $app, $conf;
+		
+		// we will check only users, not admins
+		if($_SESSION["s"]["user"]["typ"] == 'user') {
+			
+			// Get the limits of the client
+			$client_group_id = $_SESSION["s"]["user"]["default_group"];
+			$client = $app->db->queryOneRecord("SELECT limit_dns_record FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
+			
+			// Check if the user may add another mailbox.
+			if($client["limit_dns_record"] >= 0) {
+				$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
+				if($tmp["number"] >= $client["limit_dns_record"]) {
+					$app->error($app->tform->wordbook["limit_dns_record_txt"]);
+				}
+			}
+		}
+		
+		parent::onShowNew();
+	}
+	
+	function onSubmit() {
+		global $app, $conf;
+		
+		// Get the parent soa record of the domain
+		$soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = '".intval($_POST["zone"])."' AND ".$app->tform->getAuthSQL('r'));
+
+		// Check if Domain belongs to user
+		if($soa["id"] != $_POST["zone"]) $app->tform->errorMessage .= $app->tform->wordbook["no_zone_perm"];
+		
+		// Check the client limits, if user is not the admin
+		if($_SESSION["s"]["user"]["typ"] != 'admin') { // if user is not admin
+			// Get the limits of the client
+			$client_group_id = $_SESSION["s"]["user"]["default_group"];
+			$client = $app->db->queryOneRecord("SELECT limit_dns_record FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
+			
+			// Check if the user may add another mailbox.
+			if($this->id == 0 && $client["limit_dns_record"] >= 0) {
+				$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
+				if($tmp["number"] >= $client["limit_dns_record"]) {
+					$app->error($app->tform->wordbook["limit_dns_record_txt"]);
+				}
+			}
+		} // end if user is not admin
+		
+		
+		// Set the server ID of the rr record to the same server ID as the parent record.
+		$this->dataRecord["server_id"] = $soa["server_id"];
+		
+		parent::onSubmit();
+	}
+	
+	function onAfterInsert() {
+		global $app, $conf;
+		
+		//* Set the sys_groupid of the rr record to be the same then the sys_groupid of the soa record
+		$soa = $app->db->queryOneRecord("SELECT sys_groupid FROM dns_soa WHERE id = '".intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r'));
+		$app->db->datalogUpdate('dns_rr', "sys_groupid = ".$soa['sys_groupid'], 'id', $this->id);
+
+		//* Update the serial number of the SOA record
+		$soa_id = intval($_POST["zone"]);
+		$serial = $app->validate_dns->increase_serial($soa["serial"]);
+		$app->db->datalogUpdate('dns_soa', "serial = $serial", 'id', $soa_id);
+	}
+	
+	function onAfterUpdate() {
+		global $app, $conf;
+		
+		//* Update the serial number of the SOA record
+		$soa = $app->db->queryOneRecord("SELECT serial FROM dns_soa WHERE id = '".intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r'));
+		$soa_id = intval($_POST["zone"]);
+		$serial = $app->validate_dns->increase_serial($soa["serial"]);
+		$app->db->datalogUpdate('dns_soa', "serial = $serial", 'id', $soa_id);
+	}
+}
+
+$page = new page_action;
+$page->onLoad();
+
 ?>
\ No newline at end of file
diff --git a/interface/web/dns/dns_mx_edit.php b/interface/web/dns/dns_mx_edit.php
index 14f42b357610720fc93deea64c405f7cae0509e5..5aae13db720f166b205dcfd161eedcf069a19d84 100644
--- a/interface/web/dns/dns_mx_edit.php
+++ b/interface/web/dns/dns_mx_edit.php
@@ -1,134 +1,133 @@
-<?php
-
-/*
-Copyright (c) 2007, Till Brehm, projektfarm Gmbh
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
-
-    * Redistributions of source code must retain the above copyright notice,
-      this list of conditions and the following disclaimer.
-    * Redistributions in binary form must reproduce the above copyright notice,
-      this list of conditions and the following disclaimer in the documentation
-      and/or other materials provided with the distribution.
-    * Neither the name of ISPConfig nor the names of its contributors
-      may be used to endorse or promote products derived from this software without
-      specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/******************************************
-* Begin Form configuration
-******************************************/
-
-$tform_def_file = "form/dns_mx.tform.php";
-
-/******************************************
-* End Form configuration
-******************************************/
-
-require_once('../../lib/config.inc.php');
-require_once('../../lib/app.inc.php');
-
-//* Check permissions for module
-$app->auth->check_module_permissions('dns');
-
-// Loading classes
-$app->uses('tpl,tform,tform_actions,validate_dns');
-$app->load('tform_actions');
-
-class page_action extends tform_actions {
-	
-	function onShowNew() {
-		global $app, $conf;
-		
-		// we will check only users, not admins
-		if($_SESSION["s"]["user"]["typ"] == 'user') {
-			
-			// Get the limits of the client
-			$client_group_id = $_SESSION["s"]["user"]["default_group"];
-			$client = $app->db->queryOneRecord("SELECT limit_dns_record FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
-			
-			// Check if the user may add another mailbox.
-			if($client["limit_dns_record"] >= 0) {
-				$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
-				if($tmp["number"] >= $client["limit_dns_record"]) {
-					$app->error($app->tform->wordbook["limit_dns_record_txt"]);
-				}
-			}
-		}
-		
-		parent::onShowNew();
-	}
-	
-	function onSubmit() {
-		global $app, $conf;
-		
-		// Get the parent soa record of the domain
-		$soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = '".intval($_POST["zone"])."' AND ".$app->tform->getAuthSQL('r'));
-
-		// Check if Domain belongs to user
-		if($soa["id"] != $_POST["zone"]) $app->tform->errorMessage .= $app->tform->wordbook["no_zone_perm"];
-		
-		// Check the client limits, if user is not the admin
-		if($_SESSION["s"]["user"]["typ"] != 'admin') { // if user is not admin
-			// Get the limits of the client
-			$client_group_id = $_SESSION["s"]["user"]["default_group"];
-			$client = $app->db->queryOneRecord("SELECT limit_dns_record FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
-			
-			// Check if the user may add another mailbox.
-			if($this->id == 0 && $client["limit_dns_record"] >= 0) {
-				$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
-				if($tmp["number"] >= $client["limit_dns_record"]) {
-					$app->error($app->tform->wordbook["limit_dns_record_txt"]);
-				}
-			}
-		} // end if user is not admin
-		
-		
-		// Set the server ID of the rr record to the same server ID as the parent record.
-		$this->dataRecord["server_id"] = $soa["server_id"];
-		
-		parent::onSubmit();
-	}
-	
-	function onAfterInsert() {
-		global $app, $conf;
-		
-		// Set the sys_groupid of the rr record to be the same then the sys_groupid of the soa record
-		$soa = $app->db->queryOneRecord("SELECT sys_groupid FROM dns_soa WHERE id = '".intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r'));
-		$app->db->query("UPDATE dns_rr SET sys_groupid = ".$soa['sys_groupid']." WHERE id = ".$this->id);
-
-		// Update the serial number of the SOA record
-		$soa_id = intval($_POST["zone"]);
-		$serial = $app->validate_dns->increase_serial($soa["serial"]);
-		$app->db->query("UPDATE dns_soa SET serial = $serial WHERE id = $soa_id");
-		
-	}
-	
-	function onAfterUpdate() {
-		global $app, $conf;
-		
-		// Update the serial number of the SOA record
-		$soa = $app->db->queryOneRecord("SELECT serial FROM dns_soa WHERE id = '".intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r'));
-		$soa_id = intval($_POST["zone"]);
-		$serial = $app->validate_dns->increase_serial($soa["serial"]);
-		$app->db->query("UPDATE dns_soa SET serial = $serial WHERE id = $soa_id");
-	}
-}
-
-$page = new page_action;
-$page->onLoad();
-
+<?php
+
+/*
+Copyright (c) 2007, Till Brehm, projektfarm Gmbh
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice,
+      this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright notice,
+      this list of conditions and the following disclaimer in the documentation
+      and/or other materials provided with the distribution.
+    * Neither the name of ISPConfig nor the names of its contributors
+      may be used to endorse or promote products derived from this software without
+      specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/******************************************
+* Begin Form configuration
+******************************************/
+
+$tform_def_file = "form/dns_mx.tform.php";
+
+/******************************************
+* End Form configuration
+******************************************/
+
+require_once('../../lib/config.inc.php');
+require_once('../../lib/app.inc.php');
+
+//* Check permissions for module
+$app->auth->check_module_permissions('dns');
+
+// Loading classes
+$app->uses('tpl,tform,tform_actions,validate_dns');
+$app->load('tform_actions');
+
+class page_action extends tform_actions {
+	
+	function onShowNew() {
+		global $app, $conf;
+		
+		// we will check only users, not admins
+		if($_SESSION["s"]["user"]["typ"] == 'user') {
+			
+			// Get the limits of the client
+			$client_group_id = $_SESSION["s"]["user"]["default_group"];
+			$client = $app->db->queryOneRecord("SELECT limit_dns_record FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
+			
+			// Check if the user may add another mailbox.
+			if($client["limit_dns_record"] >= 0) {
+				$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
+				if($tmp["number"] >= $client["limit_dns_record"]) {
+					$app->error($app->tform->wordbook["limit_dns_record_txt"]);
+				}
+			}
+		}
+		
+		parent::onShowNew();
+	}
+	
+	function onSubmit() {
+		global $app, $conf;
+		
+		// Get the parent soa record of the domain
+		$soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = '".intval($_POST["zone"])."' AND ".$app->tform->getAuthSQL('r'));
+
+		// Check if Domain belongs to user
+		if($soa["id"] != $_POST["zone"]) $app->tform->errorMessage .= $app->tform->wordbook["no_zone_perm"];
+		
+		// Check the client limits, if user is not the admin
+		if($_SESSION["s"]["user"]["typ"] != 'admin') { // if user is not admin
+			// Get the limits of the client
+			$client_group_id = $_SESSION["s"]["user"]["default_group"];
+			$client = $app->db->queryOneRecord("SELECT limit_dns_record FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
+			
+			// Check if the user may add another mailbox.
+			if($this->id == 0 && $client["limit_dns_record"] >= 0) {
+				$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
+				if($tmp["number"] >= $client["limit_dns_record"]) {
+					$app->error($app->tform->wordbook["limit_dns_record_txt"]);
+				}
+			}
+		} // end if user is not admin
+		
+		
+		// Set the server ID of the rr record to the same server ID as the parent record.
+		$this->dataRecord["server_id"] = $soa["server_id"];
+		
+		parent::onSubmit();
+	}
+	
+	function onAfterInsert() {
+		global $app, $conf;
+		
+		//* Set the sys_groupid of the rr record to be the same then the sys_groupid of the soa record
+		$soa = $app->db->queryOneRecord("SELECT sys_groupid FROM dns_soa WHERE id = '".intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r'));
+		$app->db->datalogUpdate('dns_rr', "sys_groupid = ".$soa['sys_groupid'], 'id', $this->id);
+
+		//* Update the serial number of the SOA record
+		$soa_id = intval($_POST["zone"]);
+		$serial = $app->validate_dns->increase_serial($soa["serial"]);
+		$app->db->datalogUpdate('dns_soa', "serial = $serial", 'id', $soa_id);
+	}
+	
+	function onAfterUpdate() {
+		global $app, $conf;
+		
+		//* Update the serial number of the SOA record
+		$soa = $app->db->queryOneRecord("SELECT serial FROM dns_soa WHERE id = '".intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r'));
+		$soa_id = intval($_POST["zone"]);
+		$serial = $app->validate_dns->increase_serial($soa["serial"]);
+		$app->db->datalogUpdate('dns_soa', "serial = $serial", 'id', $soa_id);
+	}
+}
+
+$page = new page_action;
+$page->onLoad();
+
 ?>
\ No newline at end of file
diff --git a/interface/web/dns/dns_ns_edit.php b/interface/web/dns/dns_ns_edit.php
index 9a339949068a8205ac2967e874c8042cab0ca76a..90c605e9d9397d7253bce07e0cd951f2963c5161 100644
--- a/interface/web/dns/dns_ns_edit.php
+++ b/interface/web/dns/dns_ns_edit.php
@@ -1,134 +1,133 @@
-<?php
-
-/*
-Copyright (c) 2007, Till Brehm, projektfarm Gmbh
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
-
-    * Redistributions of source code must retain the above copyright notice,
-      this list of conditions and the following disclaimer.
-    * Redistributions in binary form must reproduce the above copyright notice,
-      this list of conditions and the following disclaimer in the documentation
-      and/or other materials provided with the distribution.
-    * Neither the name of ISPConfig nor the names of its contributors
-      may be used to endorse or promote products derived from this software without
-      specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/******************************************
-* Begin Form configuration
-******************************************/
-
-$tform_def_file = "form/dns_ns.tform.php";
-
-/******************************************
-* End Form configuration
-******************************************/
-
-require_once('../../lib/config.inc.php');
-require_once('../../lib/app.inc.php');
-
-//* Check permissions for module
-$app->auth->check_module_permissions('dns');
-
-// Loading classes
-$app->uses('tpl,tform,tform_actions,validate_dns');
-$app->load('tform_actions');
-
-class page_action extends tform_actions {
-	
-	function onShowNew() {
-		global $app, $conf;
-		
-		// we will check only users, not admins
-		if($_SESSION["s"]["user"]["typ"] == 'user') {
-			
-			// Get the limits of the client
-			$client_group_id = $_SESSION["s"]["user"]["default_group"];
-			$client = $app->db->queryOneRecord("SELECT limit_dns_record FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
-			
-			// Check if the user may add another mailbox.
-			if($client["limit_dns_record"] >= 0) {
-				$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
-				if($tmp["number"] >= $client["limit_dns_record"]) {
-					$app->error($app->tform->wordbook["limit_dns_record_txt"]);
-				}
-			}
-		}
-		
-		parent::onShowNew();
-	}
-	
-	function onSubmit() {
-		global $app, $conf;
-		
-		// Get the parent soa record of the domain
-		$soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = '".intval($_POST["zone"])."' AND ".$app->tform->getAuthSQL('r'));
-
-		// Check if Domain belongs to user
-		if($soa["id"] != $_POST["zone"]) $app->tform->errorMessage .= $app->tform->wordbook["no_zone_perm"];
-		
-		// Check the client limits, if user is not the admin
-		if($_SESSION["s"]["user"]["typ"] != 'admin') { // if user is not admin
-			// Get the limits of the client
-			$client_group_id = $_SESSION["s"]["user"]["default_group"];
-			$client = $app->db->queryOneRecord("SELECT limit_dns_record FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
-			
-			// Check if the user may add another mailbox.
-			if($this->id == 0 && $client["limit_dns_record"] >= 0) {
-				$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
-				if($tmp["number"] >= $client["limit_dns_record"]) {
-					$app->error($app->tform->wordbook["limit_dns_record_txt"]);
-				}
-			}
-		} // end if user is not admin
-		
-		
-		// Set the server ID of the rr record to the same server ID as the parent record.
-		$this->dataRecord["server_id"] = $soa["server_id"];
-		
-		parent::onSubmit();
-	}
-	
-	function onAfterInsert() {
-		global $app, $conf;
-		
-		// Set the sys_groupid of the rr record to be the same then the sys_groupid of the soa record
-		$soa = $app->db->queryOneRecord("SELECT sys_groupid FROM dns_soa WHERE id = '".intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r'));
-		$app->db->query("UPDATE dns_rr SET sys_groupid = ".$soa['sys_groupid']." WHERE id = ".$this->id);
-
-		// Update the serial number of the SOA record
-		$soa_id = intval($_POST["zone"]);
-		$serial = $app->validate_dns->increase_serial($soa["serial"]);
-		$app->db->query("UPDATE dns_soa SET serial = $serial WHERE id = $soa_id");
-		
-	}
-	
-	function onAfterUpdate() {
-		global $app, $conf;
-		
-		// Update the serial number of the SOA record
-		$soa = $app->db->queryOneRecord("SELECT serial FROM dns_soa WHERE id = '".intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r'));
-		$soa_id = intval($_POST["zone"]);
-		$serial = $app->validate_dns->increase_serial($soa["serial"]);
-		$app->db->query("UPDATE dns_soa SET serial = $serial WHERE id = $soa_id");
-	}
-}
-
-$page = new page_action;
-$page->onLoad();
-
+<?php
+
+/*
+Copyright (c) 2007, Till Brehm, projektfarm Gmbh
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice,
+      this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright notice,
+      this list of conditions and the following disclaimer in the documentation
+      and/or other materials provided with the distribution.
+    * Neither the name of ISPConfig nor the names of its contributors
+      may be used to endorse or promote products derived from this software without
+      specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/******************************************
+* Begin Form configuration
+******************************************/
+
+$tform_def_file = "form/dns_ns.tform.php";
+
+/******************************************
+* End Form configuration
+******************************************/
+
+require_once('../../lib/config.inc.php');
+require_once('../../lib/app.inc.php');
+
+//* Check permissions for module
+$app->auth->check_module_permissions('dns');
+
+// Loading classes
+$app->uses('tpl,tform,tform_actions,validate_dns');
+$app->load('tform_actions');
+
+class page_action extends tform_actions {
+	
+	function onShowNew() {
+		global $app, $conf;
+		
+		// we will check only users, not admins
+		if($_SESSION["s"]["user"]["typ"] == 'user') {
+			
+			// Get the limits of the client
+			$client_group_id = $_SESSION["s"]["user"]["default_group"];
+			$client = $app->db->queryOneRecord("SELECT limit_dns_record FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
+			
+			// Check if the user may add another mailbox.
+			if($client["limit_dns_record"] >= 0) {
+				$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
+				if($tmp["number"] >= $client["limit_dns_record"]) {
+					$app->error($app->tform->wordbook["limit_dns_record_txt"]);
+				}
+			}
+		}
+		
+		parent::onShowNew();
+	}
+	
+	function onSubmit() {
+		global $app, $conf;
+		
+		// Get the parent soa record of the domain
+		$soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = '".intval($_POST["zone"])."' AND ".$app->tform->getAuthSQL('r'));
+
+		// Check if Domain belongs to user
+		if($soa["id"] != $_POST["zone"]) $app->tform->errorMessage .= $app->tform->wordbook["no_zone_perm"];
+		
+		// Check the client limits, if user is not the admin
+		if($_SESSION["s"]["user"]["typ"] != 'admin') { // if user is not admin
+			// Get the limits of the client
+			$client_group_id = $_SESSION["s"]["user"]["default_group"];
+			$client = $app->db->queryOneRecord("SELECT limit_dns_record FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
+			
+			// Check if the user may add another mailbox.
+			if($this->id == 0 && $client["limit_dns_record"] >= 0) {
+				$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
+				if($tmp["number"] >= $client["limit_dns_record"]) {
+					$app->error($app->tform->wordbook["limit_dns_record_txt"]);
+				}
+			}
+		} // end if user is not admin
+		
+		
+		// Set the server ID of the rr record to the same server ID as the parent record.
+		$this->dataRecord["server_id"] = $soa["server_id"];
+		
+		parent::onSubmit();
+	}
+	
+	function onAfterInsert() {
+		global $app, $conf;
+		
+		//* Set the sys_groupid of the rr record to be the same then the sys_groupid of the soa record
+		$soa = $app->db->queryOneRecord("SELECT sys_groupid FROM dns_soa WHERE id = '".intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r'));
+		$app->db->datalogUpdate('dns_rr', "sys_groupid = ".$soa['sys_groupid'], 'id', $this->id);
+
+		//* Update the serial number of the SOA record
+		$soa_id = intval($_POST["zone"]);
+		$serial = $app->validate_dns->increase_serial($soa["serial"]);
+		$app->db->datalogUpdate('dns_soa', "serial = $serial", 'id', $soa_id);
+	}
+	
+	function onAfterUpdate() {
+		global $app, $conf;
+		
+		//* Update the serial number of the SOA record
+		$soa = $app->db->queryOneRecord("SELECT serial FROM dns_soa WHERE id = '".intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r'));
+		$soa_id = intval($_POST["zone"]);
+		$serial = $app->validate_dns->increase_serial($soa["serial"]);
+		$app->db->datalogUpdate('dns_soa', "serial = $serial", 'id', $soa_id);
+	}
+}
+
+$page = new page_action;
+$page->onLoad();
+
 ?>
\ No newline at end of file
diff --git a/interface/web/dns/dns_ptr_edit.php b/interface/web/dns/dns_ptr_edit.php
index dd7056132d21332a8e0459973cd8b5945bb7e581..2515161588227fcb4647b8565a98763f6238c067 100644
--- a/interface/web/dns/dns_ptr_edit.php
+++ b/interface/web/dns/dns_ptr_edit.php
@@ -1,134 +1,133 @@
-<?php
-
-/*
-Copyright (c) 2007, Till Brehm, projektfarm Gmbh
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
-
-    * Redistributions of source code must retain the above copyright notice,
-      this list of conditions and the following disclaimer.
-    * Redistributions in binary form must reproduce the above copyright notice,
-      this list of conditions and the following disclaimer in the documentation
-      and/or other materials provided with the distribution.
-    * Neither the name of ISPConfig nor the names of its contributors
-      may be used to endorse or promote products derived from this software without
-      specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/******************************************
-* Begin Form configuration
-******************************************/
-
-$tform_def_file = "form/dns_ptr.tform.php";
-
-/******************************************
-* End Form configuration
-******************************************/
-
-require_once('../../lib/config.inc.php');
-require_once('../../lib/app.inc.php');
-
-//* Check permissions for module
-$app->auth->check_module_permissions('dns');
-
-// Loading classes
-$app->uses('tpl,tform,tform_actions,validate_dns');
-$app->load('tform_actions');
-
-class page_action extends tform_actions {
-	
-	function onShowNew() {
-		global $app, $conf;
-		
-		// we will check only users, not admins
-		if($_SESSION["s"]["user"]["typ"] == 'user') {
-			
-			// Get the limits of the client
-			$client_group_id = $_SESSION["s"]["user"]["default_group"];
-			$client = $app->db->queryOneRecord("SELECT limit_dns_record FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
-			
-			// Check if the user may add another mailbox.
-			if($client["limit_dns_record"] >= 0) {
-				$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
-				if($tmp["number"] >= $client["limit_dns_record"]) {
-					$app->error($app->tform->wordbook["limit_dns_record_txt"]);
-				}
-			}
-		}
-		
-		parent::onShowNew();
-	}
-	
-	function onSubmit() {
-		global $app, $conf;
-		
-		// Get the parent soa record of the domain
-		$soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = '".intval($_POST["zone"])."' AND ".$app->tform->getAuthSQL('r'));
-
-		// Check if Domain belongs to user
-		if($soa["id"] != $_POST["zone"]) $app->tform->errorMessage .= $app->tform->wordbook["no_zone_perm"];
-		
-		// Check the client limits, if user is not the admin
-		if($_SESSION["s"]["user"]["typ"] != 'admin') { // if user is not admin
-			// Get the limits of the client
-			$client_group_id = $_SESSION["s"]["user"]["default_group"];
-			$client = $app->db->queryOneRecord("SELECT limit_dns_record FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
-			
-			// Check if the user may add another mailbox.
-			if($this->id == 0 && $client["limit_dns_record"] >= 0) {
-				$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
-				if($tmp["number"] >= $client["limit_dns_record"]) {
-					$app->error($app->tform->wordbook["limit_dns_record_txt"]);
-				}
-			}
-		} // end if user is not admin
-		
-		
-		// Set the server ID of the rr record to the same server ID as the parent record.
-		$this->dataRecord["server_id"] = $soa["server_id"];
-		
-		parent::onSubmit();
-	}
-	
-	function onAfterInsert() {
-		global $app, $conf;
-		
-		// Set the sys_groupid of the rr record to be the same then the sys_groupid of the soa record
-		$soa = $app->db->queryOneRecord("SELECT sys_groupid FROM dns_soa WHERE id = '".intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r'));
-		$app->db->query("UPDATE dns_rr SET sys_groupid = ".$soa['sys_groupid']." WHERE id = ".$this->id);
-
-		// Update the serial number of the SOA record
-		$soa_id = intval($_POST["zone"]);
-		$serial = $app->validate_dns->increase_serial($soa["serial"]);
-		$app->db->query("UPDATE dns_soa SET serial = $serial WHERE id = $soa_id");
-		
-	}
-	
-	function onAfterUpdate() {
-		global $app, $conf;
-		
-		// Update the serial number of the SOA record
-		$soa = $app->db->queryOneRecord("SELECT serial FROM dns_soa WHERE id = '".intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r'));
-		$soa_id = intval($_POST["zone"]);
-		$serial = $app->validate_dns->increase_serial($soa["serial"]);
-		$app->db->query("UPDATE dns_soa SET serial = $serial WHERE id = $soa_id");
-	}
-}
-
-$page = new page_action;
-$page->onLoad();
-
+<?php
+
+/*
+Copyright (c) 2007, Till Brehm, projektfarm Gmbh
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice,
+      this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright notice,
+      this list of conditions and the following disclaimer in the documentation
+      and/or other materials provided with the distribution.
+    * Neither the name of ISPConfig nor the names of its contributors
+      may be used to endorse or promote products derived from this software without
+      specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/******************************************
+* Begin Form configuration
+******************************************/
+
+$tform_def_file = "form/dns_ptr.tform.php";
+
+/******************************************
+* End Form configuration
+******************************************/
+
+require_once('../../lib/config.inc.php');
+require_once('../../lib/app.inc.php');
+
+//* Check permissions for module
+$app->auth->check_module_permissions('dns');
+
+// Loading classes
+$app->uses('tpl,tform,tform_actions,validate_dns');
+$app->load('tform_actions');
+
+class page_action extends tform_actions {
+	
+	function onShowNew() {
+		global $app, $conf;
+		
+		// we will check only users, not admins
+		if($_SESSION["s"]["user"]["typ"] == 'user') {
+			
+			// Get the limits of the client
+			$client_group_id = $_SESSION["s"]["user"]["default_group"];
+			$client = $app->db->queryOneRecord("SELECT limit_dns_record FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
+			
+			// Check if the user may add another mailbox.
+			if($client["limit_dns_record"] >= 0) {
+				$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
+				if($tmp["number"] >= $client["limit_dns_record"]) {
+					$app->error($app->tform->wordbook["limit_dns_record_txt"]);
+				}
+			}
+		}
+		
+		parent::onShowNew();
+	}
+	
+	function onSubmit() {
+		global $app, $conf;
+		
+		// Get the parent soa record of the domain
+		$soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = '".intval($_POST["zone"])."' AND ".$app->tform->getAuthSQL('r'));
+
+		// Check if Domain belongs to user
+		if($soa["id"] != $_POST["zone"]) $app->tform->errorMessage .= $app->tform->wordbook["no_zone_perm"];
+		
+		// Check the client limits, if user is not the admin
+		if($_SESSION["s"]["user"]["typ"] != 'admin') { // if user is not admin
+			// Get the limits of the client
+			$client_group_id = $_SESSION["s"]["user"]["default_group"];
+			$client = $app->db->queryOneRecord("SELECT limit_dns_record FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
+			
+			// Check if the user may add another mailbox.
+			if($this->id == 0 && $client["limit_dns_record"] >= 0) {
+				$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
+				if($tmp["number"] >= $client["limit_dns_record"]) {
+					$app->error($app->tform->wordbook["limit_dns_record_txt"]);
+				}
+			}
+		} // end if user is not admin
+		
+		
+		// Set the server ID of the rr record to the same server ID as the parent record.
+		$this->dataRecord["server_id"] = $soa["server_id"];
+		
+		parent::onSubmit();
+	}
+	
+	function onAfterInsert() {
+		global $app, $conf;
+		
+		//* Set the sys_groupid of the rr record to be the same then the sys_groupid of the soa record
+		$soa = $app->db->queryOneRecord("SELECT sys_groupid FROM dns_soa WHERE id = '".intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r'));
+		$app->db->datalogUpdate('dns_rr', "sys_groupid = ".$soa['sys_groupid'], 'id', $this->id);
+
+		//* Update the serial number of the SOA record
+		$soa_id = intval($_POST["zone"]);
+		$serial = $app->validate_dns->increase_serial($soa["serial"]);
+		$app->db->datalogUpdate('dns_soa', "serial = $serial", 'id', $soa_id);
+	}
+	
+	function onAfterUpdate() {
+		global $app, $conf;
+		
+		//* Update the serial number of the SOA record
+		$soa = $app->db->queryOneRecord("SELECT serial FROM dns_soa WHERE id = '".intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r'));
+		$soa_id = intval($_POST["zone"]);
+		$serial = $app->validate_dns->increase_serial($soa["serial"]);
+		$app->db->datalogUpdate('dns_soa', "serial = $serial", 'id', $soa_id);
+	}
+}
+
+$page = new page_action;
+$page->onLoad();
+
 ?>
\ No newline at end of file
diff --git a/interface/web/dns/dns_rp_edit.php b/interface/web/dns/dns_rp_edit.php
index 9f23158bf529bd1960b725f963a75b3bf8b27485..a6f8a9752cb4590cfa93d19bc2590976ee3c585b 100644
--- a/interface/web/dns/dns_rp_edit.php
+++ b/interface/web/dns/dns_rp_edit.php
@@ -1,134 +1,133 @@
-<?php
-
-/*
-Copyright (c) 2007, Till Brehm, projektfarm Gmbh
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
-
-    * Redistributions of source code must retain the above copyright notice,
-      this list of conditions and the following disclaimer.
-    * Redistributions in binary form must reproduce the above copyright notice,
-      this list of conditions and the following disclaimer in the documentation
-      and/or other materials provided with the distribution.
-    * Neither the name of ISPConfig nor the names of its contributors
-      may be used to endorse or promote products derived from this software without
-      specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/******************************************
-* Begin Form configuration
-******************************************/
-
-$tform_def_file = "form/dns_rp.tform.php";
-
-/******************************************
-* End Form configuration
-******************************************/
-
-require_once('../../lib/config.inc.php');
-require_once('../../lib/app.inc.php');
-
-//* Check permissions for module
-$app->auth->check_module_permissions('dns');
-
-// Loading classes
-$app->uses('tpl,tform,tform_actions,validate_dns');
-$app->load('tform_actions');
-
-class page_action extends tform_actions {
-	
-	function onShowNew() {
-		global $app, $conf;
-		
-		// we will check only users, not admins
-		if($_SESSION["s"]["user"]["typ"] == 'user') {
-			
-			// Get the limits of the client
-			$client_group_id = $_SESSION["s"]["user"]["default_group"];
-			$client = $app->db->queryOneRecord("SELECT limit_dns_record FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
-			
-			// Check if the user may add another mailbox.
-			if($client["limit_dns_record"] >= 0) {
-				$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
-				if($tmp["number"] >= $client["limit_dns_record"]) {
-					$app->error($app->tform->wordbook["limit_dns_record_txt"]);
-				}
-			}
-		}
-		
-		parent::onShowNew();
-	}
-	
-	function onSubmit() {
-		global $app, $conf;
-		
-		// Get the parent soa record of the domain
-		$soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = '".intval($_POST["zone"])."' AND ".$app->tform->getAuthSQL('r'));
-
-		// Check if Domain belongs to user
-		if($soa["id"] != $_POST["zone"]) $app->tform->errorMessage .= $app->tform->wordbook["no_zone_perm"];
-		
-		// Check the client limits, if user is not the admin
-		if($_SESSION["s"]["user"]["typ"] != 'admin') { // if user is not admin
-			// Get the limits of the client
-			$client_group_id = $_SESSION["s"]["user"]["default_group"];
-			$client = $app->db->queryOneRecord("SELECT limit_dns_record FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
-			
-			// Check if the user may add another mailbox.
-			if($this->id == 0 && $client["limit_dns_record"] >= 0) {
-				$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
-				if($tmp["number"] >= $client["limit_dns_record"]) {
-					$app->error($app->tform->wordbook["limit_dns_record_txt"]);
-				}
-			}
-		} // end if user is not admin
-		
-		
-		// Set the server ID of the rr record to the same server ID as the parent record.
-		$this->dataRecord["server_id"] = $soa["server_id"];
-		
-		parent::onSubmit();
-	}
-	
-	function onAfterInsert() {
-		global $app, $conf;
-		
-		// Set the sys_groupid of the rr record to be the same then the sys_groupid of the soa record
-		$soa = $app->db->queryOneRecord("SELECT sys_groupid FROM dns_soa WHERE id = '".intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r'));
-		$app->db->query("UPDATE dns_rr SET sys_groupid = ".$soa['sys_groupid']." WHERE id = ".$this->id);
-
-		// Update the serial number of the SOA record
-		$soa_id = intval($_POST["zone"]);
-		$serial = $app->validate_dns->increase_serial($soa["serial"]);
-		$app->db->query("UPDATE dns_soa SET serial = $serial WHERE id = $soa_id");
-		
-	}
-	
-	function onAfterUpdate() {
-		global $app, $conf;
-		
-		// Update the serial number of the SOA record
-		$soa = $app->db->queryOneRecord("SELECT serial FROM dns_soa WHERE id = '".intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r'));
-		$soa_id = intval($_POST["zone"]);
-		$serial = $app->validate_dns->increase_serial($soa["serial"]);
-		$app->db->query("UPDATE dns_soa SET serial = $serial WHERE id = $soa_id");
-	}
-}
-
-$page = new page_action;
-$page->onLoad();
-
+<?php
+
+/*
+Copyright (c) 2007, Till Brehm, projektfarm Gmbh
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice,
+      this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright notice,
+      this list of conditions and the following disclaimer in the documentation
+      and/or other materials provided with the distribution.
+    * Neither the name of ISPConfig nor the names of its contributors
+      may be used to endorse or promote products derived from this software without
+      specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/******************************************
+* Begin Form configuration
+******************************************/
+
+$tform_def_file = "form/dns_rp.tform.php";
+
+/******************************************
+* End Form configuration
+******************************************/
+
+require_once('../../lib/config.inc.php');
+require_once('../../lib/app.inc.php');
+
+//* Check permissions for module
+$app->auth->check_module_permissions('dns');
+
+// Loading classes
+$app->uses('tpl,tform,tform_actions,validate_dns');
+$app->load('tform_actions');
+
+class page_action extends tform_actions {
+	
+	function onShowNew() {
+		global $app, $conf;
+		
+		// we will check only users, not admins
+		if($_SESSION["s"]["user"]["typ"] == 'user') {
+			
+			// Get the limits of the client
+			$client_group_id = $_SESSION["s"]["user"]["default_group"];
+			$client = $app->db->queryOneRecord("SELECT limit_dns_record FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
+			
+			// Check if the user may add another mailbox.
+			if($client["limit_dns_record"] >= 0) {
+				$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
+				if($tmp["number"] >= $client["limit_dns_record"]) {
+					$app->error($app->tform->wordbook["limit_dns_record_txt"]);
+				}
+			}
+		}
+		
+		parent::onShowNew();
+	}
+	
+	function onSubmit() {
+		global $app, $conf;
+		
+		// Get the parent soa record of the domain
+		$soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = '".intval($_POST["zone"])."' AND ".$app->tform->getAuthSQL('r'));
+
+		// Check if Domain belongs to user
+		if($soa["id"] != $_POST["zone"]) $app->tform->errorMessage .= $app->tform->wordbook["no_zone_perm"];
+		
+		// Check the client limits, if user is not the admin
+		if($_SESSION["s"]["user"]["typ"] != 'admin') { // if user is not admin
+			// Get the limits of the client
+			$client_group_id = $_SESSION["s"]["user"]["default_group"];
+			$client = $app->db->queryOneRecord("SELECT limit_dns_record FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
+			
+			// Check if the user may add another mailbox.
+			if($this->id == 0 && $client["limit_dns_record"] >= 0) {
+				$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
+				if($tmp["number"] >= $client["limit_dns_record"]) {
+					$app->error($app->tform->wordbook["limit_dns_record_txt"]);
+				}
+			}
+		} // end if user is not admin
+		
+		
+		// Set the server ID of the rr record to the same server ID as the parent record.
+		$this->dataRecord["server_id"] = $soa["server_id"];
+		
+		parent::onSubmit();
+	}
+	
+	function onAfterInsert() {
+		global $app, $conf;
+		
+		//* Set the sys_groupid of the rr record to be the same then the sys_groupid of the soa record
+		$soa = $app->db->queryOneRecord("SELECT sys_groupid FROM dns_soa WHERE id = '".intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r'));
+		$app->db->datalogUpdate('dns_rr', "sys_groupid = ".$soa['sys_groupid'], 'id', $this->id);
+
+		//* Update the serial number of the SOA record
+		$soa_id = intval($_POST["zone"]);
+		$serial = $app->validate_dns->increase_serial($soa["serial"]);
+		$app->db->datalogUpdate('dns_soa', "serial = $serial", 'id', $soa_id);
+	}
+	
+	function onAfterUpdate() {
+		global $app, $conf;
+		
+		//* Update the serial number of the SOA record
+		$soa = $app->db->queryOneRecord("SELECT serial FROM dns_soa WHERE id = '".intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r'));
+		$soa_id = intval($_POST["zone"]);
+		$serial = $app->validate_dns->increase_serial($soa["serial"]);
+		$app->db->datalogUpdate('dns_soa', "serial = $serial", 'id', $soa_id);
+	}
+}
+
+$page = new page_action;
+$page->onLoad();
+
 ?>
\ No newline at end of file
diff --git a/interface/web/dns/dns_srv_edit.php b/interface/web/dns/dns_srv_edit.php
index 2b3fe3435e1fb8c3da1266f069a1634d16b3d009..0cb86144c5f9608f498c8bd12c30df573d3612bd 100644
--- a/interface/web/dns/dns_srv_edit.php
+++ b/interface/web/dns/dns_srv_edit.php
@@ -1,134 +1,133 @@
-<?php
-
-/*
-Copyright (c) 2007, Till Brehm, projektfarm Gmbh
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
-
-    * Redistributions of source code must retain the above copyright notice,
-      this list of conditions and the following disclaimer.
-    * Redistributions in binary form must reproduce the above copyright notice,
-      this list of conditions and the following disclaimer in the documentation
-      and/or other materials provided with the distribution.
-    * Neither the name of ISPConfig nor the names of its contributors
-      may be used to endorse or promote products derived from this software without
-      specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/******************************************
-* Begin Form configuration
-******************************************/
-
-$tform_def_file = "form/dns_srv.tform.php";
-
-/******************************************
-* End Form configuration
-******************************************/
-
-require_once('../../lib/config.inc.php');
-require_once('../../lib/app.inc.php');
-
-//* Check permissions for module
-$app->auth->check_module_permissions('dns');
-
-// Loading classes
-$app->uses('tpl,tform,tform_actions,validate_dns');
-$app->load('tform_actions');
-
-class page_action extends tform_actions {
-	
-	function onShowNew() {
-		global $app, $conf;
-		
-		// we will check only users, not admins
-		if($_SESSION["s"]["user"]["typ"] == 'user') {
-			
-			// Get the limits of the client
-			$client_group_id = $_SESSION["s"]["user"]["default_group"];
-			$client = $app->db->queryOneRecord("SELECT limit_dns_record FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
-			
-			// Check if the user may add another mailbox.
-			if($client["limit_dns_record"] >= 0) {
-				$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
-				if($tmp["number"] >= $client["limit_dns_record"]) {
-					$app->error($app->tform->wordbook["limit_dns_record_txt"]);
-				}
-			}
-		}
-		
-		parent::onShowNew();
-	}
-	
-	function onSubmit() {
-		global $app, $conf;
-		
-		// Get the parent soa record of the domain
-		$soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = '".intval($_POST["zone"])."' AND ".$app->tform->getAuthSQL('r'));
-
-		// Check if Domain belongs to user
-		if($soa["id"] != $_POST["zone"]) $app->tform->errorMessage .= $app->tform->wordbook["no_zone_perm"];
-		
-		// Check the client limits, if user is not the admin
-		if($_SESSION["s"]["user"]["typ"] != 'admin') { // if user is not admin
-			// Get the limits of the client
-			$client_group_id = $_SESSION["s"]["user"]["default_group"];
-			$client = $app->db->queryOneRecord("SELECT limit_dns_record FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
-			
-			// Check if the user may add another mailbox.
-			if($this->id == 0 && $client["limit_dns_record"] >= 0) {
-				$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
-				if($tmp["number"] >= $client["limit_dns_record"]) {
-					$app->error($app->tform->wordbook["limit_dns_record_txt"]);
-				}
-			}
-		} // end if user is not admin
-		
-		
-		// Set the server ID of the rr record to the same server ID as the parent record.
-		$this->dataRecord["server_id"] = $soa["server_id"];
-		
-		parent::onSubmit();
-	}
-	
-	function onAfterInsert() {
-		global $app, $conf;
-		
-		// Set the sys_groupid of the rr record to be the same then the sys_groupid of the soa record
-		$soa = $app->db->queryOneRecord("SELECT sys_groupid FROM dns_soa WHERE id = '".intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r'));
-		$app->db->query("UPDATE dns_rr SET sys_groupid = ".$soa['sys_groupid']." WHERE id = ".$this->id);
-
-		// Update the serial number of the SOA record
-		$soa_id = intval($_POST["zone"]);
-		$serial = $app->validate_dns->increase_serial($soa["serial"]);
-		$app->db->query("UPDATE dns_soa SET serial = $serial WHERE id = $soa_id");
-		
-	}
-	
-	function onAfterUpdate() {
-		global $app, $conf;
-		
-		// Update the serial number of the SOA record
-		$soa = $app->db->queryOneRecord("SELECT serial FROM dns_soa WHERE id = '".intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r'));
-		$soa_id = intval($_POST["zone"]);
-		$serial = $app->validate_dns->increase_serial($soa["serial"]);
-		$app->db->query("UPDATE dns_soa SET serial = $serial WHERE id = $soa_id");
-	}
-}
-
-$page = new page_action;
-$page->onLoad();
-
+<?php
+
+/*
+Copyright (c) 2007, Till Brehm, projektfarm Gmbh
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice,
+      this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright notice,
+      this list of conditions and the following disclaimer in the documentation
+      and/or other materials provided with the distribution.
+    * Neither the name of ISPConfig nor the names of its contributors
+      may be used to endorse or promote products derived from this software without
+      specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/******************************************
+* Begin Form configuration
+******************************************/
+
+$tform_def_file = "form/dns_srv.tform.php";
+
+/******************************************
+* End Form configuration
+******************************************/
+
+require_once('../../lib/config.inc.php');
+require_once('../../lib/app.inc.php');
+
+//* Check permissions for module
+$app->auth->check_module_permissions('dns');
+
+// Loading classes
+$app->uses('tpl,tform,tform_actions,validate_dns');
+$app->load('tform_actions');
+
+class page_action extends tform_actions {
+	
+	function onShowNew() {
+		global $app, $conf;
+		
+		// we will check only users, not admins
+		if($_SESSION["s"]["user"]["typ"] == 'user') {
+			
+			// Get the limits of the client
+			$client_group_id = $_SESSION["s"]["user"]["default_group"];
+			$client = $app->db->queryOneRecord("SELECT limit_dns_record FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
+			
+			// Check if the user may add another mailbox.
+			if($client["limit_dns_record"] >= 0) {
+				$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
+				if($tmp["number"] >= $client["limit_dns_record"]) {
+					$app->error($app->tform->wordbook["limit_dns_record_txt"]);
+				}
+			}
+		}
+		
+		parent::onShowNew();
+	}
+	
+	function onSubmit() {
+		global $app, $conf;
+		
+		// Get the parent soa record of the domain
+		$soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = '".intval($_POST["zone"])."' AND ".$app->tform->getAuthSQL('r'));
+
+		// Check if Domain belongs to user
+		if($soa["id"] != $_POST["zone"]) $app->tform->errorMessage .= $app->tform->wordbook["no_zone_perm"];
+		
+		// Check the client limits, if user is not the admin
+		if($_SESSION["s"]["user"]["typ"] != 'admin') { // if user is not admin
+			// Get the limits of the client
+			$client_group_id = $_SESSION["s"]["user"]["default_group"];
+			$client = $app->db->queryOneRecord("SELECT limit_dns_record FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
+			
+			// Check if the user may add another mailbox.
+			if($this->id == 0 && $client["limit_dns_record"] >= 0) {
+				$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
+				if($tmp["number"] >= $client["limit_dns_record"]) {
+					$app->error($app->tform->wordbook["limit_dns_record_txt"]);
+				}
+			}
+		} // end if user is not admin
+		
+		
+		// Set the server ID of the rr record to the same server ID as the parent record.
+		$this->dataRecord["server_id"] = $soa["server_id"];
+		
+		parent::onSubmit();
+	}
+	
+	function onAfterInsert() {
+		global $app, $conf;
+		
+		//* Set the sys_groupid of the rr record to be the same then the sys_groupid of the soa record
+		$soa = $app->db->queryOneRecord("SELECT sys_groupid FROM dns_soa WHERE id = '".intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r'));
+		$app->db->datalogUpdate('dns_rr', "sys_groupid = ".$soa['sys_groupid'], 'id', $this->id);
+
+		//* Update the serial number of the SOA record
+		$soa_id = intval($_POST["zone"]);
+		$serial = $app->validate_dns->increase_serial($soa["serial"]);
+		$app->db->datalogUpdate('dns_soa', "serial = $serial", 'id', $soa_id);
+	}
+	
+	function onAfterUpdate() {
+		global $app, $conf;
+		
+		//* Update the serial number of the SOA record
+		$soa = $app->db->queryOneRecord("SELECT serial FROM dns_soa WHERE id = '".intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r'));
+		$soa_id = intval($_POST["zone"]);
+		$serial = $app->validate_dns->increase_serial($soa["serial"]);
+		$app->db->datalogUpdate('dns_soa', "serial = $serial", 'id', $soa_id);
+	}
+}
+
+$page = new page_action;
+$page->onLoad();
+
 ?>
\ No newline at end of file
diff --git a/interface/web/dns/dns_txt_edit.php b/interface/web/dns/dns_txt_edit.php
index 4a4ecadd2077296433d048c58e96eaf359d51ed9..920fb3f519a208eebfd65d9bf442d001b18f6400 100644
--- a/interface/web/dns/dns_txt_edit.php
+++ b/interface/web/dns/dns_txt_edit.php
@@ -1,134 +1,133 @@
-<?php
-
-/*
-Copyright (c) 2007, Till Brehm, projektfarm Gmbh
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
-
-    * Redistributions of source code must retain the above copyright notice,
-      this list of conditions and the following disclaimer.
-    * Redistributions in binary form must reproduce the above copyright notice,
-      this list of conditions and the following disclaimer in the documentation
-      and/or other materials provided with the distribution.
-    * Neither the name of ISPConfig nor the names of its contributors
-      may be used to endorse or promote products derived from this software without
-      specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/******************************************
-* Begin Form configuration
-******************************************/
-
-$tform_def_file = "form/dns_txt.tform.php";
-
-/******************************************
-* End Form configuration
-******************************************/
-
-require_once('../../lib/config.inc.php');
-require_once('../../lib/app.inc.php');
-
-//* Check permissions for module
-$app->auth->check_module_permissions('dns');
-
-// Loading classes
-$app->uses('tpl,tform,tform_actions,validate_dns');
-$app->load('tform_actions');
-
-class page_action extends tform_actions {
-	
-	function onShowNew() {
-		global $app, $conf;
-		
-		// we will check only users, not admins
-		if($_SESSION["s"]["user"]["typ"] == 'user') {
-			
-			// Get the limits of the client
-			$client_group_id = $_SESSION["s"]["user"]["default_group"];
-			$client = $app->db->queryOneRecord("SELECT limit_dns_record FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
-			
-			// Check if the user may add another mailbox.
-			if($client["limit_dns_record"] >= 0) {
-				$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
-				if($tmp["number"] >= $client["limit_dns_record"]) {
-					$app->error($app->tform->wordbook["limit_dns_record_txt"]);
-				}
-			}
-		}
-		
-		parent::onShowNew();
-	}
-	
-	function onSubmit() {
-		global $app, $conf;
-		
-		// Get the parent soa record of the domain
-		$soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = '".intval($_POST["zone"])."' AND ".$app->tform->getAuthSQL('r'));
-
-		// Check if Domain belongs to user
-		if($soa["id"] != $_POST["zone"]) $app->tform->errorMessage .= $app->tform->wordbook["no_zone_perm"];
-		
-		// Check the client limits, if user is not the admin
-		if($_SESSION["s"]["user"]["typ"] != 'admin') { // if user is not admin
-			// Get the limits of the client
-			$client_group_id = $_SESSION["s"]["user"]["default_group"];
-			$client = $app->db->queryOneRecord("SELECT limit_dns_record FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
-			
-			// Check if the user may add another mailbox.
-			if($this->id == 0 && $client["limit_dns_record"] >= 0) {
-				$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
-				if($tmp["number"] >= $client["limit_dns_record"]) {
-					$app->error($app->tform->wordbook["limit_dns_record_txt"]);
-				}
-			}
-		} // end if user is not admin
-		
-		
-		// Set the server ID of the rr record to the same server ID as the parent record.
-		$this->dataRecord["server_id"] = $soa["server_id"];
-		
-		parent::onSubmit();
-	}
-	
-	function onAfterInsert() {
-		global $app, $conf;
-		
-		// Set the sys_groupid of the rr record to be the same then the sys_groupid of the soa record
-		$soa = $app->db->queryOneRecord("SELECT sys_groupid FROM dns_soa WHERE id = '".intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r'));
-		$app->db->query("UPDATE dns_rr SET sys_groupid = ".$soa['sys_groupid']." WHERE id = ".$this->id);
-
-		// Update the serial number of the SOA record
-		$soa_id = intval($_POST["zone"]);
-		$serial = $app->validate_dns->increase_serial($soa["serial"]);
-		$app->db->query("UPDATE dns_soa SET serial = $serial WHERE id = $soa_id");
-		
-	}
-	
-	function onAfterUpdate() {
-		global $app, $conf;
-		
-		// Update the serial number of the SOA record
-		$soa = $app->db->queryOneRecord("SELECT serial FROM dns_soa WHERE id = '".intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r'));
-		$soa_id = intval($_POST["zone"]);
-		$serial = $app->validate_dns->increase_serial($soa["serial"]);
-		$app->db->query("UPDATE dns_soa SET serial = $serial WHERE id = $soa_id");
-	}
-}
-
-$page = new page_action;
-$page->onLoad();
-
+<?php
+
+/*
+Copyright (c) 2007, Till Brehm, projektfarm Gmbh
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice,
+      this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright notice,
+      this list of conditions and the following disclaimer in the documentation
+      and/or other materials provided with the distribution.
+    * Neither the name of ISPConfig nor the names of its contributors
+      may be used to endorse or promote products derived from this software without
+      specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/******************************************
+* Begin Form configuration
+******************************************/
+
+$tform_def_file = "form/dns_txt.tform.php";
+
+/******************************************
+* End Form configuration
+******************************************/
+
+require_once('../../lib/config.inc.php');
+require_once('../../lib/app.inc.php');
+
+//* Check permissions for module
+$app->auth->check_module_permissions('dns');
+
+// Loading classes
+$app->uses('tpl,tform,tform_actions,validate_dns');
+$app->load('tform_actions');
+
+class page_action extends tform_actions {
+	
+	function onShowNew() {
+		global $app, $conf;
+		
+		// we will check only users, not admins
+		if($_SESSION["s"]["user"]["typ"] == 'user') {
+			
+			// Get the limits of the client
+			$client_group_id = $_SESSION["s"]["user"]["default_group"];
+			$client = $app->db->queryOneRecord("SELECT limit_dns_record FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
+			
+			// Check if the user may add another mailbox.
+			if($client["limit_dns_record"] >= 0) {
+				$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
+				if($tmp["number"] >= $client["limit_dns_record"]) {
+					$app->error($app->tform->wordbook["limit_dns_record_txt"]);
+				}
+			}
+		}
+		
+		parent::onShowNew();
+	}
+	
+	function onSubmit() {
+		global $app, $conf;
+		
+		// Get the parent soa record of the domain
+		$soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = '".intval($_POST["zone"])."' AND ".$app->tform->getAuthSQL('r'));
+
+		// Check if Domain belongs to user
+		if($soa["id"] != $_POST["zone"]) $app->tform->errorMessage .= $app->tform->wordbook["no_zone_perm"];
+		
+		// Check the client limits, if user is not the admin
+		if($_SESSION["s"]["user"]["typ"] != 'admin') { // if user is not admin
+			// Get the limits of the client
+			$client_group_id = $_SESSION["s"]["user"]["default_group"];
+			$client = $app->db->queryOneRecord("SELECT limit_dns_record FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
+			
+			// Check if the user may add another mailbox.
+			if($this->id == 0 && $client["limit_dns_record"] >= 0) {
+				$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
+				if($tmp["number"] >= $client["limit_dns_record"]) {
+					$app->error($app->tform->wordbook["limit_dns_record_txt"]);
+				}
+			}
+		} // end if user is not admin
+		
+		
+		// Set the server ID of the rr record to the same server ID as the parent record.
+		$this->dataRecord["server_id"] = $soa["server_id"];
+		
+		parent::onSubmit();
+	}
+	
+	function onAfterInsert() {
+		global $app, $conf;
+		
+		//* Set the sys_groupid of the rr record to be the same then the sys_groupid of the soa record
+		$soa = $app->db->queryOneRecord("SELECT sys_groupid FROM dns_soa WHERE id = '".intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r'));
+		$app->db->datalogUpdate('dns_rr', "sys_groupid = ".$soa['sys_groupid'], 'id', $this->id);
+
+		//* Update the serial number of the SOA record
+		$soa_id = intval($_POST["zone"]);
+		$serial = $app->validate_dns->increase_serial($soa["serial"]);
+		$app->db->datalogUpdate('dns_soa', "serial = $serial", 'id', $soa_id);
+	}
+	
+	function onAfterUpdate() {
+		global $app, $conf;
+		
+		//* Update the serial number of the SOA record
+		$soa = $app->db->queryOneRecord("SELECT serial FROM dns_soa WHERE id = '".intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r'));
+		$soa_id = intval($_POST["zone"]);
+		$serial = $app->validate_dns->increase_serial($soa["serial"]);
+		$app->db->datalogUpdate('dns_soa', "serial = $serial", 'id', $soa_id);
+	}
+}
+
+$page = new page_action;
+$page->onLoad();
+
 ?>
\ No newline at end of file