From 2e961201be67cc348e7da22ad7c32c87c9f3d30d Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Tue, 11 May 2010 07:00:08 -0400
Subject: [PATCH] Fixed: FS#1186 - Error in Installer r1728

---
 interface/lib/classes/remoting.inc.php |   35 +++++++++++++++++++++++++++++------
 1 files changed, 29 insertions(+), 6 deletions(-)

diff --git a/interface/lib/classes/remoting.inc.php b/interface/lib/classes/remoting.inc.php
index 8aeabc3..8166002 100644
--- a/interface/lib/classes/remoting.inc.php
+++ b/interface/lib/classes/remoting.inc.php
@@ -893,6 +893,26 @@
 		return $app->remoting_lib->getDataRecord($client_id);
 	}
 	
+	public function client_get_id($session_id, $sys_userid)
+    {
+		global $app;
+		if(!$this->checkPerm($session_id, 'client_get')) {
+			$this->server->fault('permission_denied', 'You do not have the permissions to access this function.');
+			return false;
+		}
+		
+		$sys_userid = intval($sys_userid);
+		
+		$rec = $app->db->queryOneRecord("SELECT client_id FROM sys_user WHERE userid = ".$sys_userid);
+		if(isset($rec['client_id'])) {
+			return intval($rec['client_id']);
+		} else {
+			$this->server->fault('no_client_found', 'There is no sysuser account for this client ID.');
+			return false;
+		}
+		
+	}
+	
 	
 	public function client_add($session_id, $reseller_id, $params)
 	{
@@ -1922,11 +1942,11 @@
 		
 		$app->uses('remoting_lib');
 		
-		//* Load the form definition
-		$app->remoting_lib->loadFormDef($formdef_file);
-		
 		//* load the user profile of the client
 		$app->remoting_lib->loadUserProfile($client_id);
+		
+		//* Load the form definition
+		$app->remoting_lib->loadFormDef($formdef_file);
 		
 		//* Get the SQL query
 		$sql = $app->remoting_lib->getSQL($params,'INSERT',0);
@@ -1969,11 +1989,11 @@
 		
 		$app->uses('remoting_lib');
 		
-		//* Load the form definition
-		$app->remoting_lib->loadFormDef($formdef_file);
-		
 		//* load the user profile of the client
 		$app->remoting_lib->loadUserProfile($client_id);
+		
+		//* Load the form definition
+		$app->remoting_lib->loadFormDef($formdef_file);
 		
 		//* Get the SQL query
 		$sql = $app->remoting_lib->getSQL($params,'UPDATE',$primary_id);
@@ -2016,6 +2036,9 @@
 		
 		$app->uses('remoting_lib');
 		
+		//* load the user profile of the client
+		$app->remoting_lib->loadUserProfile($client_id);
+		
 		//* Load the form definition
 		$app->remoting_lib->loadFormDef($formdef_file);
 		

--
Gitblit v1.9.1