Discuz教程网

[代码修改] Discuz X2中QQ互联登录注册时强制设置独立密码的修改方法

[复制链接]
authicon dly 发表于 2011-10-15 08:12:14 | 显示全部楼层 |阅读模式
QQ互联用户在注册时默认无需填写密码,虽然会让用户更便捷,但却会在一些特殊情况下带来麻烦。

抛去部分站长担心的用户可控性这一点不说,单就不设独立密码无法同步登录UCENTER下其它应用这一点,我就认为在注册时设置独立密码是非常必要的。特别是很多站点高度整合了一些附属的应用,比如点评、外部分类信息系统等,如果不能让用户同步登录,是严重影响用户体验的。

通过下面的几个步骤,可以完美实现QQ互联用户注册时完成独立密码的设置。但需要注意的是,注册完成后首次自动进入登录状态下,此时UCENTER的应用仍然无法同步登录,需要用户退出后第二次登录时,才能实现登录的同步(但我认为到这一步已经不是什么问题了,可以在页面上做一个提示)。

1、打开文件source/plugin/qqconnect/template/module.htm

查找

  1. $('{$_G['setting']['reginput']['password']}').parentNode.parentNode.parentNode.parentNode.parentNode.style.display = 'none';
  2. $('{$_G['setting']['reginput']['password']}').outerHTML += '$js1';
  3. $('{$_G['setting']['reginput']['password']}').required = 0;
  4. $('{$_G['setting']['reginput']['password2']}').parentNode.parentNode.parentNode.parentNode.parentNode.style.display = 'none';
  5. $('{$_G['setting']['reginput']['password2']}').required = 0;
复制代码

修改成

  1. //$('{$_G['setting']['reginput']['password']}').parentNode.parentNode.parentNode.parentNode.parentNode.style.display = 'none';
  2. $('{$_G['setting']['reginput']['username']}').outerHTML += '$js1';
  3. $('{$_G['setting']['reginput']['password']}').required = 1;
  4. //$('{$_G['setting']['reginput']['password2']}').parentNode.parentNode.parentNode.parentNode.parentNode.style.display = 'none';
  5. $('{$_G['setting']['reginput']['password2']}').required = 1;
复制代码

2、打开文件 source/module/member/member_connect.php


查找

  1. $ctl_obj->setting['ignorepassword'] = 1;
复制代码

在前面加两道斜杠 // 将它注释掉。

3、打开文件 source/module/member/member_connect_register.php


查找

  1. DB::query("INSERT INTO ".DB::table('common_member_connect')." (uid, conuin, conuinsecret, conopenid, conispublishfeed, conispublisht, conisregister, conisqzoneavatar, conisfeed) VALUES ('$uid', '$conuin', '$conuinsecret', '$conopenid', '$conispublishfeed', '$conispublisht', '1', '$is_qzone_avatar', '$user_auth_fields')");
复制代码

修改成(只变动了一个数字)

  1. DB::query("INSERT INTO ".DB::table('common_member_connect')." (uid, conuin, conuinsecret, conopenid, conispublishfeed, conispublisht, conisregister, conisqzoneavatar, conisfeed) VALUES ('$uid', '$conuin', '$conuinsecret', '$conopenid', '$conispublishfeed', '$conispublisht', '0', '$is_qzone_avatar', '$user_auth_fields')");
复制代码






上一篇:贵站的这个代码能分享下吗?
下一篇:Discuz X2 完美去除面包屑导航中的 forum.php 尾巴
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

1314学习网 ( 浙ICP备10214163号 )

GMT+8, 2025-5-2 07:02

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表