Discuz! 手机版默认隐藏安全问答的方法-Discuz教程下载

Discuz! 手机版默认隐藏安全问答的方法

开通本站Svip会员,全站资源免费下
实现效果:默认隐藏安全问答项目,避免对多数未设置安全问答的用户造成干扰。若用户设置了安全问答,可在下一步中填写。

打开 source/class/class_member.php ,查找:
  1.                 $auth = authcode($_GET['username']."\t".$_GET['password']."\t".($questionexist ? 1 : 0), 'ENCODE', $_G['config']['security']['authkey']);
  2.                 $js = '<script type="text/javascript">showWindow(\'login\', \'member.php?mod=logging&action=login&auth='.rawurlencode($auth).'&referer='.rawurlencode(dreferer()).(!empty($_GET['cookietime']) ? '&cookietime=1' : '').'\')</script>';
  3.                 showmessage('location_login', '', array('type' => 1), array('extrajs' => $js));
复制代码
替换为:
  1.                 $auth = authcode($_GET['username']."\t".$_GET['password']."\t".($questionexist ? 1 : 0), 'ENCODE', $_G['config']['security']['authkey']);
  2.                 if(defined('IN_MOBILE')) {
  3.                         dsetcookie('loginauth', $auth, 3600*8+3600, 1, 1);
  4.                         dheader('location: denglu.html'); //你的登录页面链接
  5.                 } else {
  6.                         $js = '<script type="text/javascript">showWindow(\'login\', \'member.php?mod=logging&action=login&auth='.rawurlencode($auth).'&referer='.rawurlencode(dreferer()).(!empty($_GET['cookietime']) ? '&cookietime=1' : '').'\')</script>';
  7.                         showmessage('location_login', '', array('type' => 1), array('extrajs' => $js));
  8.                 }
复制代码
打开你的登录页面模板,确保存在以下代码:
  1. <!--{if $auth}-->
  2. <input type="hidden" name="auth" value="$auth" />
  3. <!--{else}-->
  4. //用户名和密码框代码
  5. <!--{/if}-->
复制代码

在这段代码前添加:
  1. <!--{eval $auth = $auth ? $auth : $_G['cookie']['loginauth'];}-->
复制代码
将安全问答代码添加以下判断:
  1. <!--{if $auth}-->
  2. //安全问答代码
  3. <!--{/if}-->
复制代码
检查完善你模板中其他需要作判断的地方。

全部评论 0

您需要登录后才可以回帖 立即登录
登录
0
0
0
返回顶部