File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44 * 后台管理IP白名单
55 *
66 * @package AllowIp
7- * @author Fuzqing
8- * @version 1.0.1
7+ * @author Fuzqing, Ryan
8+ * @version 1.0.2
99 * @link https://huangweitong.com
1010 */
1111class AllowIp_Plugin implements Typecho_Plugin_Interface
@@ -14,7 +14,7 @@ class AllowIp_Plugin implements Typecho_Plugin_Interface
1414 * 插件版本号
1515 * @var string
1616 */
17- const _VERSION = '1.0.1 ' ;
17+ const _VERSION = '1.0.2 ' ;
1818
1919 /**
2020 * 激活插件方法,如果激活失败,直接抛出异常
@@ -27,6 +27,7 @@ public static function activate()
2727 {
2828 Typecho_Plugin::factory ('admin/common.php ' )->begin = array ('AllowIp_Plugin ' , 'check ' );
2929 Typecho_Plugin::factory ('Widget_Login ' )->loginSucceed = array ('AllowIp_Plugin ' , 'check ' );
30+ Typecho_Plugin::factory ('Widget_Login ' )->loginSuccess = array ('AllowIp_Plugin ' , 'check ' );
3031 }
3132
3233 /**
@@ -78,7 +79,7 @@ public static function check()
7879 $ realip = isset ($ _SERVER ) ? $ _SERVER ['REMOTE_ADDR ' ] : getenv ("REMOTE_ADDR " );
7980
8081 if ($ realip !== NULL ){
81- $ config = json_decode ( json_encode ( unserialize ( Helper::options ()->plugin ('AllowIp ' ))) );
82+ $ config = Helper::options ()->plugin ('AllowIp ' );
8283 if (empty ($ config ->allow_ip )) {
8384 $ options = Typecho_Widget::widget ('Widget_Options ' );
8485 $ config_url = trim ($ options ->siteUrl ,'/ ' ).'/ ' .trim (__TYPECHO_ADMIN_DIR__ ,'/ ' ).'/options-plugin.php?config=AllowIp ' ;
Original file line number Diff line number Diff line change 11# Typecho 后台IP白名单插件 AllowIp
22
3+ 当前版本:1.0.2,兼容 Typecho 1.2.1+(包括 Typecho 1.3)。
4+
35## 插件简介
46
57设置后台管理IP白名单,也就是说只允许IP白名单内的IP登陆访问后台。<br >
1719请打开"Plugin.php"文件中这一行的注释<br >
1820//$allow_ip[ ] = '0.0.0.0';<br >
1921打开保存之后就可以登陆了,不过这样子这个IP白名单插件也就没意义了。
22+
23+ ## 更新记录
24+
25+ ### 1.0.2
26+
27+ - 修复 Typecho 1.3 下读取插件配置时出现 ` unserialize() ` 警告的问题;
28+ - 同时兼容 Typecho 1.2.1 的 ` loginSucceed ` 和 Typecho 1.3 的 ` loginSuccess ` 登录成功钩子。
Original file line number Diff line number Diff line change 4040[ AMP] ( AMP ) | 生成AMP/MIP移动标准页面 | 0.7.6.1 | [ Holmesian] ( https://github.com/holmesian ) | [ Download] ( https://github.com/typecho-fans/plugins/releases/download/plugins-A_to_C/AMP.zip )
4141[ AbbrSlug] ( AbbrSlug ) | 生成数字文章缩略名 | 1.0.0 | [ 羽叶] ( https://github.com/cyea ) | [ Download] ( https://github.com/typecho-fans/plugins/releases/download/plugins-A_to_C/AbbrSlug.zip )
4242[ AjaxComments] ( AjaxComments ) | 嵌套评论Ajax异步提交效果 | 1.2.0 | [ Byends] ( https://github.com/visamz ) , Willin Kan | [ Download] ( https://github.com/typecho-fans/plugins/releases/download/plugins-A_to_C/AjaxComments.zip )
43- [ AllowIp] ( AllowIp ) | 限制访问后台IP白名单 | 1.0.1 | [ Fuzqing] ( https://github.com/fuzqing ) | [ Download] ( https://github.com/typecho-fans/plugins/releases/download/plugins-A_to_C/AllowIp.zip )
43+ [ AllowIp] ( AllowIp ) | 限制访问后台IP白名单 | 1.0.2 | [ Fuzqing] ( https://github.com/fuzqing ) , [ Ryan ] ( https://github.com/benzBrake ) | [ Download] ( https://github.com/typecho-fans/plugins/releases/download/plugins-A_to_C/AllowIp.zip )
4444[ Announcement] ( Announcement ) | 仿Emlog博客悬浮式公告栏 | 1.0.0 | [ skylzl] ( https://github.com/xiaogouxo ) | [ Download] ( https://github.com/typecho-fans/plugins/releases/download/plugins-A_to_C/Announcement.zip )
4545[ Another-Like] ( AnotherLike ) | 基于[ Like] ( Like ) 动画美化点赞按钮 | 1.0.0 | [ idealclover] ( https://github.com/idealclover ) | [ Download] ( https://github.com/typecho-fans/plugins/releases/download/plugins-A_to_C/AnotherLike.zip )
4646[ AntiSpam] ( AntiSpam ) | 经典反垃圾评论机器人陷阱 | 1.0.3 | Willin Kan | [ Download] ( https://github.com/typecho-fans/plugins/releases/download/plugins-A_to_C/AntiSpam.zip )
You can’t perform that action at this time.
0 commit comments