zoukankan      html  css  js  c++  java
  • Discuz!NT 与PetShop Membership的整合

     两套系统采用独立的用户系统,都可以分开注册用户.

    只是PetShop注册用户的时候,增加一个选项[用BBS用户登陆], 假如选择这个选项

    那么在PetShop的Membership系统里面复制一份BBS的用户密码,并写入BBS的Cookie


    这样整合的话,现在考虑用Discuz!NT里面的通行证,

     

     

     

    然后下载Discuz!NT的Tookit http://nt.discuz.net/showtopic-81187.html

     在keyDiscuzSessionHelper类把API,Secret,URL等变量值改成刚才操作步骤后的值

    然后在PetShop的注册页面,加上如下代码:

                DiscuzSession ds = DiscuzSessionHelper.GetSession();
                
    try
                {
                    User objUser 
    = ds.GetUserInfo(ds.GetUserID(Login.UserName));

                    
    if (ds.EncodePassword(objUser.Password,true== ds.EncodePassword(Login.Password, false))
                    {
                        Page.ClientScript.RegisterClientScriptBlock(
    typeof(string), "ok""alert('ok');"true);
                        
    //UID,Passwrod,MD5密码?(MD5=true/明文=false),cookie过期时间(分钟),Cookie domain
                        ds.Login(ds.GetUserID(Login.UserName), Login.Password, false100"");
                        
    //Response.Redirect("SessionCreater.aspx?next=default");
                        Membership.CreateUser(Login.UserName, Login.Password);
                    }
                    
    else
                        Page.ClientScript.RegisterClientScriptBlock(
    typeof(string), "fail""alert('fail');"true);
                }
                
    catch (Exception ex)
                {
                    Page.ClientScript.RegisterClientScriptBlock(
    typeof(string), "exception""alert('"+ ex.Message +"');"true);
                }


  • 相关阅读:
    find ./ -type d ! -name "."
    Linux入门-进程、计划任务
    Linux入门-用户管理
    Linux入门-shell使用技巧
    Linux入门-压缩、解压
    Linux入门-常用命令
    MySQL杂项(索引注意事项 快速导入导出数据 锁 字符集 慢查询)
    MySQL分区实验
    Lvs网络负载均衡 直接路由(dr)
    Lvs网络负载均衡 隧道(ip tunl)
  • 原文地址:https://www.cnblogs.com/zitjubiz/p/Integrate_Discuz_Membership.html
Copyright © 2011-2022 走看看