/** * Get access data for a user to be displayed in user management window */ public function getAccessData($user_id = false) { if (!User::isVerified()) { return array('success' => false, 'verify' => true); } if (!Security::canManage()) { throw new \Exception(L\get('Access_denied')); } $user_id = $this->extractId($user_id); $rez = $this->getUserData(array('data' => array('id' => $user_id))); $rez['data']['groups'] = array(); $res = DB\dbQuery('SELECT a.group_id FROM users_groups_association a WHERE user_id = $1', $user_id) or die(DB\dbQueryError()); while ($r = $res->fetch_assoc()) { $rez['data']['groups'][] = $r['group_id']; } $res->close(); //set tsv status $tsv = User::getTSVConfig($user_id); $rez['data']['tsv'] = empty($tsv['method']) ? 'none' : L\get('TSV_' . $tsv['method']); return $rez; }