$old_client=$app->db->queryOneRecord("SELECT client.client_id, client.parent_client_id FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?",$old_client_group_id);
/* this is the reseller, that shall be re-logged in */
$sql="SELECT * FROM sys_user WHERE USERNAME = ? and PASSWORT = ?";
$tmp_client=$app->db->queryOneRecord("SELECT client.client_id FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?",$client_group_id);
$res_client=$app->db->queryOneRecord("SELECT client.client_id FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?",$res_client_group_id);
/* this is the user the reseller wants to 'login as' */
$sql="SELECT * FROM sys_user WHERE USERNAME = ? and PASSWORT = ?";
$tmp_client=$app->db->queryOneRecord("SELECT client.client_id, client.parent_client_id FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?",$tmp["default_group"]);
$old_client=$app->db->queryOneRecord("SELECT client.client_id, client.parent_client_id FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?",$old_client_group_id);
/* this is the reseller, that shall be re-logged in */
$sql="SELECT * FROM sys_user WHERE USERNAME = ? and PASSWORT = ?";
$tmp_client=$app->db->queryOneRecord("SELECT client.client_id FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?",$client_group_id);
$res_client=$app->db->queryOneRecord("SELECT client.client_id FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?",$res_client_group_id);
/* this is the user the reseller wants to 'login as' */
$sql="SELECT * FROM sys_user WHERE USERNAME = ? and PASSWORT = ?";
$tmp_client=$app->db->queryOneRecord("SELECT client.client_id, client.parent_client_id FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?",$tmp["default_group"]);