DisncuzX3.2-3.4关闭注册邮箱必填选项
其他dz版本请自测
1、第一步source/admincp/admincp_setting.php文件查找
showsetting('setting_access_register_send_register_url', 'settingnew[sendregisterurl]', $setting['sendregisterurl'], 'radio');
在这个代码下添加:
showsetting('setting_access_register_forge_email', 'settingnew[forgeemail]', $setting['forgeemail'], 'radio');
2、第二步打開source/language/lang_admincp.php文件
查找:一个邮箱只允许注册一个用户<br/>注意:只有在<a href="?action=setting&operation=mail">站长-邮件设置</a>中完成邮件设置,确保邮件能送成功下可以开启该功能',或者(看是简体还是繁体):一个邮箱只允许注册一个帐户<br/>注意:只有在<a href="?action=setting&operation=mail">站长-邮件设置</a>中完成邮件设置,确保邮件能发送成功下可以开启该功能在下面添加:
'setting_access_register_forge_email'=>'取消注册邮箱必填',
'setting_access_register_forge_email_comment'=>'开启后如果用不不填写注册邮箱,将自动生成一个邮箱地址',
或者:
'setting_access_register_forge_email'=>'取消註冊郵箱必填',
'setting_access_register_forge_email_comment'=>'開啟後如果用戶不填寫註冊郵箱,將自動生成一個隨機郵箱地址',
3、第三步:修改source/class/class_member.php文件
$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)); } }
修改为:
$email = strtolower(trim($_GET['email'])); if(empty($email) && $_G['setting']['forgeemail']) { $_GET['email'] = $email = strtolower(random(6)).'@'.$_SERVER['HTTP_HOST']; } 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)); } }
这样修改后,后台就会出现一个注册邮箱取消的功能。然后设置取消后,前台也会相应的变化了。
本文网址:https://www.dedexuexi.com/jzjc/dzjc/3549.html
本站部分文章搜集与网络,如有侵权请联系本站,转载请说明出处。