Override email value
This commit is contained in:
parent
eea2e769d1
commit
a4625499c0
@ -239,14 +239,16 @@ class AuthController extends AuthControllerCore
|
|||||||
$_POST['firstname'] = $firstnameAddress;
|
$_POST['firstname'] = $firstnameAddress;
|
||||||
|
|
||||||
if (!sizeof($this->errors)) {
|
if (!sizeof($this->errors)) {
|
||||||
if(Customer::customerExists($email)) {
|
if (Customer::customerExists($email)) {
|
||||||
$this->errors[] = Tools::displayError('An account is already registered with this e-mail, please fill in the password or request a new one.');
|
$this->errors[] = Tools::displayError('An account is already registered with this e-mail, please fill in the password or request a new one.');
|
||||||
}
|
}
|
||||||
if(Tools::isSubmit('newsletter')) {
|
|
||||||
|
if (Tools::isSubmit('newsletter')) {
|
||||||
$customer->ip_registration_newsletter = pSQL(Tools::getRemoteAddr());
|
$customer->ip_registration_newsletter = pSQL(Tools::getRemoteAddr());
|
||||||
$customer->newsletter_date_add = pSQL(date('Y-m-d H:i:s'));
|
$customer->newsletter_date_add = pSQL(date('Y-m-d H:i:s'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$customer->email = $_POST['email'] = $email;
|
||||||
$customer->birthday = (empty($_POST['years'])? '': (int)($_POST['years']).'-'.(int)($_POST['months']).'-'.(int)($_POST['days']));
|
$customer->birthday = (empty($_POST['years'])? '': (int)($_POST['years']).'-'.(int)($_POST['months']).'-'.(int)($_POST['days']));
|
||||||
|
|
||||||
if (!sizeof($this->errors)) {
|
if (!sizeof($this->errors)) {
|
||||||
@ -257,14 +259,21 @@ class AuthController extends AuthControllerCore
|
|||||||
} else {
|
} else {
|
||||||
$customer->is_guest = 0;
|
$customer->is_guest = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$customer->add()) {
|
if (!$customer->add()) {
|
||||||
$this->errors[] = Tools::displayError('An error occurred while creating your account.');
|
$this->errors[] = Tools::displayError('An error occurred while creating your account.');
|
||||||
} else {
|
} else {
|
||||||
if(!$customer->is_guest) {
|
if (!$customer->is_guest) {
|
||||||
if(!Mail::Send((int)(self::$cookie->id_lang), 'account', Mail::l('Welcome!'),
|
if(!Mail::Send((int)(self::$cookie->id_lang), 'account', Mail::l('Welcome!'),
|
||||||
array('{firstname}' => $customer->firstname, '{lastname}' => $customer->lastname, '{email}' => $customer->email, '{passwd}' => Tools::getValue('passwd')), $customer->email, $customer->firstname.' '.$customer->lastname))
|
array(
|
||||||
|
'{firstname}' => $customer->firstname,
|
||||||
|
'{lastname}' => $customer->lastname,
|
||||||
|
'{email}' => $customer->email,
|
||||||
|
'{passwd}' => Tools::getValue('passwd')
|
||||||
|
), $customer->email, $customer->firstname.' '.$customer->lastname)) {
|
||||||
$this->errors[] = Tools::displayError('Cannot send email');
|
$this->errors[] = Tools::displayError('Cannot send email');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
global $site_version_front;
|
global $site_version_front;
|
||||||
Db::getInstance()->ExecuteS('
|
Db::getInstance()->ExecuteS('
|
||||||
|
Loading…
Reference in New Issue
Block a user