返回列表 发帖
查看: 2647|回复: 7

[求助] 整合 UCenter,同步注册到 Discuz

4

主题

7

回帖

17

积分

初学乍练

贡献
0 点
金币
5 个
发表于 2022-5-12 14:03:20 | 查看全部 |阅读模式
应用整合 UCenter,同步注册到 Discuz 的用户,在 Discuz 登录时得手动激活,用户体验很不好,查了资料修改应用下的 ./uc_client/model/user.php 文件之后不生效。  哪位大佬知道是什么问题么
我知道答案 回答被采纳将会获得1 贡献 已有6人回答
1652335339(1).jpg
回复

使用道具 举报

4

主题

7

回帖

17

积分

初学乍练

贡献
0 点
金币
5 个
 楼主| 发表于 2022-5-12 15:57:03 | 查看全部
解决了 修改 ./uc_server/model/user.php下的文件就可以了
回复

使用道具 举报

0

主题

4

回帖

10

积分

初学乍练

贡献
0 点
金币
5 个
发表于 2024-10-13 13:10:35 | 查看全部
ha8484 发表于 2022-5-12 15:57
解决了 修改 ./uc_server/model/user.php下的文件就可以了

修改的哪里,求告知
回复

使用道具 举报

6

主题

843

回帖

2461

积分

已臻大成

贡献
145 点
金币
90 个
发表于 2024-10-13 13:33:56 | 查看全部

搜索 function add_user 里的

  1. $this->db->query("INSERT INTO ".UC_DBTABLEPRE."memberfields SET uid='$uid'");
复制代码


在下边添加

  1. $this->db->query("INSERT INTO `dbname`.pre_common_member SET uid='$uid', username='$username', password='$password', email='$email', adminid='0', groupid='10', regdate='".$this->base->time."', credits='0', timeoffset='9999'");
  2.     $this->db->query("INSERT INTO `dbname`.pre_common_member_status SET uid='$uid', regip='$regip', lastip='$regip', lastvisit='".$this->base->time."', lastactivity='".$this->base->time."', lastpost='0', lastsendmail='0'");
  3.     $this->db->query("INSERT INTO `dbname`.pre_common_member_profile SET uid='$uid'");
  4.     $this->db->query("INSERT INTO `dbname`.pre_common_member_field_forum SET uid='$uid'");
  5.     $this->db->query("INSERT INTO `dbname`.pre_common_member_field_home SET uid='$uid'");
  6.     $this->db->query("INSERT INTO `dbname`.pre_common_member_count SET uid='$uid', extcredits1='0', extcredits2='0', extcredits3='0', extcredits4='0', extcredits5='0', extcredits6='0', extcredits7='0', extcredits8='0'");
复制代码


这是我网上搜到的答案,试试吧!
*记得修改前先备份文件。
回复

使用道具 举报

6

主题

843

回帖

2461

积分

已臻大成

贡献
145 点
金币
90 个
发表于 2024-10-13 13:38:16 | 查看全部

如果上面的代码不行再试试这个

  1.     $this->db->query("INSERT INTO ".DISCUZ_DBTABLEPRE."common_member SET uid='$uid', username='$username', password='$password', email='$email', adminid='0', groupid='10', regdate='".$this->base->time."', credits='0', timeoffset='9999'");
  2.     $this->db->query("INSERT INTO ".DISCUZ_DBTABLEPRE."common_member_status SET uid='$uid', regip='$regip', lastip='$regip', lastvisit='".$this->base->time."', lastactivity='".$this->base->time."', lastpost='0', lastsendmail='0'");
  3.     $this->db->query("INSERT INTO ".DISCUZ_DBTABLEPRE."common_member_profile SET uid='$uid'");
  4.     $this->db->query("INSERT INTO ".DISCUZ_DBTABLEPRE."common_member_field_forum SET uid='$uid'");
  5.     $this->db->query("INSERT INTO ".DISCUZ_DBTABLEPRE."common_member_field_home SET uid='$uid'");
  6.     $this->db->query("INSERT INTO ".DISCUZ_DBTABLEPRE."common_member_count SET uid='$uid', extcredits1='0', extcredits2='0', extcredits3='0', extcredits4='0', extcredits5='0', extcredits6='0', extcredits7='0', extcredits8='0'");
复制代码
回复

使用道具 举报

0

主题

4

回帖

10

积分

初学乍练

贡献
0 点
金币
5 个
发表于 2024-10-13 18:46:22 | 查看全部
文強 发表于 2024-10-13 13:38
如果上面的代码不行再试试这个

谢谢哈,原来是我一直修改的其他user.php文件,
大佬,要实现同步登陆,需要哪些啊
参考这个----https://www.cnblogs.com/yipianchuyun/p/12393346.html 
发表于 2024-10-13 18:51
回复

使用道具 举报

45

主题

3266

回帖

5553

积分

应用开发者

Discuz! 运维

贡献
218 点
金币
685 个
QQ
发表于 2024-10-14 10:01:27 | 查看全部
以discuz作为用户登录统一入口:https://addon.dismall.com/plugins/tshuz_oauth2server.html
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 关注公众号
  • 有偿服务微信
  • 有偿服务QQ

手机版|小黑屋|Discuz! 官方交流社区 ( 皖ICP备16010102号 |皖公网安备34010302002376号 )|网站地图|star

GMT+8, 2025-12-17 13:29 , Processed in 0.056688 second(s), 15 queries , Redis On.

Powered by Discuz! X5.0 Licensed

© 2001-2025 Discuz! Team.

关灯 在本版发帖
有偿服务QQ
有偿服务微信
返回顶部
快速回复 返回顶部 返回列表