public function get($userid = null) { if (empty($userid)) { $userid = $this->id; } $grm = new groupsModel(); $sql = 'SELECT groupid FROM pfmuser_group WHERE userid=' . $userid; if ($GLOBALS['conf']->db_debug) { print $sql . '<br />'; } $ds = $grm->rawQuery($sql); $resp = array(); while ($row = mysqli_fetch_object($ds)) { $resp[] = $this->groups[] = $grm->get($row->groupid); } $user = parent::get($userid); $user->groups = $this->groups; return $user; }
public function get($groupid = null) { $this->credentials = array(); if (empty($groupid)) { $groupid = $this->id; } $cred = new credentialModel(); $ds = $cred->rawQuery('select credential from pfm_group_credential where groupid=' . $groupid); $rs = array(); while ($row = mysqli_fetch_object($ds)) { $rs[] = $row->credential; } foreach ($rs as $row) { $cds = $cred->get($row); $this->credentials[] = $cds->name; } $group = parent::get($groupid); $group->credentials = $this->credentials; return $group; }