Skip to content

Instantly share code, notes, and snippets.

@ScullWM
Created February 19, 2012 14:40
Show Gist options
  • Save ScullWM/1864105 to your computer and use it in GitHub Desktop.
Save ScullWM/1864105 to your computer and use it in GitHub Desktop.
login
public function executeLogin(sfWebRequest $request)
{
$this->form = new LoginForm();
if ($request->isMethod('post'))
{
$this->form->bind($request->getParameter('login'));
echo $request->getParameter('login[login]');
if ($this->form->isValid())
{
$user = Doctrine::getTable('Users')->findOneByLogin($request->getParameter('login[login]'));
$this->getUser()->setAuthenticated(true);
$this->getUser()->setAttribute("id", $user->getId());
$this->getUser()->setAttribute("login", $user->getLogin());
}
else {
$this->setTemplate("login");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment