[-] BO : fixed bug #PSCFV-5501 - Can't edit Guest AccountAddress in Custumer -> Addresses
This commit is contained in:
@@ -298,7 +298,7 @@ class CustomerCore extends ObjectModel
|
||||
* @param string $passwd Password is also checked if specified
|
||||
* @return Customer instance
|
||||
*/
|
||||
public function getByEmail($email, $passwd = null)
|
||||
public function getByEmail($email, $passwd = null, $ignore_guest = true)
|
||||
{
|
||||
if (!Validate::isEmail($email) || ($passwd && !Validate::isPasswd($passwd)))
|
||||
die (Tools::displayError());
|
||||
@@ -308,8 +308,9 @@ class CustomerCore extends ObjectModel
|
||||
WHERE `email` = \''.pSQL($email).'\'
|
||||
'.Shop::addSqlRestriction(Shop::SHARE_CUSTOMER).'
|
||||
'.(isset($passwd) ? 'AND `passwd` = \''.Tools::encrypt($passwd).'\'' : '').'
|
||||
AND `deleted` = 0
|
||||
AND `is_guest` = 0';
|
||||
AND `deleted` = 0'.
|
||||
($ignore_guest ? ' AND `is_guest` = 0' : '');
|
||||
|
||||
$result = Db::getInstance()->getRow($sql);
|
||||
|
||||
if (!$result)
|
||||
|
||||
@@ -307,7 +307,7 @@ class AdminAddressesControllerCore extends AdminController
|
||||
if (Validate::isEmail(Tools::getValue('email')))
|
||||
{
|
||||
$customer = new Customer();
|
||||
$customer->getByEmail(Tools::getValue('email'));
|
||||
$customer->getByEmail(Tools::getValue('email'), null, false);
|
||||
if (Validate::isLoadedObject($customer))
|
||||
$_POST['id_customer'] = $customer->id;
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user