Vérification modification du compte, erreur si un compte existe déjà
This commit is contained in:
parent
f53dee8581
commit
e2a9475ec7
@ -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();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user