// improve authController code, in processSubmitAccount, the method checks if the email address already exists and if it's a valid one.

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11368 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
mBertholino
2011-12-19 15:40:57 +00:00
parent 041b1a9f17
commit 91d3e6f391
+5 -1
View File
@@ -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');