diff --git a/application/controllers/AuthenticationController.php b/application/controllers/AuthenticationController.php index e66bf3f95..e1622e947 100644 --- a/application/controllers/AuthenticationController.php +++ b/application/controllers/AuthenticationController.php @@ -69,7 +69,7 @@ class AuthenticationController extends ActionController $this->redirectNow('index?_render=body'); } - if ($this->getRequest()->isPost() && $this->view->form->isValid($this->getRequest())) { + if ($this->view->form->isPostAndValid()) { $credentials->setUsername($this->view->form->getValue('username')); diff --git a/application/forms/Authentication/LoginForm.php b/application/forms/Authentication/LoginForm.php index 242ae4a71..30aff96ad 100644 --- a/application/forms/Authentication/LoginForm.php +++ b/application/forms/Authentication/LoginForm.php @@ -64,6 +64,6 @@ class LoginForm extends Form ) ); - $this->disableCsrfToken(); + $this->setTokenDisabled(true); } } diff --git a/test/php/regression/LoginMaskBroken4459Test.php b/test/php/regression/LoginMaskBroken4459Test.php new file mode 100644 index 000000000..fee3736cd --- /dev/null +++ b/test/php/regression/LoginMaskBroken4459Test.php @@ -0,0 +1,64 @@ +buildForm(); + $rendered = $form->render($view); + + $this->assertContains("getRequest(); + + $request->setMethod("POST")->setPost(array( + "username" => "test", + "password" => "test" + )); + + $view = new \Zend_View(); + $form = new LoginForm(); + $form->setRequest($request); + $form->buildForm(); + $this->assertTrue($form->isPostAndValid()); + + } + } + +} \ No newline at end of file