I'm integrating SugarCRM and Magento. My requirement is when I click on a link in SugarCRM it should redirect to the Magento admin panel order creation. Moreover when I redirect to Magento it should not ask me for Login.
How can I do that?
I'm integrating SugarCRM and Magento. My requirement is when I click on a link in SugarCRM it should redirect to the Magento admin panel order creation. Moreover when I redirect to Magento it should not ask me for Login.
How can I do that?
Seamless login into Sugar is pretty straight forward. Below is an example that creates a link that bypasses Sugar login. When you login to Magento, you can login to Sugar and store the Sugar session variable in a server session variable or a Global variable. Here's the format of a SugarCRM URL
'http://localhost:8080/XXX/index.php?module=Accounts&action=DetailView&record=927e722c-0d8a-e6b1-c590-4c9bb6c4e34b$MSID
You will have to extend Magento to add this information to a link. If you store the MSID in a session variable, then you could always append $_SESSION['MSID'] to the URL
$user_name="admin";
$user_password="admin";
$soapClient = new SoapClient(NULL,
array(
"location" => 'http://localhost:8080/XXX/soap.php',
"uri" => 'http://localhost:8080/XXX',
)
);
try {
$info = $soapClient->login(
array(
'user_name' => $user_name,
'password' => md5($user_password),
)
);
}
catch (SoapFault $fault) {
die("Sorry, the service returned the following ERROR: ".$fault->faultcode."-".$fault->faultstring.".");
}
$session = $info->id;
$canlogin = $soapClient->seamless_login($session);
$MSID='';
if ($canlogin == 1)
$MSID = "&MSID=" . $session;
//echo "Successful Login! Session ID {$session}<br>";
echo "<a href='http://localhost:8080/XXX/index.php?module=Accounts&action=DetailView&record=927e722c-0d8a-e6b1-c590-4c9bb6c4e34b$MSID'>Account Name</a>";
Kaz