From 8e23f2edc1af1b0d998bf2387520caada0edafe5 Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Mon, 06 Aug 2007 05:32:44 -0400
Subject: [PATCH] Update dns/dns_soa_edit.php

---
 interface/web/dns/dns_soa_edit.php |   40 +++++++++++++++++++++-------------------
 1 files changed, 21 insertions(+), 19 deletions(-)

diff --git a/interface/web/dns/dns_soa_edit.php b/interface/web/dns/dns_soa_edit.php
index f78e9aa..de3cb6d 100644
--- a/interface/web/dns/dns_soa_edit.php
+++ b/interface/web/dns/dns_soa_edit.php
@@ -99,26 +99,28 @@
 	function onSubmit() {
 		global $app, $conf;
 		
-		// Get the limits of the client
-		$client_group_id = $_SESSION["s"]["user"]["default_group"];
-		$client = $app->db->queryOneRecord("SELECT limit_dns_zone, default_dnsserver FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
-			
-		// When the record is updated
-		if($this->id > 0) {
-			// restore the server ID if the user is not admin and record is edited
-			$tmp = $app->db->queryOneRecord("SELECT server_id FROM dns_soa WHERE id = ".intval($this->id));
-			$this->dataRecord["server_id"] = $tmp["server_id"];
-			unset($tmp);
-		// When the record is inserted
-		} else {
-			// set the server ID to the default mailserver of the client
-			$this->dataRecord["server_id"] = $client["default_dnsserver"];
+		if($_SESSION["s"]["user"]["typ"] != 'admin') {
+			// Get the limits of the client
+			$client_group_id = $_SESSION["s"]["user"]["default_group"];
+			$client = $app->db->queryOneRecord("SELECT limit_dns_zone, default_dnsserver FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
+		
+			// When the record is updated
+			if($this->id > 0) {
+				// restore the server ID if the user is not admin and record is edited
+				$tmp = $app->db->queryOneRecord("SELECT server_id FROM dns_soa WHERE id = ".intval($this->id));
+				$this->dataRecord["server_id"] = $tmp["server_id"];
+				unset($tmp);
+			// When the record is inserted
+			} else {
+				// set the server ID to the default mailserver of the client
+				$this->dataRecord["server_id"] = $client["default_dnsserver"];
 				
-			// Check if the user may add another maildomain.
-			if($client["limit_dns_zone"] >= 0) {
-				$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_soa WHERE sys_groupid = $client_group_id");
-				if($tmp["number"] >= $client["limit_dns_zone"]) {
-					$app->error($app->tform->wordbook["limit_dns_zone_txt"]);
+				// Check if the user may add another maildomain.
+				if($client["limit_dns_zone"] >= 0) {
+					$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_soa WHERE sys_groupid = $client_group_id");
+					if($tmp["number"] >= $client["limit_dns_zone"]) {
+						$app->error($app->tform->wordbook["limit_dns_zone_txt"]);
+					}
 				}
 			}
 		}

--
Gitblit v1.9.1