发布
如果没错的话,我应该是第四个在Typecho做极验验证码的了233
有实现评论的,有实现登录,我的要求是登录,但是以前的资料是做GEETEST2.0,现在没办法申请到2.0的key,只有3.0,没办法,只能自己修改了,这个插件就是在前辈的基础上做的修改,而且进行了优化。
这里希望做评论验证的哥们能够加油
我这修改的地方还挺麻烦 无法一键完成,有更简单的方法欢迎交流
样图:
配置完成后没有 这个“安全码”,这个是GoogleAuthenticator两步验证插件 写完GoogleAuthenticator后才发现已经有人实现过了 在github上
配置:
(\admin\login.php文件添加<?php Typecho_Plugin::factory('gt')->render(); ?>)
代码: 全选
修改文件
\var\Widget\Login.php
$this->security->protect();
1)修改为
if (!$this->request->__isset('rand')) {
// protect
$this->security->protect();
}
2)在
/** 如果已经登录 */
if ($this->user->hasLogin()) {
/** 直接返回 */
$this->response->redirect($this->options->index);
}
下面添加
$response = Typecho_Plugin::factory('gt')->verify($this);
if ("data" == $response) {
return;
}
//判断极验证码是否开启 且 有没有通过验证
if (!empty(Helper::options()->plugins['activated']['Geetest']) && $response['statusMsg'] != 'success') {
//$error = !empty($status[$response]) ? $status[$response] : $status['error'];
$this->widget('Widget_Notice')->set($response[$response['statusMsg']]);
$this->response->goBack();
}
下载(下载后修改文件夹名为Geetest):
https://github.com/99kyuu/GeetestV3_for ... master.zip
Github:
https://github.com/99kyuu/GeetestV3_for_Typecho
反馈:
https://www.moyu.win/archives/28.html
演示:
https://www.moyu.win/admin/login.php
作者:玖玖kyuu
邮箱:[email protected]
转载希望留名和博客地址。
我还是只是PHP新手。修改了登录验证的安全逻辑 不知道这样有没安全问题 欢迎大神指点。