diff --git a/override/controllers/IdentityController.php b/override/controllers/IdentityController.php index ff55e25a..cee7093f 100755 --- a/override/controllers/IdentityController.php +++ b/override/controllers/IdentityController.php @@ -4,6 +4,19 @@ class IdentityController extends IdentityControllerCore public function preProcess() { self::$smarty->assign(array('HOOK_PROFILE_EDIT' => Module::hookExec('profileEdit'))); + + if (Tools::isSubmit('submitIdentity')) { + $customer = new Customer((int)(self::$cookie->id_customer)); + if (isset($_POST['email'])) { + $_POST['email'] = strtolower(trim($_POST['email'])); + if ($_POST['email'] != $customer->email) { + if (Customer::customerExists($_POST['email'])) { + $this->errors[] = Tools::displayError('An account is already registered with this e-mail'); + } + } + } + } + parent::preProcess(); }