**/ public function executeLogin() { $request = $this->getRequest(); if($request->getMethod() != sfRequest::POST) { if($this->getUser()->isAuthenticated()) { $this->redirect('default/index'); } return sfView::SUCCESS; } else { $u = $this->getUser(); if($this->getRequestParameter('username') == 'admin' && $this->getRequestParameter('password') == 'gerard.1995') { $u->setAuthenticated(true); $u->addCredential('admin'); $this->redirect('default/index'); } else { $request->setError('Login failed', 'Username and/or password was not correct. Please try again.'); return sfView::SUCCESS; } } } /** * Logout action * * @return void * @author Benjamin Ramey **/ public function executeLogout() { $this->getUser()->setAuthenticated(false); $this->redirect('default/login'); } /** * Secure action * * @return void * @author Benjamin Ramey **/ public function executeSecure() { } }