From 9e5a1137350361387168dd6bb1598f0a3df84c19 Mon Sep 17 00:00:00 2001
From: Marius Cramer <m.cramer@pixcept.de>
Date: Wed, 15 Apr 2015 09:27:58 -0400
Subject: [PATCH] - ported some patches

---
 interface/lib/classes/remote.d/client.inc.php |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/interface/lib/classes/remote.d/client.inc.php b/interface/lib/classes/remote.d/client.inc.php
index 2fb4363..d1c7532 100644
--- a/interface/lib/classes/remote.d/client.inc.php
+++ b/interface/lib/classes/remote.d/client.inc.php
@@ -476,6 +476,27 @@
 			return false;
 		}
 	}
+	
+	public function client_get_by_customer_no($session_id, $customer_no) {
+		global $app;
+		if(!$this->checkPerm($session_id, 'client_get_by_customer_no')) {
+			throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
+			return false;
+		}
+		$customer_no = trim($customer_no);
+		if($customer_no == '') {
+			throw new SoapFault('permission_denied', 'There was no customer number specified.');
+			return false;
+		}
+		$customer_no = $app->db->quote($customer_no);
+		$rec = $app->db->queryOneRecord("SELECT * FROM client WHERE customer_no = '".$customer_no."'");
+		if (isset($rec)) {
+			return $rec;
+		} else {
+			throw new SoapFault('no_client_found', 'There is no user account for this customer number.');
+			return false;
+		}
+	}
 
 	/**
 	 * Get All client_id's from database

--
Gitblit v1.9.1