我對Magento做一個POC的知識有限,因爲他正在爲他的商店使用Magneto。根網站是在一個自定義的PHP網站,沒有登錄。Magento從自定義的PHP站點登錄
現在我想通過自定義php站點(根站點)來集成登錄腳本,所以當用戶點擊用戶名和密碼(從根站點的形式),他們將成功登錄,並創建Magento會話就像Magneto的(我想使用Magento的「admin_user」表,一個單一的登錄系統)。
我的問題是我必須使用Magneto用戶名和密碼這個自定義登錄PHP網站。我儲存了Magneto Password加密。
更多的澄清:假設該網站是在「的htdocs /站點A」和Magento的店是「的htdocs /站點A /店/」
所以當站點A用戶,並希望從站點A做登錄他將自動loged到Magento的商店站點B :)
我POC
error_reporting(E_ALL | E_STRICT);
ini_set('display_errors',1);
Mage::setIsDeveloperMode(true);
Mage::app("default");
Mage::getSingleton('core/session', array('name' => 'frontend'));
$customer = Mage:: getModel("customer/customer");
$customer->setWebsiteId(Mage::app()->getWebsite()->getId());
//login writes to $_SESSION
//login($username, $password);
$customer->loadByEmail('[email protected]');
$session = Mage::getSingleton("customer/session");
$x=$session->loginById($customer->getId());
$session->setCustomerAsLoggedIn($customer);
if(isset($_SESSION['foo'])){
echo"hi";
$_SESSION['foo'] = "I'm in uo r session.";
} else {
echo 'No foo yet; refresh!';
}
如何加密用戶密碼的Magento或任何其他方式?
Magento使用MD5加密嘗試加密您的客戶密碼MD5,如果您還有任何疑問,請讓我知道 –