亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

discuz 跨域整合的記錄文件

 更新時(shí)間:2009年06月27日 21:32:59   作者:  
最近我負(fù)責(zé)了從a.com,b.com,c.com同步可以登錄到bbs.comDISCUZ論壇。記錄下
\\create by ahuinan 2009-6-22
\\up by ahuian 2009-6-23
\\up by ahuinan 2009-6-24

1、將common項(xiàng)目中的md5函數(shù)代碼更改為:
復(fù)制代碼 代碼如下:

return System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(str, "MD5").ToLower().Substring(8, 16);

實(shí)現(xiàn)主站與論壇統(tǒng)一加密方式。

2、將common項(xiàng)目中的Encode和Decode改成直接返回。

3、ASP若采用session,則之前先判斷是否有cookie。而主站的統(tǒng)一退出只需要添加一個(gè)清空cookie操作,代碼可以如下:
復(fù)制代碼 代碼如下:

Response.Cookies("dnt")("userid") = rs("uid")
Response.Cookies("dnt")("password") = DESCode
Response.Cookies("dnt")("tpp") = rs("tpp")
Response.Cookies("dnt")("ppp") = rs("ppp")
Response.Cookies("dnt")("pmsound") = rs("pmsound")
Response.Cookies("dnt")("invisible") = rs("invisible")
Response.Cookies("dnt")("referer") = "index.aspx"
Response.Cookies("dnt")("sigstatus") = rs("sigstatus")
Response.Cookies("dnt")("expires") = 0
Response.Cookies("dnt").Domain = ".xxxx.com" //修改為你的域名,注意前面帶.(點(diǎn))
Response.Cookies("dnt").Secure = False

4、在dnt論壇中的aspx>>1文件夾下面先建立一個(gè)login_in.aspx處理所有的同步登陸請(qǐng)求。實(shí)現(xiàn)多域名下同步登陸,比如可以實(shí)現(xiàn)www.a.com和www.b.com 下的登錄問(wèn)題。

5、管理員部分由于修改了加解密部門(mén),所以需要重寫(xiě)admin/index.aspx.cs文件,注釋掉:

復(fù)制代碼 代碼如下:

//if (Context.Request.Cookies["dntadmin"] == null || Context.Request.Cookies["dntadmin"]["key"] == null ||ForumUtils.GetCookiePassword(Context.Request.Cookies["dntadmin"]["key"].ToString(), config.Passwordkey) != (oluserinfo.Password + secques + oluserinfo.Userid.ToString()))

更改為:
復(fù)制代碼 代碼如下:

if (Context.Request.Cookies["dntadmin"] == null || Context.Request.Cookies["dntadmin"]["key"] == null)

同步登陸代碼文件有個(gè)文件名是index.aspx直接拷貝過(guò)去OK,拷貝到admin/index.aspx里面

6、以下內(nèi)容是為了修復(fù)IE6下COOKIE丟失的問(wèn)題,因?yàn)镮E6不支持P3P協(xié)議,可以再每個(gè)程序網(wǎng)站添加該協(xié)議,但比較麻煩,現(xiàn)在直接在IIS添加HTTP頭。

自定義HTTP頭名為:P3P
自定義HTTP頭值為:CP=CAO PSA OUR
7、可能用到的整合文件:
復(fù)制代碼 代碼如下:

<%@ Page Language="C#" %>
<%@ Import Namespace="Discuz.Forum" %>
<%@ Import Namespace="Discuz.Common" %>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
if (Request.QueryString["userName"] != null && Request.QueryString["passWord"] != null)
{
string userName = Request.QueryString["userName"].ToString().Replace("'", "''");
string passWord = Request.QueryString["passWord"].ToString().Replace("'", "''");
int uid = Discuz.Forum.Users.CheckPassword(userName, passWord, false);

if (uid != -1)
{
LoginLogs.DeleteLoginLog(Discuz.Common.DNTRequest.GetIP());
UserCredits.UpdateUserCredits(uid);
ForumUtils.WriteUserCookie(uid, Discuz.Common.Utils.StrToInt(DNTRequest.GetString("expires"), 500),userName, DNTRequest.GetInt("templateid", 0), DNTRequest.GetInt("loginmode", -1));
Users.UpdateUserLastvisit(uid, Discuz.Common.DNTRequest.GetIP());
}
}
}
</script>

相關(guān)文章

最新評(píng)論