public function usersLoginAction() { if (!$this->loginStatus) { $usersLoginModelObj = new \models\UsersLoginModel(); $warningMessage = $usersLoginModelObj->loginUser($_POST); $this->refreshLoginStatus(); if ($this->loginStatus) { $out = \views\LogoutFormView::getLogoutForm(); } else { $out = \views\UsersLoginView::getLoginForm() . "<p>{$warningMessage}</p>"; } } else { $out = \views\LogoutFormView::getLogoutForm(); } $this->printIndexPage($out); }
/** * Performs user authentication. * @access public * @return void */ public function usersLoginAction() { if (!$this->loginStatus) { $script = ScriptLoader::loadScript(array('/students2.0/core/js/Validation.js', '/students2.0/js/loginValidation.js')); $usersLoginModelObj = new UsersLoginModel(); $warningMessage = $usersLoginModelObj->loginUser($this->post_data); $this->refreshLoginStatus(); if ($this->loginStatus) { $out = LogoutFormView::getLogoutForm(); } else { $out = UsersLoginView::getLoginForm() . "<p id=\"warningMessage\">{$warningMessage}</p>" . $script; } } else { $out = LogoutFormView::getLogoutForm(); } $this->printIndexPage($out); }