Merge branch 'develop' into gli-1868
This commit is contained in:
@@ -519,7 +519,7 @@ class AdminCustomersControllerCore extends AdminController
|
||||
);
|
||||
|
||||
// if we add a customer via fancybox (ajax), it's a customer and he doesn't need to be added to the visitor and guest groups
|
||||
if (Tools::isSubmit('addcustomer') && Tools::isSubmit('submitFormAjax')) {
|
||||
if (Tools::isSubmit('submitFormAjax')) {
|
||||
$visitor_group = Configuration::get('PS_UNIDENTIFIED_GROUP');
|
||||
$guest_group = Configuration::get('PS_GUEST_GROUP');
|
||||
foreach ($groups as $key => $g) {
|
||||
@@ -1055,22 +1055,27 @@ class AdminCustomersControllerCore extends AdminController
|
||||
$customer = new Customer();
|
||||
if (Validate::isEmail($customer_email)) {
|
||||
$customer->getByEmail($customer_email);
|
||||
}
|
||||
if ($customer->id) {
|
||||
$this->errors[] = Tools::displayError('An account already exists for this email address:').' '.$customer_email;
|
||||
if ($customer->id) {
|
||||
$this->errors[] = Tools::displayError('An account already exists for this email address:').' '.$customer_email;
|
||||
$this->display = 'edit';
|
||||
return $customer;
|
||||
} elseif (trim(Tools::getValue('passwd')) == '') {
|
||||
$this->validateRules();
|
||||
$this->errors[] = Tools::displayError('Password can not be empty.');
|
||||
$this->display = 'edit';
|
||||
} elseif ($customer = parent::processAdd()) {
|
||||
$this->context->smarty->assign('new_customer', $customer);
|
||||
return $customer;
|
||||
}
|
||||
} else {
|
||||
$this->errors[] = Tools::displayError('Invalid email address.');
|
||||
$this->display = 'edit';
|
||||
return $customer;
|
||||
} elseif (trim(Tools::getValue('passwd')) == '') {
|
||||
$this->validateRules();
|
||||
$this->errors[] = Tools::displayError('Password can not be empty.');
|
||||
$this->display = 'edit';
|
||||
} elseif ($customer = parent::processAdd()) {
|
||||
$this->context->smarty->assign('new_customer', $customer);
|
||||
return $customer;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public function processUpdate()
|
||||
{
|
||||
if (Validate::isLoadedObject($this->object)) {
|
||||
@@ -1081,7 +1086,10 @@ class AdminCustomersControllerCore extends AdminController
|
||||
$customer = new Customer();
|
||||
if (Validate::isEmail($customer_email)) {
|
||||
$customer->getByEmail($customer_email);
|
||||
} else {
|
||||
$this->errors[] = Tools::displayError('Invalid email address.');
|
||||
}
|
||||
|
||||
if (($customer->id) && ($customer->id != (int)$this->object->id)) {
|
||||
$this->errors[] = Tools::displayError('An account already exists for this email address:').' '.$customer_email;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user