From 721fb2a75314cce1ea893cc2dc4e680dee28d5c0 Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Tue, 11 Aug 2009 15:25:30 +0000
Subject: [PATCH] Fixed: FS#828 - DNS Zones created by resellers from
 template/Wizard not linked to the client

---
 interface/web/dns/dns_wizard.php | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/interface/web/dns/dns_wizard.php b/interface/web/dns/dns_wizard.php
index 02e1ccd873..61d6bb6eee 100644
--- a/interface/web/dns/dns_wizard.php
+++ b/interface/web/dns/dns_wizard.php
@@ -137,6 +137,15 @@ if($_POST['create'] == 1) {
 	if(isset($_POST['ns2']) && $_POST['ns2'] == '') $error .= $app->lng('error_ns2_empty').'<br />';
 	if(isset($_POST['email']) && $_POST['email'] == '') $error .= $app->lng('error_email_empty').'<br />';
 	
+	// make sure that the record belongs to the clinet group and not the admin group when a dmin inserts it
+	if($_SESSION["s"]["user"]["typ"] == 'admin' && isset($_POST['client_group_id'])) {
+		$sys_groupid = intval($_POST['client_group_id']);
+	} elseif($app->auth->has_clients($_SESSION['s']['user']['userid']) && isset($_POST['client_group_id'])) {
+		$sys_groupid = intval($_POST['client_group_id']);
+	} else {
+		$sys_groupid = $_SESSION["s"]["user"]["default_group"];
+	}
+	
 	$tform_def_file = "form/dns_soa.tform.php";
 	$app->uses('tform');
 	$app->tform->loadFormDef($tform_def_file);
-- 
GitLab