hypweb.net
XOOPSマニア  最新情報のRSS(サイト全体)
[ 自宅サーバーWebRing |ID=54 前後5表示乱移動サイト一覧 ]

TOP » UsersWiki » nao-pon » blog » 2017-02-14 の変更点
2: 2017-02-14 (火) 20:14:09 nao-pon ソース 現: 2017-02-14 (火) 21:57:55 nao-pon ソース
Line 18: Line 18:
- online テーブルの online_ip カラムの文字数拡張(39文字) - online テーブルの online_ip カラムの文字数拡張(39文字)
 +- protector モジュールの class/protector.php ip_match() の IPv6 対応(後述)
- protector モジュールの一般設定 信頼できる IP に ^::1$ と ^fe80:: を追加 - protector モジュールの一般設定 信頼できる IP に ^::1$ と ^fe80:: を追加
- protector モジュールの管理画面の BadIP のリストアップとその保存処理で、有効時間とIPのセパレーターを ":" から "-" に変更(trust/modules/protector/admin/index.php) - protector モジュールの管理画面の BadIP のリストアップとその保存処理で、有効時間とIPのセパレーターを ":" から "-" に変更(trust/modules/protector/admin/index.php)
Line 26: Line 27:
- protector の BadIP の登録で IPv6 のプレフィクス長を管理画面で指定できるようにする。 - protector の BadIP の登録で IPv6 のプレフィクス長を管理画面で指定できるようにする。
 +
 +** 詳細メモ [#c7b0e9f9]
 +
 +*** class/protector.php ip_match() [#v00f8c71]
 +#code(php,366-){{
 +function ip_match( $ips )
 +{
 +    foreach( $ips as $ip => $info ) {
 +     if( $ip ) {
 +     $ip = strtolower($ip);
 +     switch( substr( $ip , -1 ) ) {
 +     case '.' :
 +     case ':' :
 +     // foward match
 +     if( substr( @$_SERVER['REMOTE_ADDR'] , 0 , strlen( $ip ) ) == $ip ) {
 +     $this->ip_matched_info = $info ;
 +     return true ;
 +     }
 +     break ;
 +     case '0' :
 +     case '1' :
 +     case '2' :
 +     case '3' :
 +     case '4' :
 +     case '5' :
 +     case '6' :
 +     case '7' :
 +     case '8' :
 +     case '9' :
 +     case 'a' :
 +     case 'b' :
 +     case 'c' :
 +     case 'd' :
 +     case 'e' :
 +     case 'f' :
 +     // full match
 +     if( @$_SERVER['REMOTE_ADDR'] == $ip ) {
 +     $this->ip_matched_info = $info ;
 +     return true ;
 +     }
 +     break ;
 +     default :
 +     // perl regex
 +     if( @preg_match( $ip , @$_SERVER['REMOTE_ADDR'] ) ) {
 +     $this->ip_matched_info = $info ;
 +     return true ;
 +     }
 +     break ;
 +     }
 +     }
 +    }
 +    $this->ip_matched_info = null ;
 +    return false ;
 +}
 +}}
RIGHT:&font(90%){&page_comments;}; RIGHT:&font(90%){&page_comments;};
#navi #navi


トップ   差分 バックアップ 複製 名前変更 リロード印刷に適した表示   ページ新規作成 全ページ一覧 単語検索 最新ページの一覧   ヘルプ   最新ページのRSS 1.0 最新ページのRSS 2.0 最新ページのRSS Atom Powered by xpWiki
Counter: 611, today: 2, yesterday: 0
このページのTopへ
メインメニュー
ログイン

ユーザー名:


パスワード:





パスワード紛失  |新規登録
最近の更新
#recent(): You called me too much
オンライン状況
217 人のユーザが現在オンラインです。 (7 人のユーザが UsersWiki を参照しています。)

登録ユーザ: 0
ゲスト: 217

もっと...
サイト情報