3 class BasesfGuardRegisterActions extends sfActions
5 public function executeIndex(sfWebRequest $request)
7 if ($this->getUser()->isAuthenticated())
9 $this->getUser()->setFlash('notice', 'You are already registered and signed in!');
10 $this->redirect('@homepage');
13 $this->form = new sfGuardRegisterForm();
15 if ($request->isMethod('post'))
17 $this->form->bind($request->getParameter($this->form->getName()));
18 if ($this->form->isValid())
20 $user = $this->form->save();
21 $this->getUser()->signIn($user);
23 $this->redirect('@homepage');