Skip to content

Commit e0db878

Browse files
author
chjacobsen
committed
Adding a new client remotelly, it was not been associated to the proper reseller.
1 parent d5132ba commit e0db878

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

interface/lib/classes/remoting.inc.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2004,6 +2004,14 @@ private function klientadd($formdef_file, $reseller_id, $params)
20042004
$new_rec = $app->remoting_lib->getDataRecord($insert_id);
20052005
$app->remoting_lib->datalogSave('INSERT',$primary_id,array(),$new_rec);
20062006
$app->remoting_lib->ispconfig_sysuser_add($params,$insert_id);
2007+
2008+
if($reseller_id) {
2009+
$client_group = $app->db->queryOneRecord("SELECT * FROM sys_group WHERE client_id = ".$insert_id);
2010+
$reseller_user = $app->db->queryOneRecord("SELECT * FROM sys_user WHERE client_id = ".$reseller_id);
2011+
$app->auth->add_group_to_user($reseller_user['userid'], $client_group['groupid']);
2012+
$app->db->query("UPDATE client SET parent_client_id = ".$reseller_id." WHERE client_id = ".$insert_id);
2013+
}
2014+
20072015
}
20082016
return $insert_id;
20092017
}

0 commit comments

Comments
 (0)