Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- protected function processForm(sfWebrequest $request, sfForm $form)
- {
- $form->bind(
- $request->getParameter($form->getName())
- );
- if ($form->isValid())
- {
- $formValues = $form->getValues();
- $login = $formValues['login'];
- $password = $formValues['password'];
- $User = Doctrine::getTable('User')->findOneByLogin($login);
- if(!$User) $this->redirect('@homepage');
- if($User->password == $password)
- {
- $currentUserId = $User->id;
- $this->getUser()->setAuthenticated(true);
- $this->getUser()->addCredential('user');
- $this->getUser()->setAttribute('currentUserId', $currentUserId);
- $this->redirect('home/index');
- }
- else $this->redirect('@homepage);
- }
- }
Add Comment
Please, Sign In to add comment