function get_members()
 {
     $member_ids = json_decode(array_var($_REQUEST, 'member_ids', null));
     if (!is_array($member_ids)) {
         $member_ids = null;
     } else {
         $all_members = array();
         $all_members_ids = array();
         foreach ($member_ids as $m) {
             if (function_exists('logged_user') && logged_user() instanceof Contact && ContactMemberPermissions::contactCanAccessMemberAll(implode(',', logged_user()->getPermissionGroupIds()), $m, logged_user(), ACCESS_LEVEL_READ)) {
                 $mem = Members::getMemberById($m);
                 if ($mem instanceof Member) {
                     $parents = $mem->getAllParentMembersInHierarchy(true);
                     $all_members[] = $this->buildMemberList($parents, $mem->getDimension(), null, null, null, null);
                 }
             }
         }
         ajx_extra_data(array("members" => $all_members));
     }
     ajx_current("empty");
 }
Example #2
0
 function canBeReadByContact($permission_group_ids, $user)
 {
     return ContactMemberPermissions::contactCanAccessMemberAll($permission_group_ids, $this->getId(), $user, ACCESS_LEVEL_READ);
 }