From 41e1cbcc2be0abf11b47d0f1bcdda7a92d38b11a Mon Sep 17 00:00:00 2001 From: mBertholino Date: Mon, 19 Dec 2011 15:40:57 +0000 Subject: [PATCH] // improve authController code, in processSubmitAccount, the method checks if the email address already exists and if it's a valid one. --- controllers/front/AuthController.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/controllers/front/AuthController.php b/controllers/front/AuthController.php index c68eb2464..123f1f23f 100644 --- a/controllers/front/AuthController.php +++ b/controllers/front/AuthController.php @@ -345,7 +345,11 @@ class AuthControllerCore extends FrontController $_POST['passwd'] = md5(time()._COOKIE_KEY_); if (isset($_POST['guest_email']) && $_POST['guest_email']) $_POST['email'] = $_POST['guest_email']; - + // Checked the user address in case he changed his email address + if (!Validate::isEmail($email = Tools::getValue('email')) || empty($email)) + $this->errors[] = Tools::displayError('Invalid e-mail address'); + elseif (Customer::customerExists($email)) + $this->errors[] = Tools::displayError('An account is already registered with this e-mail, please fill in the password or request a new one.'); // Preparing customer $customer = new Customer(); $_POST['lastname'] = Tools::getValue('customer_lastname');