// error message in double

This commit is contained in:
Rémi Gaillard
2013-09-26 13:47:42 +02:00
parent 37f928ade9
commit 252ab56d75
@@ -341,9 +341,7 @@ class AdminEmployeesControllerCore extends AdminController
if (!($obj = $this->loadObject(true)))
return false;
$email = $this->getFieldValue($obj, 'email');
if (!Validate::isEmail($email))
$this->errors[] = Tools::displayError('Invalid email address.');
elseif (Employee::employeeExists($email) && (!Tools::getValue('id_employee') || ($employee = new Employee((int)Tools::getValue('id_employee'))) && $employee->email != $email))
if (Validate::isEmail($email) && Employee::employeeExists($email) && (!Tools::getValue('id_employee') || ($employee = new Employee((int)Tools::getValue('id_employee'))) && $employee->email != $email))
$this->errors[] = Tools::displayError('An account already exists for this email address:').' '.$email;
}