問題一:ecshop注冊(cè)無法和discuz同步賬號(hào)的問題,,在shop的注冊(cè)代碼里加了$user->login($username, $password);$ucdata = isset($user->ucdata)? $user->ucdata : '';解決。
dsetcookie('auth', authcode("$member[password]\t$member[uid]",
'ENCODE'), $cookietime);
} 后加入 else { $username = $get['username']; $password = md5(time().rand(100000, 999999)); $email = $get['email']; $ip = $_SERVER['REMOTE_ADDR']; $time = time(); $userdata = array( 'uid' => $uid, 'username' => $username, 'password' => $password, 'email' => $email, 'adminid' => 0, 'groupid' => 10, 'regdate' => $time, 'credits' => 0, 'timeoffset' => 9999 ); DB::insert('common_member', $userdata); $status_data = array( 'uid' => $uid, 'regip' => $ip, 'lastip' => $ip, 'lastvisit' => $time, 'lastactivity' => $time, 'lastpost' => 0, 'lastsendmail' => 0, );http://www./ DB::insert('common_member_status', $status_data); DB::insert('common_member_profile', array('uid' => $uid)); DB::insert('common_member_field_forum', array('uid' => $uid)); DB::insert('common_member_field_home', array('uid' => $uid)); $query = DB::query("SELECT uid, username, password FROM ".DB::table('common_member')." WHERE uid='$uid'"); if($member = DB::fetch($query)) { dsetcookie('auth', authcode("$member[password]\t$member[uid]", 'ENCODE'), $cookietime); } } 問題三.用以上辦法解決后,又存在一個(gè)奇怪的現(xiàn)象,在ecshop新注冊(cè)的賬號(hào)直接在同步登陸的dx系統(tǒng)里登出,,ecshop無法同步登出(但重新登錄的 用戶名可以做到登錄登出的完美同步),仔細(xì)對(duì)比了cookie,,http://www./ 最后在同事的指點(diǎn)下終于解決了,,由于shop里(modules/intergrates /ucenter.php)清除cookie的方法寫的是 setcookie("ECS[user_id]", ''); setcookie("ECS[password]", ''); 沒有指定cookie_path,改為 setcookie("ECS[user_id]", '', $time, $this->cookie_path); setcookie("ECS[password]", '', $time, $this->cookie_path); 問題解決 今天又遇到一個(gè)問題,突然ecshop到dx的同步登陸出錯(cuò)了,,仔細(xì)查證后發(fā)現(xiàn)由于在ecshop頭部登陸后加了一個(gè)window.reload的代碼刷新頁面(因?yàn)橛胁糠謨?nèi)容需要根據(jù)賬戶不同顯示,,所以加了這個(gè)),,造成的同步錯(cuò)誤,具體原理還在查證 |
|