maxcrossan/yii_ip_blocker 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

maxcrossan/yii_ip_blocker

Composer 安装命令:

composer require maxcrossan/yii_ip_blocker

包简介

Will block and logout any users not listed in the whitelist

README 文档

README

This will block and logout any users with IP addresses not listed in the whitelist

Installation

Run the Composer command to install the latest stable version of IPBlocker

    php composer.phar require maxcrossan/yii_ip_blocker

Configure the component and preload it in protected/config/main.php

    'preload'=>array('ip-blocker'),
    
    'components'=>array(
        'ip-blocker' => array(
            'class' => Crossan\IPBlocker::class,
            //Expression to validate on (should return true if validation is required)
            'validateOn' => '!Yii::app()->user->isGuest',
            //{ip} will be replaced
            'blockedMessage' => "Access to this system is blocked from your IP: {ip}.",
            // Network ranges can be specified as:
            // 1. Wildcard format:     1.2.3.*
            // 2. CIDR format:         1.2.3/24  OR  1.2.3.4/255.255.255.0
            // 3. Start-End IP format: 1.2.3.0-1.2.3.255
            'whitelistedIPs' => array(
                ':1', '127.0.0.1', //Localhost
                '123.123.123.123', //Office
            ),
            'whitelistArraySupplier' => null, //Use this to grab IPs from a method somewhere in your codebase. Will override whitelistedIPs if set.
        ),
    )

统计信息

  • 总下载量: 101
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-05-23

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固