Example #1
0
 public function loginAction()
 {
     $formLogin = new Form_Login();
     if ($this->_request->isPost()) {
         if ($formLogin->isValid($this->_request->getParams())) {
             $user = new Model_User();
             if ($user->authorize($formLogin->getValue('email'), $formLogin->getValue('password'))) {
                 $this->_helper->redirector('index');
             } else {
                 $this->view->error = 'Неверные данные авторизации';
             }
         }
     }
     $this->view->form = $formLogin;
 }
 public function loginAction()
 {
     $this->view->title = "User Login.";
     $this->view->headTitle($this->view->title, 'PREPEND');
     $form = new Form_Login();
     if ($this->getRequest()->isPost()) {
         if ($form->isValid($this->getRequest()->getPost())) {
             $user = new Model_User();
             if ($user->authorize($form->getValue('vUsername'), $form->getValue('vPassword'))) {
                 $this->_redirect('/index/');
             } else {
                 $this->view->error = "Wrong E-mail or Password.";
             }
         }
     }
     $this->view->form = $form;
 }
Example #3
0
 public function loginAction()
 {
     $form = new Form_Login();
     if ($this->getRequest()->isPost()) {
         if ($form->isValid($this->getRequest()->getPost())) {
             $user = new Model_User();
             //authorize() - фу-я описана в моделі,
             //повертає true, якщо авторизація пройшла успішно
             if ($user->authorize($form->getValue('username'), $form->getValue('password'))) {
                 $this->_helper->redirector('login');
             } else {
                 $this->view->error = "Невірні дані авторизації";
             }
         }
     }
     $this->view->form = $form;
 }
Example #4
0
 public function loginAction()
 {
     $form = new Form_Login();
     if ($this->getRequest()->isPost()) {
         if ($form->isValid($this->getRequest()->getPost())) {
             $user = new Model_User();
             if ($user->authorize($form->getValue('username'), $form->getValue('password'))) {
                 $this->_helper->redirector('login');
             } else {
                 $this->view->error = 'Неверные данные авторизации.';
             }
         }
     }
     $this->view->form = $form;
 }