Call-back icon  Sales: Call 877.832.5289 (N America)|310.295.4144 (International)

Magento

eCommerce Software for Online Growth

Magento Forum

   
Import Customer Passwords
 
katiek648
Member
 
Total Posts:  33
Joined:  2008-04-10
 

I have a separate database of users that I would like to import into Magento so that those users can log in with the same email/password. However, I noticed that the import will only accept encrypted/hashed passwords. How do I go about importing our current passwords? What type of hashing does Magento use.

Thanks in advance for any help!

Katie

 
Magento Community Magento Community
Magento Community
Magento Community
 
koyan
Jr. Member
 
Total Posts:  14
Joined:  2008-02-28
 

i would like to know how to do this as well.

and as an lesser alternative, is there an option to leave these blank and send a BULK password reset?
i dont fancy sending 1000 odd individual password reset emails :|

 
Magento Community Magento Community
Magento Community
Magento Community
 
uni-man
Member
 
Total Posts:  34
Joined:  2008-04-04
 

Hi
You can use setPasswordHash() like this: (where $row is an array of your data to be imported)

$customerEntityType Mage::getModel('eav/entity')->setType('customer')->getTypeId();
$website Mage::getModel('core/website')->load'base''code');
$websiteID $website->getId();
$customer Mage::getModel'customer/customer' );
$customer->setWebsiteId   $websiteID );
$customer->setWebsiteCode 'base' );
$customer->setGroup       'General' );
$customer->setEmail       $row['EmailAddress');
$customer->setFirstname   $row['FirstName');
$customer->setLastname    $row['FamilyName');
$customer->setPasswordHash$row['LoginPassword'); // the md5 encrypted password
$customer->setIsSubscribed$row['WantsNewsletter');
$customer->save();

hope this helps

 Signature 

http://www.unicycle.co.nz

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top
 
Sales: Call 877.832.5289 (North America) 310.295.4144 (International)
© Copyright 2008 Varien. Magento, eCommerce software, is a trademark of Irubin Consulting Inc. DBA Varien
Privacy Policy|Terms of Service
Magento Community Count
52899 users|599 users currently online|106706 forum posts