has("accounts", ['uid' => $VARS['uid']])) { $empid = $VARS['uid']; } else { sendJsonResp($Strings->get("user does not exist", false), "ERROR"); } } else if (!empty($VARS['username'])) { if ($database->has("accounts", ['username' => strtolower($VARS['username'])])) { $empid = $database->select('accounts', 'uid', ['username' => strtolower($VARS['username'])]); } else { sendJsonResp($Strings->get("user does not exist", false), "ERROR"); } } $groups = $database->select('assigned_groups', ["[>]groups" => ["groupid" => "groupid"]], ['groups.groupid (id)', 'groups.groupname (name)'], ['uid' => $empid]); exitWithJson(["status" => "OK", "groups" => $groups]);