From 0fd024201ec93a2bf5009796ad2255bb44907e49 Mon Sep 17 00:00:00 2001 From: touffies Date: Wed, 16 Oct 2013 10:34:07 +0200 Subject: [PATCH] Add violation to password if it's existing user --- core/lib/Thelia/Form/CustomerLogin.php | 27 ++++++++++---------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/core/lib/Thelia/Form/CustomerLogin.php b/core/lib/Thelia/Form/CustomerLogin.php index 79539c19a..78f4c3d33 100755 --- a/core/lib/Thelia/Form/CustomerLogin.php +++ b/core/lib/Thelia/Form/CustomerLogin.php @@ -91,16 +91,21 @@ class CustomerLogin extends BaseForm { if ($value == 1) { $data = $context->getRoot()->getData(); - - //$context->validate('password', array(new Constraints\NotBlank()) ); - if (false === $data['password'] || (empty($data['password']) && '0' != $data['password'])) { - $context->addViolationAt("password", "This value should not sssbe blank"); + + $context->getViolations()->add(new ConstraintViolation( + 'This value should not be blank.', + 'account_password', + array(), + $context->getRoot(), + 'children[password].data', + 'propertyPath' + )); + } } } - /** * If the user select "I'am a new customer", we make sure is email address does not exit in the database. */ @@ -113,18 +118,6 @@ class CustomerLogin extends BaseForm $context->addViolation("A user already exists with this email address. Please login or if you've forgotten your password, go to Reset Your Password."); } } - - //$propertyPath = - $context->getViolations()->add(new ConstraintViolation( - 'failed password', - 'toto', - array(), - $context->getRoot(), - 'children[password].data', - 'propertyPath' - )); - - } public function getName()