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 乘性高斯噪声在深度学习网络中的应用
  • ¥15 运筹学排序问题中的在线排序
  • ¥15 关于docker部署flink集成hadoop的yarn,请教个问题 flink启动yarn-session.sh连不上hadoop,这个整了好几天一直不行,求帮忙看一下怎么解决
  • ¥30 求一段fortran代码用IVF编译运行的结果
  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥30 python代码,帮调试,帮帮忙吧