Auth->allow(['add', 'edit']); $this->Auth->allow(['index', 'errorHttpRequest']); } /** * Index method * * @return \Cake\Http\Response|null */ public function index() { $startTime = microtime(true); $this->viewBuilder()->setLayout('frontend'); $session = $this->getRequest()->getSession(); //return $this->redirect(Router::url('/', true) . 'account/', 303); $result = $this->requestLogin(); if($result !== true) { return $result; } $user = $session->read('StateUser'); $serverUser = $this->Auth->user('id'); if($serverUser) { $adminErrorsTable = TableRegistry::getTableLocator()->get('AdminErrors'); $adminErrorCount = $adminErrorsTable->find('all')->count(); $this->set('adminErrorCount', $adminErrorCount); } $this->set('user', $user); $this->set('serverUser', $serverUser); $this->set('timeUsed', microtime(true) - $startTime); } public function serverIndex() { $startTime = microtime(true); $this->viewBuilder()->setLayout('frontend'); $adminErrorsTable = TableRegistry::getTableLocator()->get('AdminErrors'); $adminErrorCount = $adminErrorsTable->find('all')->count(); $this->set('adminErrorCount', $adminErrorCount); $this->set('timeUsed', microtime(true) - $startTime); } public function errorHttpRequest() { $startTime = microtime(true); $this->viewBuilder()->setLayout('frontend'); $this->set('timeUsed', microtime(true) - $startTime); } }