From 35cc408f854e410452ef637d79fb68157049efdf Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Thu, 2 Sep 2010 14:35:07 +0000
Subject: [PATCH] Implemented client template support in remoting API: FS#1308

---
 interface/lib/classes/remoting.inc.php | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/interface/lib/classes/remoting.inc.php b/interface/lib/classes/remoting.inc.php
index 12534b85d..2309ad944 100644
--- a/interface/lib/classes/remoting.inc.php
+++ b/interface/lib/classes/remoting.inc.php
@@ -1922,7 +1922,14 @@ class remoting {
 		$app->remoting_lib->loadFormDef($formdef_file);
 		
 		//* load the user profile of the client
-		$app->remoting_lib->loadUserProfile($reseller_id);		
+		$app->remoting_lib->loadUserProfile($reseller_id);
+		
+		//* load the client template
+		if(isset($params['template_master']) and $params['template_master'])
+		{
+			$template=$app->db->queryOneRecord("SELECT * FROM client_template WHERE template_id=".intval($params['template_master']));
+			$params=array_merge($params,$template);
+		}
 		
 		//* Get the SQL query
 		$sql = $app->remoting_lib->getSQL($params,'INSERT',0);
-- 
GitLab