久久久久av_欧美日韩一区二区在线_国产精品三区四区_日韩中字在线

Discuz! 官方交流社區(qū)

標(biāo)題: UCenter同步問題無法將會員數(shù)據(jù)通道dzx3.5 [打印本頁]

作者: 科聯(lián)工作室    時間: 2023-12-28 13:53
標(biāo)題: UCenter同步問題無法將會員數(shù)據(jù)通道dzx3.5
目前有:
網(wǎng)站A:dzx3.5論壇,用戶1100
UCenter在網(wǎng)站A根目錄,先稱之為UC,用戶數(shù)據(jù)與網(wǎng)站A同步1100

現(xiàn)在使用原生php做了一個站點(diǎn)H,想實(shí)現(xiàn)在站點(diǎn)H登陸后同步登陸到網(wǎng)站A(已將UC會員數(shù)據(jù)導(dǎo)入至站點(diǎn)H),目前登陸和退出都已經(jīng)實(shí)現(xiàn)同步,但是站點(diǎn)H注冊的時候只能將數(shù)據(jù)同步到UC,網(wǎng)站A沒有同步過去,導(dǎo)致無法實(shí)現(xiàn)同步。
就是這樣的原理還是我代碼寫的問題?因?yàn)橐呀?jīng)同步到了UC,代碼應(yīng)該沒問題,想不出哪里出了問題,請大神解答一下


作者: 科聯(lián)工作室    時間: 2023-12-28 15:05
問題補(bǔ)充,之前一直是dz3.4 GBK版本,對接前惡意升級到了DZ3.5 UTF8,沒有出現(xiàn)什么報錯和故障,對接時發(fā)現(xiàn)UCenter后臺應(yīng)用管理,只有是否開啟同步登錄:是否接受通知:能用,下邊的都無法使用,無論選擇是還是否,保存以后還是空的,我印象中UCenter1.6好像沒有這么選項(xiàng)(記不清了,可能是我記錯了),不排除是升級時沒有相關(guān)字段導(dǎo)致。

作者: 科聯(lián)工作室    時間: 2023-12-29 02:22
DZX自動激活方法:
打開discuz/api/uc.php,然后找到:

  1. if (($member = getuserbyuid($uid, 1))) {
  2.     dsetcookie('auth', authcode("$member[password]\t$member[uid]", 'ENCODE'), $cookietime);
  3. }
復(fù)制代碼
替換為:
  1. if (($member = getuserbyuid($uid, 1))) {
  2.     dsetcookie('auth', authcode("$member[password]\t$member[uid]", 'ENCODE'), $cookietime);
  3. } else {
  4.     if (!function_exists('uc_get_user')) {
  5.         loaducenter();
  6.     }

  7.     $user = uc_get_user($uid, 1);
  8.     if ($user) {
  9.         $time = time();
  10.         DB::query("REPLACE INTO " . DB::table('common_member') . " SET `uid`='{$user[0]}' , `username`='{$user[1]}' , `password`='" . md5(random(10)) . "' , `email`='{$user[2]}' , `adminid`='0' , `groupid`='10' , `regdate`='{$time}' , `emailstatus`='0' , `credits`='0' , `timeoffset`='9999'");
  11.         DB::query("REPLACE INTO " . DB::table('common_member_status') . " SET `uid`='{$user[0]}' , `regip`='{$_G['clientip']}' , `lastip`='{$_G['clientip']}' , `lastvisit`='{$time}' , `lastactivity`='' , `lastpost`='0' , `lastsendmail`='0'");
  12.         DB::query("REPLACE INTO " . DB::table('common_member_count') . " SET `uid`='{$user[0]}' , `extcredits1`='0' , `extcredits2`='0' , `extcredits3`='0' , `extcredits4`='0' , `extcredits5`='0' , `extcredits6`='0' , `extcredits7`='0' , `extcredits8`='0'");
  13.         DB::query("REPLACE INTO " . DB::table('common_member_profile') . " SET `uid`='{$user[0]}'");
  14.         DB::query("REPLACE INTO " . DB::table('common_member_field_forum') . " SET `uid`='{$user[0]}'");
  15.         DB::query("REPLACE INTO " . DB::table('common_member_field_home') . " SET `uid`='{$user[0]}'");
  16.         DB::query("UPDATE " . DB::table('common_stat') . " SET `register`=`register`+1 WHERE `daytime` = '" . date('Ymd', $time) . "'");
  17.         if (($member = getuserbyuid($uid, 1))) {
  18.             dsetcookie('auth', authcode("$member[password]\t$member[uid]", 'ENCODE'), $cookietime);
  19.         }
  20.     }
  21. }
復(fù)制代碼
順利解決





歡迎光臨 Discuz! 官方交流社區(qū) (http://www.9999xn.com/) Powered by Discuz! W1.0