// Fix pub@prestashop.com default account password
This commit is contained in:
@@ -269,7 +269,7 @@ class CustomerCore extends ObjectModel
|
||||
WHERE `active` = 1
|
||||
AND `email` = \''.pSQL($email).'\'
|
||||
'.$shop->addSqlRestriction(Shop::SHARE_CUSTOMER).'
|
||||
'.(isset($passwd) ? 'AND `passwd` = \''.md5(_COOKIE_KEY_.$passwd).'\'' : '').'
|
||||
'.(isset($passwd) ? 'AND `passwd` = \''.Tools::encrypt($passwd).'\'' : '').'
|
||||
AND `deleted` = 0
|
||||
AND `is_guest` = 0';
|
||||
$result = Db::getInstance()->getRow($sql);
|
||||
|
||||
+1
-1
@@ -879,7 +879,7 @@ class ToolsCore
|
||||
*/
|
||||
public static function encrypt($passwd)
|
||||
{
|
||||
return md5(pSQL(_COOKIE_KEY_.$passwd));
|
||||
return md5(_COOKIE_KEY_.$passwd);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -285,7 +285,15 @@ class InstallXmlLoader
|
||||
}
|
||||
|
||||
$data = $this->rewriteRelationedData($entity, $data);
|
||||
$this->createEntity($entity, $identifier, (string)$xml->fields['class'], $data, $data_lang);
|
||||
if (method_exists($this, 'createEntity'.Tools::toCamelCase($entity)))
|
||||
{
|
||||
// Create entity with custom method in current class
|
||||
$method = 'createEntity'.Tools::toCamelCase($entity);
|
||||
$this->$method($identifier, $data, $data_lang);
|
||||
}
|
||||
else
|
||||
$this->createEntity($entity, $identifier, (string)$xml->fields['class'], $data, $data_lang);
|
||||
|
||||
if ($xml->fields['image'])
|
||||
{
|
||||
if (method_exists($this, 'copyImages'.Tools::toCamelCase($entity)))
|
||||
@@ -406,13 +414,7 @@ class InstallXmlLoader
|
||||
public function createEntity($entity, $identifier, $classname, array $data, array $data_lang = array())
|
||||
{
|
||||
$xml = $this->loadEntity($entity);
|
||||
if (method_exists($this, 'createEntity'.Tools::toCamelCase($entity)))
|
||||
{
|
||||
// Create entity with custom method in current class
|
||||
$method = 'createEntity'.Tools::toCamelCase($entity);
|
||||
$entity_id = $this->$method($identifier, $data, $data_lang);
|
||||
}
|
||||
else if ($classname)
|
||||
if ($classname)
|
||||
{
|
||||
// Create entity with ObjectModel class
|
||||
$object = new $classname();
|
||||
@@ -501,7 +503,7 @@ class InstallXmlLoader
|
||||
}
|
||||
}
|
||||
|
||||
return $entity_id;
|
||||
$this->storeId($entity, $identifier, $entity_id);
|
||||
}
|
||||
|
||||
public function generatePrimary($entity, $primary)
|
||||
|
||||
@@ -33,5 +33,11 @@
|
||||
*/
|
||||
class InstallFixturesApple extends InstallXmlLoader
|
||||
{
|
||||
public function createEntityCustomer($identifier, array $data, array $data_lang)
|
||||
{
|
||||
if ($identifier == 'John')
|
||||
$data['passwd'] = Tools::encrypt('123456789');
|
||||
|
||||
return $this->createEntity('customer', $identifier, 'Customer', $data, $data_lang);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user