From 3b09eb9e89694ccbd9d22a1dd91a4811e870b1e2 Mon Sep 17 00:00:00 2001
From: Falko Timme <ft@falkotimme.com>
Date: Thu, 22 Jan 2015 05:45:09 -0500
Subject: [PATCH] - moved SQL query into if container.

---
 interface/lib/classes/remoting.inc.php |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/interface/lib/classes/remoting.inc.php b/interface/lib/classes/remoting.inc.php
index 0ccfd65..b47d9cf 100644
--- a/interface/lib/classes/remoting.inc.php
+++ b/interface/lib/classes/remoting.inc.php
@@ -1426,7 +1426,7 @@
 		
 		if($params['parent_client_id']) {
 			// check if this one is reseller
-			$check = $app->db->queryOneRecord('SELECT `limit_client` FROM `client` WHERE `client_id` = ' . intval($client_id));
+			$check = $app->db->queryOneRecord('SELECT `limit_client` FROM `client` WHERE `client_id` = ' . intval($params['parent_client_id']));
 			if($check['limit_client'] == 0) {
 				$this->server->fault('Invalid reseller', 'Selected client is not a reseller.');
 				return false;
@@ -1461,7 +1461,7 @@
 
 		if($params['parent_client_id']) {
 			// check if this one is reseller
-			$check = $app->db->queryOneRecord('SELECT `limit_client` FROM `client` WHERE `client_id` = ' . intval($client_id));
+			$check = $app->db->queryOneRecord('SELECT `limit_client` FROM `client` WHERE `client_id` = ' . intval($params['parent_client_id']));
 			if($check['limit_client'] == 0) {
 				$this->server->fault('Invalid reseller', 'Selected client is not a reseller.');
 				return false;

--
Gitblit v1.9.1