그누보드 [G5] 게시글에 IP 일괄 삭제하고, 저장하지 않기
페이지 정보
본문
관리자일때는 ip를 임의의 값 (1.2.3.4)으로 저장하지 않는 방법입니다.
1. 그누보드5 / bbs / write_update.php 의 313줄
$sql = " insert into $write_table
set wr_num = '$wr_num',
wr_reply = '$wr_reply',
wr_comment = 0,
ca_name = '$ca_name',
wr_option = '$html,$secret,$mail',
wr_subject = '$wr_subject',
wr_content = '$wr_content',
wr_link1 = '$wr_link1',
wr_link2 = '$wr_link2',
wr_link1_hit = 0,
wr_link2_hit = 0,
wr_hit = 0,
wr_good = 0,
wr_nogood = 0,
mb_id = '{$member['mb_id']}',
wr_password = unhex('$wr_password'),
wr_name = '$wr_name',
wr_email = '$wr_email',
wr_homepage = '$wr_homepage',
wr_datetime = '".G5_TIME_YMDHIS."',
wr_last = '".G5_TIME_YMDHIS."',
wr_ip = '{$_SERVER['REMOTE_ADDR']}',
를 아래와 같이 변경합니다.
if ($is_admin) { $wr_ip="1.2.3.4"; } else { $wr_ip = $_SERVER['REMOTE_ADDR']; }
$sql = " insert into $write_table
set wr_num = '$wr_num',
wr_reply = '$wr_reply',
wr_comment = 0,
ca_name = '$ca_name',
wr_option = '$html,$secret,$mail',
wr_subject = '$wr_subject',
wr_content = '$wr_content',
wr_link1 = '$wr_link1',
wr_link2 = '$wr_link2',
wr_link1_hit = 0,
wr_link2_hit = 0,
wr_hit = 0,
wr_good = 0,
wr_nogood = 0,
mb_id = '{$member['mb_id']}',
wr_password = unhex('$wr_password'),
wr_name = '$wr_name',
wr_email = '$wr_email',
wr_homepage = '$wr_homepage',
wr_datetime = '".G5_TIME_YMDHIS."',
wr_last = '".G5_TIME_YMDHIS."',
wr_ip = '{$wr_ip}',
2. 로그인 상태 ip를 다른 값으로 저장하기
common.php 내용에서
// 해당 회원의 접근일시와 IP 를 저장
$sql = " update {$g5['member_table']} set mb_today_login = '".G5_TIME_YMDHIS."', mb_login_ip = '{$_SERVER['REMOTE_ADDR']}' where mb_id = '{$member['mb_id']}' ";
를 아래와 같이 변경
// 해당 회원의 접근일시와 IP 를 저장
if ($is_admin) { $wr_ip="1.2.3.4"; } else { $wr_ip = $_SERVER['REMOTE_ADDR']; }
$sql = " update {$g5['member_table']} set mb_today_login = '".G5_TIME_YMDHIS."', mb_login_ip = '{$wr_ip}' where mb_id = '{$member['mb_id']}' ";
3. 회원정보 업데이트
bbs / register_member_update.php 내용에서
$sql = " insert into {$g5['member_table']}
set mb_id = '{$mb_id}',
mb_password = '".get_encrypt_string($mb_password)."',
mb_name = '{$mb_name}',
mb_nick = '{$mb_nick}',
mb_nick_date = '".G5_TIME_YMD."',
mb_email = '{$mb_email}',
mb_email_certify = '".$mb_email_certify."',
mb_today_login = '".G5_TIME_YMDHIS."',
mb_datetime = '".G5_TIME_YMDHIS."',
mb_ip = '{$_SERVER['REMOTE_ADDR']}',
mb_level = '{$config['cf_register_level']}',
mb_login_ip = '{$_SERVER['REMOTE_ADDR']}',
를 아래와 같이 변경
if ($is_admin) { $wr_ip="1.2.3.4"; } else { $wr_ip = $_SERVER['REMOTE_ADDR']; }
$sql = " insert into {$g5['member_table']}
set mb_id = '{$mb_id}',
mb_password = '".get_encrypt_string($mb_password)."',
mb_name = '{$mb_name}',
mb_nick = '{$mb_nick}',
mb_nick_date = '".G5_TIME_YMD."',
mb_email = '{$mb_email}',
mb_email_certify = '".$mb_email_certify."',
mb_today_login = '".G5_TIME_YMDHIS."',
mb_datetime = '".G5_TIME_YMDHIS."',
mb_ip = '{$wr_ip}',
mb_level = '{$config['cf_register_level']}',
mb_login_ip = '{$wr_ip}',
4. 일반회원도 ip 저장안하기
bbs / register_form_update 내용에서
$sql = " insert into {$g5['member_table']}
set mb_id = '{$mb_id}',
mb_password = '".get_encrypt_string($mb_password)."',
mb_name = '{$mb_name}',
mb_nick = '{$mb_nick}',
mb_nick_date = '".G5_TIME_YMD."',
mb_email = '{$mb_email}',
mb_homepage = '{$mb_homepage}',
mb_tel = '{$mb_tel}',
mb_zip1 = '{$mb_zip1}',
mb_zip2 = '{$mb_zip2}',
mb_addr1 = '{$mb_addr1}',
mb_addr2 = '{$mb_addr2}',
mb_addr3 = '{$mb_addr3}',
mb_addr_jibeon = '{$mb_addr_jibeon}',
mb_signature = '{$mb_signature}',
mb_profile = '{$mb_profile}',
mb_today_login = '".G5_TIME_YMDHIS."',
mb_datetime = '".G5_TIME_YMDHIS."',
mb_ip = '{$_SERVER['REMOTE_ADDR']}',
mb_level = '{$config['cf_register_level']}',
mb_recommend = '{$mb_recommend}',
mb_login_ip = '{$_SERVER['REMOTE_ADDR']}',
를 아래와 같이 변경
$wr_ip="1.2.3.4";
$sql = " insert into {$g5['member_table']}
set mb_id = '{$mb_id}',
mb_password = '".get_encrypt_string($mb_password)."',
mb_name = '{$mb_name}',
mb_nick = '{$mb_nick}',
mb_nick_date = '".G5_TIME_YMD."',
mb_email = '{$mb_email}',
mb_homepage = '{$mb_homepage}',
mb_tel = '{$mb_tel}',
mb_zip1 = '{$mb_zip1}',
mb_zip2 = '{$mb_zip2}',
mb_addr1 = '{$mb_addr1}',
mb_addr2 = '{$mb_addr2}',
mb_addr3 = '{$mb_addr3}',
mb_addr_jibeon = '{$mb_addr_jibeon}',
mb_signature = '{$mb_signature}',
mb_profile = '{$mb_profile}',
mb_today_login = '".G5_TIME_YMDHIS."',
mb_datetime = '".G5_TIME_YMDHIS."',
mb_ip = '{$wr_ip}',
mb_level = '{$config['cf_register_level']}',
mb_recommend = '{$mb_recommend}',
mb_login_ip = '{$wr_ip}',
5. 저장된 ip를 일괄 변경하기
회원레벨 10이 작성한 게시글의 ip를 1.2.3.4 로 변경하기
<?php
include_once("./_common.php");
if (!$is_admin=="super") {
alert("관리자 메뉴입니다.");
exit;
}
$qry = sql_query(" select * from {$g5['member_table']} where mb_level='10' ");
while($row = sql_fetch_array($qry)) {
$qry2 = sql_query(" select * from {$g5['board_table']} ");
while($row2 = sql_fetch_array($qry2)) {
$sql3 = " update ".$g5['write_prefix'].$row2['bo_table']." set wr_ip='1.2.3.4' where mb_id='{$row['mb_id']}' ";
echo $sql3 ." IP change complete!!<br>";
//$qry3 = sql_query($sql3);
}
echo "<br>";
}
//goto_url(G5_ADMIN_URL);
?>
1. 그누보드5 / bbs / write_update.php 의 313줄
$sql = " insert into $write_table
set wr_num = '$wr_num',
wr_reply = '$wr_reply',
wr_comment = 0,
ca_name = '$ca_name',
wr_option = '$html,$secret,$mail',
wr_subject = '$wr_subject',
wr_content = '$wr_content',
wr_link1 = '$wr_link1',
wr_link2 = '$wr_link2',
wr_link1_hit = 0,
wr_link2_hit = 0,
wr_hit = 0,
wr_good = 0,
wr_nogood = 0,
mb_id = '{$member['mb_id']}',
wr_password = unhex('$wr_password'),
wr_name = '$wr_name',
wr_email = '$wr_email',
wr_homepage = '$wr_homepage',
wr_datetime = '".G5_TIME_YMDHIS."',
wr_last = '".G5_TIME_YMDHIS."',
wr_ip = '{$_SERVER['REMOTE_ADDR']}',
를 아래와 같이 변경합니다.
if ($is_admin) { $wr_ip="1.2.3.4"; } else { $wr_ip = $_SERVER['REMOTE_ADDR']; }
$sql = " insert into $write_table
set wr_num = '$wr_num',
wr_reply = '$wr_reply',
wr_comment = 0,
ca_name = '$ca_name',
wr_option = '$html,$secret,$mail',
wr_subject = '$wr_subject',
wr_content = '$wr_content',
wr_link1 = '$wr_link1',
wr_link2 = '$wr_link2',
wr_link1_hit = 0,
wr_link2_hit = 0,
wr_hit = 0,
wr_good = 0,
wr_nogood = 0,
mb_id = '{$member['mb_id']}',
wr_password = unhex('$wr_password'),
wr_name = '$wr_name',
wr_email = '$wr_email',
wr_homepage = '$wr_homepage',
wr_datetime = '".G5_TIME_YMDHIS."',
wr_last = '".G5_TIME_YMDHIS."',
wr_ip = '{$wr_ip}',
2. 로그인 상태 ip를 다른 값으로 저장하기
common.php 내용에서
// 해당 회원의 접근일시와 IP 를 저장
$sql = " update {$g5['member_table']} set mb_today_login = '".G5_TIME_YMDHIS."', mb_login_ip = '{$_SERVER['REMOTE_ADDR']}' where mb_id = '{$member['mb_id']}' ";
를 아래와 같이 변경
// 해당 회원의 접근일시와 IP 를 저장
if ($is_admin) { $wr_ip="1.2.3.4"; } else { $wr_ip = $_SERVER['REMOTE_ADDR']; }
$sql = " update {$g5['member_table']} set mb_today_login = '".G5_TIME_YMDHIS."', mb_login_ip = '{$wr_ip}' where mb_id = '{$member['mb_id']}' ";
3. 회원정보 업데이트
bbs / register_member_update.php 내용에서
$sql = " insert into {$g5['member_table']}
set mb_id = '{$mb_id}',
mb_password = '".get_encrypt_string($mb_password)."',
mb_name = '{$mb_name}',
mb_nick = '{$mb_nick}',
mb_nick_date = '".G5_TIME_YMD."',
mb_email = '{$mb_email}',
mb_email_certify = '".$mb_email_certify."',
mb_today_login = '".G5_TIME_YMDHIS."',
mb_datetime = '".G5_TIME_YMDHIS."',
mb_ip = '{$_SERVER['REMOTE_ADDR']}',
mb_level = '{$config['cf_register_level']}',
mb_login_ip = '{$_SERVER['REMOTE_ADDR']}',
를 아래와 같이 변경
if ($is_admin) { $wr_ip="1.2.3.4"; } else { $wr_ip = $_SERVER['REMOTE_ADDR']; }
$sql = " insert into {$g5['member_table']}
set mb_id = '{$mb_id}',
mb_password = '".get_encrypt_string($mb_password)."',
mb_name = '{$mb_name}',
mb_nick = '{$mb_nick}',
mb_nick_date = '".G5_TIME_YMD."',
mb_email = '{$mb_email}',
mb_email_certify = '".$mb_email_certify."',
mb_today_login = '".G5_TIME_YMDHIS."',
mb_datetime = '".G5_TIME_YMDHIS."',
mb_ip = '{$wr_ip}',
mb_level = '{$config['cf_register_level']}',
mb_login_ip = '{$wr_ip}',
4. 일반회원도 ip 저장안하기
bbs / register_form_update 내용에서
$sql = " insert into {$g5['member_table']}
set mb_id = '{$mb_id}',
mb_password = '".get_encrypt_string($mb_password)."',
mb_name = '{$mb_name}',
mb_nick = '{$mb_nick}',
mb_nick_date = '".G5_TIME_YMD."',
mb_email = '{$mb_email}',
mb_homepage = '{$mb_homepage}',
mb_tel = '{$mb_tel}',
mb_zip1 = '{$mb_zip1}',
mb_zip2 = '{$mb_zip2}',
mb_addr1 = '{$mb_addr1}',
mb_addr2 = '{$mb_addr2}',
mb_addr3 = '{$mb_addr3}',
mb_addr_jibeon = '{$mb_addr_jibeon}',
mb_signature = '{$mb_signature}',
mb_profile = '{$mb_profile}',
mb_today_login = '".G5_TIME_YMDHIS."',
mb_datetime = '".G5_TIME_YMDHIS."',
mb_ip = '{$_SERVER['REMOTE_ADDR']}',
mb_level = '{$config['cf_register_level']}',
mb_recommend = '{$mb_recommend}',
mb_login_ip = '{$_SERVER['REMOTE_ADDR']}',
를 아래와 같이 변경
$wr_ip="1.2.3.4";
$sql = " insert into {$g5['member_table']}
set mb_id = '{$mb_id}',
mb_password = '".get_encrypt_string($mb_password)."',
mb_name = '{$mb_name}',
mb_nick = '{$mb_nick}',
mb_nick_date = '".G5_TIME_YMD."',
mb_email = '{$mb_email}',
mb_homepage = '{$mb_homepage}',
mb_tel = '{$mb_tel}',
mb_zip1 = '{$mb_zip1}',
mb_zip2 = '{$mb_zip2}',
mb_addr1 = '{$mb_addr1}',
mb_addr2 = '{$mb_addr2}',
mb_addr3 = '{$mb_addr3}',
mb_addr_jibeon = '{$mb_addr_jibeon}',
mb_signature = '{$mb_signature}',
mb_profile = '{$mb_profile}',
mb_today_login = '".G5_TIME_YMDHIS."',
mb_datetime = '".G5_TIME_YMDHIS."',
mb_ip = '{$wr_ip}',
mb_level = '{$config['cf_register_level']}',
mb_recommend = '{$mb_recommend}',
mb_login_ip = '{$wr_ip}',
5. 저장된 ip를 일괄 변경하기
회원레벨 10이 작성한 게시글의 ip를 1.2.3.4 로 변경하기
<?php
include_once("./_common.php");
if (!$is_admin=="super") {
alert("관리자 메뉴입니다.");
exit;
}
$qry = sql_query(" select * from {$g5['member_table']} where mb_level='10' ");
while($row = sql_fetch_array($qry)) {
$qry2 = sql_query(" select * from {$g5['board_table']} ");
while($row2 = sql_fetch_array($qry2)) {
$sql3 = " update ".$g5['write_prefix'].$row2['bo_table']." set wr_ip='1.2.3.4' where mb_id='{$row['mb_id']}' ";
echo $sql3 ." IP change complete!!<br>";
//$qry3 = sql_query($sql3);
}
echo "<br>";
}
//goto_url(G5_ADMIN_URL);
?>