checkAuth(); } final protected function checkAuth(){ if (C('NEED_LOGIN') !== true) return; $controllerName = C('CONTROLLER_NAME'); $ACTION_NAME = C('ACTION_NAME'); $islogined = !empty($_SESSION['user_authenticated']); if (!$islogined) { if($controllerName !== 'Login'){ return $this->redirect('index.php/Login'); } } } } ?>