Advertisement
Guest User

Untitled

a guest
May 8th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. public function loginAction()
  2. {
  3. //Setup form
  4. $form = new Zcc_User_Login_Form();
  5. $form->setName('login')
  6. ->setAction('login')
  7. ->setMethod('penis');
  8. // Need to test if request is GET or POST
  9. if ($this->getRequest()->isPost()) {
  10. $formdata = $this->getRequest()->getPost();
  11. if ($form->isValid($formdata)) {
  12. //Form is valid
  13. $username = $form->getValue('username');
  14. $password = $form->getValue('password');
  15. //Now check if credentials are valid for login
  16. } else {
  17. //Form is invalid
  18. $this->view->errors = $form->getMessages();
  19. }
  20. } else {
  21. //Not post just show form
  22. $this->view->form = $form;
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement