在线建站培训
?客服
?搜索
您的位置: 维尼斯老虎机 cms韦德老虎机 phpcms韦德老虎机 查看内容

解决phpcms V9整合discuz! X3.0后 在phpcms新注册用户需要在discuz激活的问题

2017-12-27 13:22 | 发布者: moke | 栏目:phpcms韦德老虎机

分析其主要原因是phpsso与ucenter通信成功后,XXX_ucenter_member表中的用户已经同步成功但是在XXX_common_member中并没有此用户,所以只要在xxx_common_member中插入此用户就可以了,所以修改discuz/api/uc.php下的synlogin函数就可以了,修改为

PHP Code复制内容到剪贴板
  1. function synlogin($get, $post) {
  2. global $_G;
  3. if(!API_SYNLOGIN) {
  4. return API_RETURN_FORBIDDEN;
  5. }
  6. header('P3P: CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"');
  7. $cookietime = 31536000;
  8. $uid = intval($get['uid']);
  9. $query = DB::query("SELECT uid, username, password FROM ".DB::table('common_member')." WHERE uid='$uid'");
  10. if ($member = DB::fetch($query))
  11. {
  12. dsetcookie('auth', authcode("$member[password]t$member[uid]", 'ENCODE'), $cookietime);
  13. }else
  14. {
  15. $username = $get['username'];
  16. $query = DB::query("SELECT uid, username, password, email FROM ".DB::table('ucenter_members')." WHERE username='$username'");
  17. $member = DB::fetch($query);
  18. $password = $member['password'];
  19. $email = $member['email'];
  20. $ip = $_SERVER['REMOTE_ADDR'];
  21. $time = time();
  22. $userdata = array(
  23. 'uid'=>$uid,
  24. 'username'=>$username,
  25. 'password'=>$password,
  26. 'email'=>$email,
  27. 'adminid'=>0,
  28. 'groupid'=>10,
  29. 'regdate'=>$time,
  30. 'credits'=>0,
  31. 'timeoffset'=>9999
  32. );
  33. DB::insert('common_member', $userdata);
  34. $status_data = array(
  35. 'uid' => $uid,
  36. 'regip' => $ip,
  37. 'lastip' => $ip,
  38. 'lastvisit' => $time,
  39. 'lastactivity' => $time,
  40. 'lastpost' => 0,
  41. 'lastsendmail' => 0
  42. );
  43. DB::insert('common_member_status', $status_data);
  44. DB::insert('common_member_profile', array('uid' => $uid));
  45. DB::insert('common_member_field_forum', array('uid' => $uid));
  46. DB::insert('common_member_field_home', array('uid' => $uid));
  47. DB::insert('common_member_count', array('uid' => $uid));
  48. DB::query('UPDATE '.DB::table('common_setting')." SET svalue='$username' WHERE skey='lastmember'");
  49. $query = DB::query("SELECT uid, username, password FROM ".DB::table('common_member')." WHERE uid='$uid'");
  50. if ($member = DB::fetch($query))
  51. {
  52. dsetcookie('auth', authcode("$member[password]t$member[uid]", 'ENCODE'), $cookietime);
  53. }
  54. }
  55. }


这样在phpcms中注册后去discuz中就可以不用激活就自动登录了

维尼斯老虎机温馨提示:如果你正在寻找优秀的phpcms维尼斯老虎机,那你可以到维尼斯老虎机的 phpcms维尼斯老虎机 频道看看,相信一定有你喜欢的!

最新分享资源

最新评论

验证码 换一个

维尼斯老虎机,韦德老虎机,韦德1946老虎机

百度360搜索搜狗搜索