Merge branch 'develop' into gli-2505

This commit is contained in:
vishalsingh.qlo325
2025-02-21 15:57:59 +05:30
37 changed files with 236 additions and 145 deletions

View File

@@ -473,7 +473,6 @@ class AdminCustomersControllerCore extends AdminController
'type' => 'password',
'label' => $this->l('Password'),
'name' => 'passwd',
'required' => ($obj->id ? false : true),
'col' => '4',
'hint' => ($obj->id ? $this->l('Leave this field blank if there\'s no change.') :
sprintf($this->l('Password should be at least %s characters long.'), Validate::PASSWORD_LENGTH))
@@ -1114,6 +1113,10 @@ class AdminCustomersControllerCore extends AdminController
// Check that the new email is not already in use
$customer_email = trim(strval(Tools::getValue('email')));
$customer = new Customer();
if (trim(Tools::getValue('passwd')) == '') {
$_POST['passwd'] = md5(time()._COOKIE_KEY_);
}
if (Validate::isEmail($customer_email)) {
$customer->getByEmail($customer_email);
if ($customer->id) {
@@ -1123,10 +1126,6 @@ class AdminCustomersControllerCore extends AdminController
} elseif (Customer::customerExists($customer_email, false, false)) {
$this->errors[] = Tools::displayError('The email is already associated with a banned account. Please use a different one.');
$this->display = 'edit';
} 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;