diff --git a/controllers/front/IdentityController.php b/controllers/front/IdentityController.php index 563086e86..1a5d9b464 100644 --- a/controllers/front/IdentityController.php +++ b/controllers/front/IdentityController.php @@ -54,9 +54,9 @@ class IdentityControllerCore extends FrontController $this->errors[] = Tools::displayError('Invalid date of birth'); else { - $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)) + if (Customer::customerExists(Tools::getValue('email'), true) && $this->customer->email != Tools::getValue('email')) $this->errors[] = Tools::displayError('An account is already registered with this e-mail.'); $_POST['old_passwd'] = trim($_POST['old_passwd']); @@ -74,7 +74,7 @@ class IdentityControllerCore extends FrontController if (!count($this->errors)) { - $this->customer->id_default_group = (int)($prev_id_default_group); + $this->customer->id_default_group = (int)$prev_id_default_group; $this->customer->firstname = Tools::ucfirst(Tools::strtolower($this->customer->firstname)); if (!isset($_POST['newsletter'])) $this->customer->newsletter = 0;