Пример #1
0
 public function indexAction()
 {
     if ($this->request->isAjax() == true) {
         $entitytype = $this->request->getPost("entitytype");
         $entityid = $this->request->getPost("entityid");
         $request_uri = $this->request->getPost("request_uri");
         $logger = new \WH\Model\Logger();
         $logger->setEntityId($entityid);
         $logger->setRequestUri($request_uri);
         $logger->setSource('web');
         $logger->setEntityType($entitytype);
         $logger->saveViewLogs();
     }
     exit;
 }
Пример #2
0
 protected function forwardtoerrorpage($errorcode)
 {
     if ($errorcode == 404) {
         $Logger = new \WH\Model\Logger();
         $Logger->setCode('404');
         $Logger->setMessage('Page not found');
         $Logger->setOrigin('web');
         $Logger->setParamsValue($_SERVER['REQUEST_URI']);
         $Logger->allLogs();
         $this->tag->setTitle('Page Not Found | ' . $this->config->application->SiteName);
         $this->response->setStatusCode(404, 'Not Found');
         $this->view->pick('errors/show404');
         $this->view->setLayout('errorpageLayout');
     }
     if ($errorcode == 401) {
         $Logger = new \WH\Model\Logger();
         $Logger->setCode('401');
         $Logger->setMessage('Unauthorized Access');
         $Logger->setOrigin('web');
         $Logger->setParamsValue($_SERVER['REQUEST_URI']);
         $Logger->allLogs();
         $this->response->setStatusCode(401, 'Unauthorized Access');
         $this->view->pick('errors/show401');
     }
     if ($errorcode == 500) {
         $Logger = new \WH\Model\Logger();
         $Logger->setCode('500');
         $Logger->setMessage('Internal Server Error');
         $Logger->setOrigin('web');
         $Logger->setParamsValue($_SERVER['REQUEST_URI']);
         $Logger->allLogs();
         $this->response->setStatusCode(500, 'Internal Server Error');
         $this->view->pick('errors/show500');
     }
 }