设为首页收藏本站

简体中文 繁體中文 English 日本語 Deutsch 한국 사람 بالعربية TÜRKÇE português คนไทย

返回列表 发布新帖
查看: 91|回复: 3

关闭DiscuzX3.5注册页面的注册邮箱验证 New

339

主题

834

回帖

1198

积分

高级会员

积分
1198
发表于 9 小时前 | 查看全部 |阅读模式
原文链接https://www.cnblogs.com/tangshiguang/p/6741136.html,原文作者:唐世光


转自其他平台


  打开source/class/class_member.php


  定位到以下代码,大概533行左右


if(!$activationauth) {     $email = $email ? $email : $_GET['email'];     checkemail($email); }                       


  修改为


if(!$activationauth) {    $email = strtolower(trim($_GET['email']));    if(empty($email) && $_G['setting']['forgeemail']) {        $timestamp = date('YmdHis');        $_GET['email'] = $email = 'KB' . $timestamp . '@qq.com'; // 生成随机邮箱,生成邮箱以KB开头,@qq.com结尾    }    checkemail($email); // 在生成邮箱后校验}                       


  下面是原文的修改方法,先改完下面的部分,在改我上面提到的部分discuzX3.2后台关闭注册邮箱必填选项的功能。详细过程如下:步骤1:source/admincp/admincp_setting.php 文件查找:


showsetting('setting_access_register_send_register_url', 'settingnew[sendregisterurl]', $setting['sendregisterurl'], 'radio');                       


  大概是440-441行:增加以下代码:


showsetting('setting_access_register_forge_email', 'settingnew[forgeemail]', $setting['forgeemail'], 'radio');                       


  步骤2:打开source/language/lang_admincp.php 文件


  查找: 一个邮箱只允许注册一个帐户


  大概811行,增加以下代码:


'setting_access_register_forge_email' => '取消注册邮箱必填','setting_access_register_forge_email_comment' => '开启后如果用不不填写注册邮箱,将自动生成一个邮箱地址',                       


  步骤3:修改source/class/class_member.php


  大概611行:原文是:


$email = strtolower(trim($_GET['email']));if(empty($this->setting['ignorepassword'])) {if($_GET['password'] !== $_GET['password2']) {   showmessage('profile_passwd_notmatch');}if(!$_GET['password'] || $_GET['password'] != addslashes($_GET['password'])) {  showmessage('profile_passwd_illegal'); } $password = $_GET['password'];} else {       $password = md5(random(10));       }}                       


  修改为(或直接替换以下:)(在原文随机码的基础上改为了KB+时间戳+@qq.com)


$email = strtolower(trim($_GET['email']));if(empty($email) && $_G['setting']['forgeemail']) {    // 生成时间戳格式:年月日时分秒(例如 20250415120711)    $timestamp = date('YmdHis');    // 组合随机邮箱前缀码(KB)    $_GET['email'] = $email = 'KB' . $timestamp . '@qq.com';}if(empty($this->setting['ignorepassword'])) {    if($_GET['password'] !== $_GET['password2']) {        showmessage('profile_passwd_notmatch');    }    if(!$_GET['password'] || $_GET['password'] != addslashes($_GET['password'])) {        showmessage('profile_passwd_illegal');    }    $password = $_GET['password'];} else {    $password = md5(random(10));}}                       








我知道答案 回答被采纳将会获得1 贡献 已有3人回答

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×

319

主题

815

回帖

1153

积分

高级会员

积分
1153
发表于 9 小时前 | 查看全部
取消注册邮箱验证,密码怎么找回,邮箱还是有点用处的。。。

290

主题

814

回帖

1119

积分

高级会员

积分
1119
发表于 9 小时前 | 查看全部
手机号.

360

主题

804

回帖

1179

积分

高级会员

积分
1179
发表于 9 小时前 | 查看全部
chen030201 发表于 2026-1-25 14:32
手机号.
                你的网站该可以使用短信?
       

                        现在个人网站无法使用短信功能了,签名那关就过不去,你用的哪个平台的
       

.ce-block {    margin-bottom: 20px;}.ce-block__content,.ce-toolbar__content {        /* max-width:calc(100% - 50px) */        margin-left: auto;    margin-right: auto;}.ce-paragraph {    line-height: 1.6em;    outline: none;    text-indent: 2em;    font-size: 16px;}.ce-paragraph--right {    text-align: right;}.ce-paragraph--center {    text-align: center;}.ce-paragraph--left {    text-align: left;}.ce-paragraph--justify {    text-align: justify;}.ce-paragraph-text-indent {    text-align: justify;}.ce-paragraph[data-placeholder]:empty::before{  content: attr(data-placeholder);  color: #707684;  font-weight: normal;  opacity: 0;}/** Show placeholder at the first paragraph if Editor is empty */.codex-editor--empty .ce-block:first-child .ce-paragraph[data-placeholder]:empty::before {  opacity: 1;}.codex-editor--toolbox-opened .ce-block:first-child .ce-paragraph[data-placeholder]:empty::before,.codex-editor--empty .ce-block:first-child .ce-paragraph[data-placeholder]:empty:focus::before {  opacity: 0;}.ce-paragraph p:first-of-type{    margin-top: 0;}.ce-paragraph p:last-of-type{    margin-bottom: 0;}.svg-icon {    width: 1em;    height: 1em;}.svg-icon path,.svg-icon polygon,.svg-icon rect {    fill: #4691f6;}.svg-icon circle {    stroke: #4691f6;    stroke-width: 1;}.inline-code {  background: rgba(250, 239, 240, 0.78);  color: #b44437;  padding: 3px 4px;  border-radius: 5px;  margin: 0 1px;  font-family: inherit;  font-size: 0.86em;  font-weight: 500;  letter-spacing: 0.3px;}
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

投诉/建议联系

点我~

未经授权禁止转载,复制和建立镜像,
如有违反,追究法律责任
  • 应用中心
  • 建议反馈
Copyright © 2001-2026 DiscuzQ源码网. 版权所有 All Rights Reserved.   |网站地图
关灯 在本版发帖
扫一扫反馈建议
返回顶部
快速回复 返回顶部 返回列表