[-] BO : Fix #PSFV-549 : Now two customer with the same mail, isn't possible
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@14845 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -56,6 +56,9 @@ class IdentityControllerCore extends FrontController
|
|||||||
{
|
{
|
||||||
$this->customer->birthday = (empty($_POST['years']) ? '' : (int)($_POST['years']).'-'.(int)($_POST['months']).'-'.(int)($_POST['days']));
|
$this->customer->birthday = (empty($_POST['years']) ? '' : (int)($_POST['years']).'-'.(int)($_POST['months']).'-'.(int)($_POST['days']));
|
||||||
|
|
||||||
|
if (Customer::customerExists(Tools::getValue('email'), true))
|
||||||
|
$this->errors[] = Tools::displayError('An account is already registered with this e-mail.');
|
||||||
|
|
||||||
$_POST['old_passwd'] = trim($_POST['old_passwd']);
|
$_POST['old_passwd'] = trim($_POST['old_passwd']);
|
||||||
if (empty($_POST['old_passwd']) || (Tools::encrypt($_POST['old_passwd']) != $this->context->cookie->passwd))
|
if (empty($_POST['old_passwd']) || (Tools::encrypt($_POST['old_passwd']) != $this->context->cookie->passwd))
|
||||||
$this->errors[] = Tools::displayError('Your password is incorrect.');
|
$this->errors[] = Tools::displayError('Your password is incorrect.');
|
||||||
@@ -64,8 +67,11 @@ class IdentityControllerCore extends FrontController
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$prev_id_default_group = $this->customer->id_default_group;
|
$prev_id_default_group = $this->customer->id_default_group;
|
||||||
$this->errors = $this->customer->validateController();
|
|
||||||
|
// Merge all errors of this file and of the Object Model
|
||||||
|
$this->errors = array_merge($this->errors, $this->customer->validateController());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!count($this->errors))
|
if (!count($this->errors))
|
||||||
{
|
{
|
||||||
$this->customer->id_default_group = (int)($prev_id_default_group);
|
$this->customer->id_default_group = (int)($prev_id_default_group);
|
||||||
|
|||||||
Reference in New Issue
Block a user