Skip to content

Commit 4a34e61

Browse files
author
Marius Burkard
committed
- handle insertion of client with invalid parent id
1 parent 7ae982f commit 4a34e61

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

interface/lib/classes/remote.d/client.inc.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,11 +171,9 @@ public function client_add($session_id, $reseller_id, $params)
171171
// check if this one is reseller
172172
$check = $app->db->queryOneRecord('SELECT `limit_client` FROM `client` WHERE `client_id` = ?', intval($params['parent_client_id']));
173173
if($check['limit_client'] == 0) {
174-
throw new SoapFault('Invalid reseller', 'Selected client is not a reseller.');
175-
return false;
176-
}
177-
178-
if(isset($params['limit_client']) && $params['limit_client'] != 0) {
174+
throw new SoapFault('Invalid reseller', 'Selected client is not a reseller. REMOVING PARENT_CLIENT_ID!!!');
175+
$params['parent_client_id'] = 0;
176+
} elseif(isset($params['limit_client']) && $params['limit_client'] != 0) {
179177
throw new SoapFault('Invalid reseller', 'Reseller cannot be client of another reseller.');
180178
return false;
181179
}

0 commit comments

Comments
 (0)