大张小站

  1. @八角石

    欢迎关注我的新浪微博 @八角石 !

    [ 更多详情 ]

  2. 人生

    自歌自舞自开怀,且喜无拘无碍。

  3. 心境

    若得心净如明月,长空万里了无尘。

  4. 情渊

    他生莫做有情痴,人间无地著相思。

  • 1
  • 2
  • 3
  • 4
376

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

分类 网站技术/村民张先生 发布于 2022-08-09 08:12
0

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

打开 source/class/class_member.php ,查找:

		$auth = authcode($_GET['username']."\t".$_GET['password']."\t".($questionexist ? 1 : 0), 'ENCODE', $_G['config']['security']['authkey']);
		$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>';
		showmessage('location_login', '', array('type' => 1), array('extrajs' => $js));

替换为:

		$auth = authcode($_GET['username']."\t".$_GET['password']."\t".($questionexist ? 1 : 0), 'ENCODE', $_G['config']['security']['authkey']);
		if(defined('IN_MOBILE')) {
			dsetcookie('loginauth', $auth, 3600*8+3600, 1, 1);
			dheader('location: denglu.html'); //你的登录页面链接
		} else {
			$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>';
			showmessage('location_login', '', array('type' => 1), array('extrajs' => $js));
		}

打开你的登录页面模板,确保存在以下代码:

<!--{if $auth}-->
<input type="hidden" name="auth" value="$auth" />
<!--{else}-->
//用户名和密码框代码
<!--{/if}-->

在这段代码前添加:

<!--{eval $auth = $auth ? $auth : $_G['cookie']['loginauth'];}-->

将安全问答代码添加以下判断:

<!--{if $auth}-->
//安全问答代码
<!--{/if}-->

检查完善你模板中其他需要作判断的地方。

欢迎转载分享,转载请注明 来源:大张小站 https://www.vdazhang.com/wenzhang-2427.html
若您喜欢这篇文章,欢迎订阅大张小站以获得最新内容。 / 欢迎交流探讨,请发电子邮件至 mail[at]vdazhang.com 。


欢迎谈谈你的看法(无须登录) *正文中请勿包含"http://"否则将被拦截