Beispiel #1
0
 public function findOnlineList($first, $count)
 {
     $onlineList = $this->userDao->findOnlineList($first, $count);
     $list = array();
     $userIdList = array();
     foreach ($onlineList as $id => $user) {
         $userIdList[] = $user->id;
     }
     // Check privacy permissions
     $eventParams = array('action' => 'base_view_my_presence_on_site', 'ownerIdList' => $userIdList, 'viewerId' => OW::getUser()->getId());
     $permission = OW::getEventManager()->getInstance()->call('privacy_check_permission_for_user_list', $eventParams);
     foreach ($onlineList as $user) {
         $show = true;
         if (isset($permission[$user->id]['blocked']) && $permission[$user->id]['blocked'] == true) {
             $show = false;
             continue;
         }
         if ($show) {
             $list[] = $user;
         }
     }
     return $list;
 }