示例#1
0
 function fetchMember($member_id)
 {
     if ($this->account_id == $member_id) {
         return $this;
     }
     $ma_url = get_first_service_of_type(SR_SERVICE_TYPE::MEMBER_AUTHORITY);
     $member = ma_lookup_member_by_id($ma_url, $this, $member_id);
     $user = new GeniUser();
     $user->init_from_member($member);
     return $user;
 }
function get_all_members_of_slice_as_users($sa_url, $ma_url, $user, $slice_id)
{
    // Get other users on this project
    $members = get_slice_members($sa_url, $user, $slice_id);
    //error_log("Return from get_slice_members = " . print_r($members, TRUE));
    $member_uuids = array();
    foreach ($members as $member) {
        $member_id = $member[MA_ARGUMENT::MEMBER_ID];
        // In Future consider FILTER by ROLE?
        //	$role_id = $member[ 'role' ]; // FIND VARIABLE TO REPLACE
        $member_uuids[] = $member_id;
    }
    $slice_members = lookup_member_details($ma_url, $user, $member_uuids);
    //error_log("Slice members = " . print_r($slice_members, TRUE));
    $slice_users = array();
    foreach ($slice_members as $member_id => $slice_member) {
        // initialize members
        $member = new Member();
        $member->init_from_record($slice_member);
        //error_log("Member = " . print_r($member, TRUE));
        // now as users
        $slice_user = new GeniUser();
        $slice_user->init_from_member($member);
        //	error_log("Slice user = "******"Slice users = " . print_r($slice_users, TRUE));
    return $slice_users;
}