dps57553 2011-02-05 10:52
浏览 30
已采纳

Sugarcrm magento常见登录

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?

  • 写回答

2条回答 默认 最新

  • dongyun65343 2011-02-05 15:26
    关注

    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

    1. http://localhost:8080/XXX/index.php - URL
    2. module=Accounts (Module name you want to link to
    3. action=DetailView (You can go to either the DetailView or EditView)
    4. record=927e722c-0d8a-e6b1-c590-4c9bb6c4e34b (Sugar ID record number)
    5. MSID=3979359348 (Session variable obtained after the seamless login)

    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

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么