From 31f6ceb52bc4422c8a9a0ed8c6b167b3089bb6a6 Mon Sep 17 00:00:00 2001
From: mcramer <m.cramer@pixcept.de>
Date: Thu, 30 Aug 2012 12:59:31 -0400
Subject: [PATCH] Changed: tools.inc.php removed from different places and converted to class where neccessary Fixed: Subtemplates can now be given on client creation in remoting (i.e. 10/34/21 for multiple addons) Changed: template applying moved to separate class Fixed: force_suexec was not taken from templates

---
 interface/lib/classes/remoting.inc.php |   13 +++----------
 1 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/interface/lib/classes/remoting.inc.php b/interface/lib/classes/remoting.inc.php
index 8efecc8..c89f8ed 100644
--- a/interface/lib/classes/remoting.inc.php
+++ b/interface/lib/classes/remoting.inc.php
@@ -1063,7 +1063,7 @@
 					$this->server->fault('permission_denied','You do not have the permissions to access this function.');
 					return false;
 			}
-		$affected_rows = $this->klientadd('../client/form/client.tform.php',$reseller_id, $params);
+		$affected_rows = $this->klientadd('../client/form/' . ($reseller_id ? 'reseller' : 'client') . '.tform.php',$reseller_id, $params);
 		return $affected_rows;  
 				  
 	}
@@ -1077,7 +1077,7 @@
 					$this->server->fault('permission_denied','You do not have the permissions to access this function.');
 					return false;
 			}
-			$affected_rows = $this->updateQuery('../client/form/client.tform.php', $reseller_id, $client_id, $params);
+			$affected_rows = $this->updateQuery('../client/form/' . ($reseller_id ? 'reseller' : 'client') . '.tform.php', $reseller_id, $client_id, $params);
 			
 			$app->remoting_lib->ispconfig_sysuser_update($params,$client_id);
 			
@@ -2612,13 +2612,6 @@
 		//* load the user profile of the client
 		$app->remoting_lib->loadUserProfile($reseller_id);
 		
-		//* load the client template
-		if(isset($params['template_master']) and $params['template_master'] > 0)
-		{
-			$template=$app->db->queryOneRecord("SELECT * FROM client_template WHERE template_id=".intval($params['template_master']));
-			if(is_array($template)) $params=array_merge($params,$template);
-		}
-		
 		//* Get the SQL query
 		$sql = $app->remoting_lib->getSQL($params,'INSERT',0);
 		
@@ -2647,7 +2640,7 @@
 		$this->id = $insert_id;
 		$this->dataRecord = $params;
 		
-		$app->plugin->raiseEvent('client:client:on_after_insert',$this);
+		$app->plugin->raiseEvent('client:' . ($reseller_id ? 'reseller' : 'client') . ':on_after_insert',$this);
 		
 		/*
 		if($app->db->errorMessage != '') {

--
Gitblit v1.9.1