discuz3.2及3.3禁止指定用户修改密码的方法 [复制链接]

moqu8 2017-6-28

3100 0
该教程可用于演示站点,防止访客修改测试用户账号的密码,并且给出提示信息。修改方法:

打开文件查source\include\spacecp\spacecp_profile.php中333行的位置,代码如下:



$ucresult = uc_user_edit(addslashes($_G['username']), $_GET['oldpassword'], $_GET['newpassword'], '', $ignorepassword, $_GET['questionidnew'], $_GET['answernew']);
修改为:
  if($_G['username'] == 'everyone')      //指定用户名 everyone禁止修改密码
{
showmessage('profile_passwd_denied_everyone'); //显示提示信息
}
else
{
$ucresult = uc_user_edit(addslashes($_G['username']), $_GET['oldpassword'], $_GET['newpassword'], '', $ignorepassword, $_GET['questionidnew'], $_GET['answernew']);
}
然后在文件\source\language\lang_message.php的820行处添加profile_passwd_denied_everyone常量的值,这个是禁止的提示内容
找到:
'profile_passwd_wrong' => '原密码不正确,您不能修改密码或 Email 或安全提问',
在下面添加(提示信息可根据需要自己修改):
'profile_passwd_denied_everyone' => '该演示账号禁止修改密码!',
然后测试修改密码就会出现提示,如图:
94612595332ac3aefb.png

最新回复 (0)
返回
支持中心
邮箱:winkill2012@qqcom
新站优化中!部分功能尚未完善,敬请谅解!
支持中心