_helper->actionStack('index', 'login', 'users'); } public function listAction() { $this->_helper->viewRenderer->setNeverRender(true); $histories = new Histories(); $historiesRows = $histories->get( $this->user, $this->_getParam('startIndex'), $this->_getParam('results') ); $jsonObj = new StdClass(); $jsonObj->recordsReturned = count($historiesRows); $jsonObj->totalRecords = $histories->getNumHistories($this->user); $jsonObj->startIndex = $this->_getParam('startIndex'); $jsonObj->sort = null; $jsonObj->dir = 'asc'; $jsonObj->records = array(); foreach ($historiesRows as $history) { $jsonObjSite = new StdClass(); $jsonObjSite->id = $history->id; $jsonObjSite->date = $history->date; $jsonObjSite->site = $history->site; $jsonObjSite->ip = $history->ip; $jsonObjSite->result = $history->result; $jsonObj->records[] = $jsonObjSite; } echo Zend_Json::encode($jsonObj); } public function clearAction() { $this->_helper->viewRenderer->setNeverRender(true); $histories = new Histories(); $histories->clear($this->user); $json = new StdClass(); $json->code = 200; echo Zend_Json::encode($json); } }