目錄
目錄X
SiteFactory2.5整合Ucenter
SiteFactory 與 ucenter 整合的接口已經(jīng)內(nèi)置在SiteFactory2.5版本中了,大家可以在A(yíng)PI目錄下看到增加了兩個(gè)文件:

其中API_UC.config為UC接口配置文件;UC.aspx 即為請(qǐng)求響應(yīng)文件。
注意:由于UCenter的密碼加密方式,取回密碼方式等與SiteFactory有很大的區(qū)別,而且UCenter提供用戶(hù)整合信息只有用戶(hù)名、密碼、Email,會(huì)員中心以UCenter為主要。由于以上原因,SiteFactory2.5 的整合也只是實(shí)現(xiàn)用戶(hù)同步注冊(cè)、同步登陸、刪除、更新等。而其他方面,如:用戶(hù)短信等并沒(méi)提供。待UCenter進(jìn)一步完善后,SiteFactory2.5 也將會(huì)進(jìn)一步更完善的整合。
下面將介紹整合過(guò)程:
首先安裝好 UCenter1.5 這里為了方便測(cè)試,同時(shí)安裝discuz7,安裝方法這里就不介紹了。
UC地址
論壇地址
這里先修復(fù)一下UCenter1.5 的一個(gè)BUG
UCenter1.5開(kāi)始,可以讓用戶(hù)自定義應(yīng)用接口文件

但有些地方卻依然用固定的寫(xiě)法,造成程序不能正常整合。
修復(fù)方法:
\control\ user.php
function onsynlogin() //32行
function onsynlogout() //49行
這兩個(gè)函數(shù)。

即改為:

同樣
function onsynlogout()也是一樣改法,改為:

修改好BUG后,我們來(lái)正常安裝SiteFactory
這里的地址為:
安裝應(yīng)用戶(hù)程序,打開(kāi)UCenter
應(yīng)用管理->添加新應(yīng)用



選擇自定義安裝


提交后最下面出現(xiàn)

注意UC_APPID 為 3
SiteFactiory 配置
打開(kāi)API/API_UC.config

開(kāi)啟整合,設(shè)置好UC_KEY與UCenter對(duì)應(yīng)
UC_CHAREST 設(shè)為UTF-8 這與UCenter 的版本有關(guān),如果是GBK版 即為 GBK
UC_APPID即為 添加后的UC_APPID
修改后即可完成整合。

通信成功
測(cè)試整合:SiteFactory登錄,查看discuz和ucenter是否登錄,如下圖:



注意事項(xiàng):
1、 整全后用戶(hù)密碼是以UCenter為中心,因此整合后,SF密碼字段不再是原始密碼的MD5加密值,而是隨機(jī)密碼,整合后,不能恢復(fù)為原來(lái)的。即整合后,如果關(guān)閉整合,會(huì)使SF原有的用戶(hù)將不能正常登陸。(整合前考濾清楚,或參看UCenter的相關(guān)文檔)
2、 目前UCenter還不太完善,如新注冊(cè)用戶(hù)后,不能同時(shí)登陸,論壇塊還要激活等操作。這些只與UCenter的完善有關(guān),與SF接口無(wú)關(guān)。有待UCenter對(duì)接口程序的完善。
3、 安裝時(shí),要處理好UC_APPID和UC_CHAREST,UC_APPID是UCenter安裝后生成的ID。
UC_CHAREST是在官方下載時(shí)選擇的編碼有關(guān)。
用戶(hù)登錄
還沒(méi)有賬號(hào)?
立即注冊(cè)