public function showByIdpAction()
 {
     $service = new EngineBlock_Service_LoginLog();
     $results = $service->searchCountByIdp($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 number of logins for a provider type in given month.
  * 
  * @param Integer $timestamp timestamp to determine the month
  *                this KPI covers.
  * @param String $type Provider type (IdP or SP)
  * @return Integer
  */
 protected function _getProviderTypeLogins($timestamp, $type)
 {
     /**
      * Get logins for the month in timestamp.
      */
     $date = getdate($timestamp);
     $searchFields = array('year' => $date['year'], 'month' => $date['mon']);
     $params = Surfnet_Search_Parameters::create()->setSearchParams($searchFields);
     $service = new EngineBlock_Service_LoginLog();
     switch ($type) {
         case self::KPI_IDP:
             $logins = $service->searchCountByIdp($params)->getResults();
             break;
         case self::KPI_SP:
             $logins = $service->searchCountBySp($params)->getResults();
             break;
         default:
             throw new Exception("KPI Provider Type");
             break;
     }
     return $logins[0]["num"];
 }