function custom_user_login($edit, $account) {
require_once $_SERVER['DOCUMENT_ROOT'] . "/mage1/app/Mage.php";
global $user;
umask(0);
Mage::App('default');
$session = Mage::getSingleton('customer/session', array('name' => 'frontend'));
try {
$session->login('[email protected]', 'cec123');
$session->setCustomerAsLoggedIn($session->getCustomer());
} catch (Exception $e) {
print_r($e);
exit;
}
i am using this set of code from my D7 installation to log-in to magento.But it is not loggin into either D7 or magento.
But when i run this code from a seperate simple php file outside it logs in to magento successfully. what could be the problem.
try
block with curly brace}
, also the catch block; but you didn't close the function.