function search_for_users($term, $search_type, $signer, $ma_url) { if ($search_type == "email") { $results = lookup_members_by_email($ma_url, $signer, array($term)); return $results[$term]; } else { if ($search_type == "lastname") { $searchkey = "MEMBER_LASTNAME"; } else { $searchkey = "MEMBER_USERNAME"; } $results = ma_lookup_members_by_identifying($ma_url, $signer, $searchkey, $term); $ids = array(); foreach ($results as $member) { $ids[] = $member->member_id; } return $ids; } }
function fetchMembersNoIdentity($member_ids) { $members = array(); $ma_url = get_first_service_of_type(SR_SERVICE_TYPE::MEMBER_AUTHORITY); $other_member_ids = array(); foreach ($member_ids as $member_id) { if ($member_id != $this->account_id) { $other_member_ids[] = $member_id; } else { $members[] = $this->ma_member; } } $other_members = ma_lookup_members_by_identifying($ma_url, $this, 'MEMBER_UID', $other_member_ids); $members = array_merge($members, $other_members); return $members; }
function ma_lookup_member_by_id($ma_url, $signer, $member_id) { $res = ma_lookup_members_by_identifying($ma_url, $signer, 'MEMBER_UID', $member_id); if (count($res) > 0) { return $res[0]; } else { return null; } }