From 37b29231e47a0c4458dc1c15d98588f16f07e1e2 Mon Sep 17 00:00:00 2001
From: Marius Cramer <m.cramer@pixcept.de>
Date: Thu, 06 Aug 2015 03:18:44 -0400
Subject: [PATCH] - don't set password via remoting if field is empty

---
 interface/web/client/reseller_del.php |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/interface/web/client/reseller_del.php b/interface/web/client/reseller_del.php
index e9d1dd3..55872be 100644
--- a/interface/web/client/reseller_del.php
+++ b/interface/web/client/reseller_del.php
@@ -59,7 +59,7 @@
 
 		$client_id = $app->functions->intval($this->dataRecord['client_id']);
 
-		$tmp = $app->db->queryOneRecord("SELECT count(client_id) as number FROM client WHERE parent_client_id = ".$client_id);
+		$tmp = $app->db->queryOneRecord("SELECT count(client_id) as number FROM client WHERE parent_client_id = ?", $client_id);
 		if($tmp["number"] > 0) $app->error($app->lng('error_has_clients'));
 
 	}
@@ -74,15 +74,15 @@
 
 			// remove the group of the client from the resellers group
 			$parent_client_id = $app->functions->intval($this->dataRecord['parent_client_id']);
-			$parent_user = $app->db->queryOneRecord("SELECT userid FROM sys_user WHERE client_id = $parent_client_id");
-			$client_group = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = $client_id");
+			$parent_user = $app->db->queryOneRecord("SELECT userid FROM sys_user WHERE client_id = ?", $parent_client_id);
+			$client_group = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = ?", $client_id);
 			$app->auth->remove_group_from_user($parent_user['userid'], $client_group['groupid']);
 
 			// delete the group of the client
-			$app->db->query("DELETE FROM sys_group WHERE client_id = $client_id");
+			$app->db->query("DELETE FROM sys_group WHERE client_id = ?", $client_id);
 
 			// delete the sys user(s) of the client
-			$app->db->query("DELETE FROM sys_user WHERE client_id = $client_id");
+			$app->db->query("DELETE FROM sys_user WHERE client_id = ?", $client_id);
 		}
 
 	}

--
Gitblit v1.9.1