public function showByTypeAction()
 {
     $service = new EngineBlock_Service_LoginLog();
     $results = $service->searchCountByType($this->_searchParams);
     $this->view->ResultSet = $results->getResults();
     $this->view->startIndex = $results->getParameters()->getOffset();
     $this->view->recordsReturned = $results->getResultCount();
     $this->view->totalRecords = $results->getTotalCount();
 }
예제 #2
0
 /**
  * Get the total number of logins and the number of unique user logins
  * for the previous month
  *
  * @param  Integer $timestamp Timestamp base
  *                 for
  *
  * @return Array('total' => 123, 'unique' => 45)
  */
 public function getLogins($timestamp)
 {
     /**
      * Get logins from last month.
      */
     $date = getdate($timestamp);
     $searchFields = array('year' => $date['year'], 'month' => $date['mon']);
     $params = Surfnet_Search_Parameters::create()->setSearchParams($searchFields);
     $service = new EngineBlock_Service_LoginLog();
     $results = $service->searchCountByType($params)->getResults();
     return $results[0]['num'];
 }