/** * Process the login, create the user session and then redirect to * the appropriate page */ public function Login() { $user = new Autenticacao($this->Phreezer); if ($user->Login(RequestUtil::Get('username'), RequestUtil::Get('password'))) { // login success $this->SetCurrentUser($user); $this->Redirect('SecureExample.UserPage'); } else { // login failed $this->Redirect('SecureExample.LoginForm', 'Unknown username/password combination'); } }
/** * Process the login, create the user session and then redirect to * the appropriate page */ public function Autenticar() { //$autenticacao = new Autenticacao($this->Phreezer); if (!Autenticacao::Login(RequestUtil::Get('username'), RequestUtil::Get('password'))) { //Se o login falhar $this->Redirect('SecureExample.LoginForm', 'Usuário ou senha incorretos.'); } }