게시판별 아이피차단

· 18년 전 · 3237 · 1
게시판별로 아이피 차단합니다.
----------------------------

ㄱ. adm/board_form.php

<tr class='ht'>
<td></td>
<td>ip 환경설정</td>
<td>
<!-----ip 차단----------->
<table width=100% cellpadding=0 cellspacing=0 border=0>
<tr class='ht'>
<td valign=top>
접근가능 IP<br>
<textarea class=ed name='bo_7_subj' rows='5' style='width:99%;'><?=$board[bo_7_subj]?></textarea><br>입력된 IP의 컴퓨터만 접근할 수 있음.<br>123.123.* 도 입력 가능. (엔터로 구분)</td>
<td valign=top>
접근차단 IP<br>
<textarea class=ed name='bo_7' rows='5' style='width:99%;'><?=$board[bo_7]?></textarea><br>입력된 IP의 컴퓨터는 접근할 수 없음.<br>123.123.* 도 입력 가능. (엔터로 구분)</td>
</tr>
</table>
<!-----/ip 차단----------->
</td>
</tr>

2.bbs/view.php
---------------

////////ip차단 유무검사////////////////////


//목록보기는 허용하고 글 읽을경우 차단 유무확인


$is_admin = is_admin($member['mb_id']);
if ($is_admin != "super") {
// 접근가능 IP
$cf_possible_ip = trim($board['bo_7_subj']);
if ($cf_possible_ip) {
$is_possible_ip = false;
$pattern = explode("\n", $cf_possible_ip);
for ($i=0; $i<count($pattern); $i++) {
$pattern[$i] = trim($pattern[$i]);
if (empty($pattern[$i]))
continue;

$pat = "/({$pattern[$i]})/";
$is_possible_ip = preg_match($pat, $_SERVER['REMOTE_ADDR']);
if ($is_possible_ip)
break;
}
if (!$is_possible_ip)
die ("접근이 가능하지 않습니다.");
}

// 접근차단 IP
$is_intercept_ip = false;
$pattern = explode("\n", trim($board['bo_7']));
for ($i=0; $i<count($pattern); $i++) {
$pattern[$i] = trim($pattern[$i]);
if (empty($pattern[$i]))
continue;

$pat = "/({$pattern[$i]})/";
$is_intercept_ip = preg_match($pat, $_SERVER['REMOTE_ADDR']);
if ($is_intercept_ip)
alert("외부 ip에서는 읽기가 불가능 합니다.", "$g4[path]/bbs/board.php?bo_table=$bo_table");
}
}



///////////////////////////////////////////
|

댓글 1개

ip가 고정되지 않은 경우 즉 공유기를 사용하거나,실제로 일반 고객은 유동적인데

이를 맥어드레스로 고정하여 접근을 차단하는 방법이 있나여?
댓글을 작성하시려면 로그인이 필요합니다. 로그인

그누4 팁자료실

그누보드4와 관련된 팁을 여러분들과 함께 공유하세요. 나누면 즐거움이 커집니다.

+
제목 글쓴이 날짜 조회
18년 전 조회 3,321
18년 전 조회 5,514
18년 전 조회 3,399
18년 전 조회 5,142
18년 전 조회 3,045
18년 전 조회 5,762
18년 전 조회 7,874
18년 전 조회 3,563
18년 전 조회 4,376
18년 전 조회 3,238
18년 전 조회 3,324
18년 전 조회 5,376
18년 전 조회 4,012
18년 전 조회 3,654
18년 전 조회 3,596
18년 전 조회 3,249
18년 전 조회 2,859
18년 전 조회 3,129
18년 전 조회 2.6만
18년 전 조회 3,432
🐛 버그신고