public function indexAction()
 {
     $dumpUser = new UserModel();
     $this->_helper->allowed('list', $dumpUser);
     $paging = $this->buildPagingList();
     $filter = $this->buildFilterList();
     $userList = $this->_userSrv->listAll($filter, $paging);
     $result = array();
     foreach ($userList as $user) {
         try {
             $this->_helper->allowed('read', $user);
             $user->setPassword(null);
             $result[] = $this->_mapToSdp($user->exportData());
         } catch (ForbiddenException $e) {
             $userList->setCount($userList->getCount() - 1);
         }
     }
     $this->view->user = $result;
 }
 /**
  * Lists all users matching a criteria
  */
 public function indexAction()
 {
     $users = array();
     // Fetch all users
     $options = array();
     $params = $this->getRequest()->getParams();
     if (isset($params['count']) || isset($params['page'])) {
         $paging = array();
         if (isset($params['count'])) {
             $paging['count'] = $params['count'];
             unset($params['count']);
         }
         if (isset($params['page'])) {
             $paging['page'] = $params['page'];
             unset($params['page']);
         }
     }
     $filterList = $this->_userSrv->buildFilterList($params);
     $this->_helper->filterNotAllowedFilters('filter_by', $filterList);
     if ($filterList) {
         $options['filterList'] = $filterList;
     }
     $userList = $this->_userSrv->listAll($options, array('paging' => $paging));
     $users = $userList->getItems();
     // Check permissions and remove sensitive information
     $result = array();
     foreach ($users as $user) {
         try {
             $this->_helper->allowed('read', $user);
             $user->setPassword(null);
             $result[] = $user;
         } catch (ForbiddenException $e) {
             $userList->setCount($userList->getCount() - 1);
             // Nothing to do, just skip this user
         }
     }
     $this->view->data = $result;
     $this->view->count = $userList->getCount();
 }