public function login($request) { $context = array(); if (isset($_POST["login"]) && isset($_POST["passwd"])) { if ($user = \Kingboard\Lib\Auth\Auth::login($_POST["login"], $_POST["passwd"])) { if ($user->status == \Kingboard\Model\User::STATUS_NEW) { \Kingboard\Lib\Auth\Auth::logout(); return $this->render('user/activation_error.html', array('activation_failed' => 'this user has not been activated yet, please check your mailbox for the activation email and follow its instructions.')); } $this->redirect("/account/"); // login successfull, redirect to / } else { $context['login_failed'] = true; } } // not logged in yet, show login page return $this->render("user/login.html", $context); }