게시판에서 비회원에게 이메일 주소 노출방지하기 > 그누3 팁자료실

그누3 팁자료실

게시판에서 비회원에게 이메일 주소 노출방지하기 정보

일반 게시판에서 비회원에게 이메일 주소 노출방지하기

본문

안녕하세요.

그누보드 게시판 리스트에서 소스보기로 보다 보니까 글작성자의 이메일 주소가 아래와 같이 비회원에게도 그대로 노출이 된다는 사실을 알게되었습니다.

<script language='JavaScript'>gblayer('gblayer1', 'mbid', '아무개필명', 'mbid&#064;aaa.co.kr', 'http://www.aaa.co.kr/gnu3/', '1', './bbs');</script></span>

홈페이지를 운영해보시면 아시겠지만 수시로 로봇이 각 개인 홈페이지를 뒤지고 있습니다.
그중에는 네이버나 구글 등의 검색엔진이 다수지만 일부 이메일 추출기도 포함되어 있을수가
있지요.

그래서 gblist.php를 아래와 같이 수정하면 비회원에게는 회원의 이메일정보가 노출되지 않게 됩니다.

if ($member[mb_id])
  $list[$i][name]=gblayer($row[mb_id], cut_str($row[wr_name],12,''), $row[wr_email]);
else
  $list[$i][name]=cut_str($row[wr_name],12,'');

다른 방법은 gnuboard.lib.php에서 gblayer()함수를 수정하는 것인데.. 어쩌면 이게 더 근본적인
방법이 되지 않을까 싶습니다.

즐거운 연말되세요~
추천
0
  • 복사

댓글 전체

// 속도를 빠르게 하기 위하여 막음
    // 정보 공개
    //$sql2 = " select mb_open from $cfg[table_member] where mb_id = '$row[mb_id]' ";
    //$mb = sql_fetch($sql2);

    $list[$i][name] = gblayer($row[mb_id], cut_str($row[wr_name],12,''), $row[wr_email], $row[wr_homepage]);

wr_email 이 보이시나요? ^^
이메일 노출사실을 알고 급조하고서 올려드렸는데.. 간단히 이메일 주소만 지우면 되었네요.
정확한 원본위치는 위에 참고하세요... 제껀 너무 수정한게 많어서 도저히 알기가 불가능^^
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가

$is_category = false;
if ($board[bo_use_category]) {
    $is_category = true;
    $category_location = "./?doc=bbs/gnuboard.php&bo_table=$bo_table&sselect=ca_id&stext=";
    $category_option = get_category_option($write_table);
}

// 검색어가 있다면
if ('' != $stext) {
    $sql_search = get_sql_search($sselect, $stext, $soperator);

    // 가장 작은 번호를 얻어서 변수에 저장 (하단의 페이징에서 사용)
    $sql = " select min(wr_num) from $write_table ";
    $row = sql_fetch($sql);
    $min_section = $row[0];
    if (!$section) {
        $section = $min_section;
    }

    $sql_search .= " and (wr_num between '".$section."' and '".($section+$cfg[search_section])."') ";

    // 원글만 얻는다. (코멘트의 내용도 검색하기 위함)
    $sql = " select distinct wr_parent_id from $write_table where (1) $sql_search ";
    $result = sql_query($sql);
    $total_count = mysql_num_rows($result);
} else {
    $sql_search = "";

    $total_count = $board[bo_total_count];
}

$total_page  = ceil($total_count / $board[bo_page_rows]);  // 전체 페이지 계산
if (!$page) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
$from_record = ($page - 1) * $board[bo_page_rows]; // 시작 열을 구함

if (!$html_title) {
    $html_title = "$group[gr_subject] > $board[bo_subject] 목록 : 페이지 $page";
}

// 관리자라면 선택삭제 보임
$is_checkdelete = false;
if ($member[mb_id] && ($is_admin == 'default' || $group[gr_admin] == $member[mb_id] || $board[bo_admin] == $member[mb_id])) {
    $is_checkdelete = true;
}

$admin_href = "";
// 최고관리자 또는 그룹관리자라면
if ($member[mb_id] && ($is_admin == 'default' || $group[gr_admin] == $member[mb_id])) {
    $admin_href = "./?doc=bbs/admin/boardform.php&w=u&bo_table=$bo_table";
}

// 정렬에 사용하는 QUERY_STRING
$qstr2 = "bo_table=$bo_table";

if ($board[bo_gallery_width]) {
    $td_width = (int)(100 / $board[bo_gallery_width]);
}

// 정렬
if (!$ssort) {
    $ssort  = "wr_notice, wr_num, wr_reply";
    $sorder = "";
}
$sql_order = " order by $ssort $sorder ";


if ('' != $stext) {
    $sql = " select distinct wr_parent_id
              from $write_table
              where (1) $sql_search
              $sql_order
              limit $from_record, $board[bo_page_rows] ";
    $result = sql_query($sql);
} else {
    $sql = " select *
              from $write_table
              where wr_comment = '0'
              $sql_order
              limit $from_record, $board[bo_page_rows] ";
    $result = sql_query($sql);
}

unset($list);

$save_wr_num = $save_wr_notice = 0;
for ($i=0; $row=mysql_fetch_array($result); $i++) {
    $tr = "";
    if ($i && $i%$board[bo_gallery_width]==0) {
        $tr = "</tr><tr>";
    }

    if ('' != $stext) {
        $row = sql_fetch(" select * from $write_table where wr_id = '$row[wr_parent_id]' and wr_comment = '0' ");

        $subject = conv_subject($row[wr_subject], $board[bo_subject_len], "…");
    } else {
        $subject = cut_str($row[wr_subject], $board[bo_subject_len], "…");
        $subject = get_text($subject);
    }

    // 배열전체를 복사
    $list[$i] = $row;
   
    $list[$i][subject] = $subject;
    $list[$i][content] = conv_content($row[wr_content], $row[wr_html]);

    $list[$i][is_notice] = false;
    if ($row[wr_notice] == -1) {
        $list[$i][num] = "공지";
        $list[$i][is_notice] = true;
    } else if ($save_wr_num != $row[wr_num] || $save_wr_notice != $row[wr_notice]) {
        $list[$i][num] = $row[wr_num] * -1;
    } else {
        $list[$i][num] = "&nbsp;";
    }

    if ($wr_id == $row[wr_id]) {
        $list[$i][num] = "<font color=crimson><b>→</b></font>";
    }

    //$list[$i][serial] = $total_count - $i - $from_record;

    $list[$i][ca_name] = get_category_name($write_table, $row[ca_id]);

    $list[$i][commentcnt] = "";
    if ($row[wr_commentcnt]) {
        $list[$i][commentcnt] = "($row[wr_commentcnt])";
    }
   
    $list[$i][datetime] = substr($row[wr_datetime],2,8);

    // 속도를 빠르게 하기 위하여 막음
    // 정보 공개
    //$sql2 = " select mb_open from $cfg[table_member] where mb_id = '$row[mb_id]' ";
    //$mb = sql_fetch($sql2);

    $list[$i][name] = gblayer($row[mb_id], cut_str($row[wr_name],12,''), $row[wr_email], $row[wr_homepage]);

    $list[$i][reply] = "";
    if (strlen($row[wr_reply]) > 0) {
        for ($k=0; $k<strlen($row[wr_reply]); $k++) {
            $list[$i][reply] .= " &nbsp;&nbsp; ";
        }
    }

    $list[$i][icon_reply] = "";
    if ($list[$i][reply]) {
        $list[$i][icon_reply] = "<img src='$board_skin/icon_reply.gif' align='absmiddle'>";
    }

    $list[$i][icon_file] = "";
    if ($row[wr_file1] || $row[wr_file2]) {
        $list[$i][icon_file] = "<img src='$board_skin/icon_file.gif' align='absmiddle'>";
    }

    $list[$i][icon_link] = "";
    if ($row[wr_link1] || $row[wr_link2]) {
        $list[$i][icon_link] = "<img src='$board_skin/icon_link.gif' align='absmiddle'>";
    }

    $list[$i][href] = "./?doc=bbs/gnuboard.php&$qstr&page=$page&wr_id=$row[wr_id]";

    $list[$i][icon_new] = "";
    if ($row[wr_datetime] >= date("Y-m-d H:i:s", time() - $board[bo_new] * 3600)) {
        $list[$i][icon_new] = "<img src='$board_skin/icon_new.gif' align='absmiddle'>";
    }

    $list[$i][icon_hot] = "";
    if ($row[wr_hit] >= $board[bo_hot]) {
        $list[$i][icon_hot] = "<img src='$board_skin/icon_hot.gif' align='absmiddle'>";
    }

    $list[$i][icon_battle] = "";
    if ($row[wr_commentcnt] >= $board[bo_battle]) {
        $list[$i][icon_battle] = "<img src='$board_skin/icon_battle.gif' align='absmiddle'>";
    }

    $list[$i][icon_secret] = "";
    if ($row[wr_secret]) {
        $list[$i][icon_secret] = "<img src='$board_skin/icon_secret.gif' align='absmiddle'>";
    }

    for ($k=1; $k<=$cfg[file_count]; $k++) {
        if (@preg_match($cfg[image_extension], $row["wr_file".$k])) {
            $list[$i]["file_image".$k] = "./data/file/$bo_table/" . $row["wr_file".$k];
        }
    }

    for ($k=1; $k<=$cfg[link_count]; $k++) {
        if ($row["wr_link".$k]) {
            $link[$i]["link".$k] = set_http(get_text(cut_str($row["wr_link".$k], 255)));
            $link[$i]["link_href".$k] = "./?doc=bbs/gblink.php&$qstr&wr_id=$row[wr_id]&index=$k";
        }
    }
   
    $save_wr_num = $row[wr_num];
    $save_wr_notice = $row[wr_notice];
}

$write_pages = get_paging($default[de_write_pages], $page, $total_page, "./?doc=bbs/gnuboard.php&$qstr&page=");

// 검색 section
$prev_section_href = "";
if ($section - $cfg[search_section] >= $min_section && isset($min_section)) {
    $prev_section = $section - $cfg[search_section];
    $prev_section_href = "./?doc=bbs/gnuboard.php&bo_table=$bo_table&sselect=$sselect&stext=$stext§ion=$prev_section";
}

$next_section_href = "";
if ($section + $cfg[search_section] < 0) {
    $next_section = $section + $cfg[search_section];
    $next_section_href = "./?doc=bbs/gnuboard.php&bo_table=$bo_table&sselect=$sselect&stext=$stext§ion=$next_section";
}

$list_href = "";
if ('' != $stext) {
    $list_href = "./?doc=bbs/gnuboard.php&bo_table=$bo_table";
}

$write_href = "";
if ($member[mb_level] >= $board[bo_write_level]) {
    $write_href = "./?doc=bbs/gbform.php&w=&bo_table=$bo_table";
}

include "$board_skin/gblist.skin.php";
?>
3.23에는 비슷한게?
7쟁이님 // 이런 경우는 Ctrl + F 키를 눌러서 찾으셔서 하면 쉽습니다.
예) wr_email 로 찾으시면 단 한방에 찾아 집니다.

버전에 대해서 언급이 없으셨는데 .... 3.24 에서는 140번줄

수정전:
$list[$i][name] = gblayer($row[mb_id], cut_str($row[wr_name],12,''), $row[wr_email], $row[wr_homepage]);

수정후:
    $list[$i][name] = gblayer($row[mb_id], cut_str($row[wr_name],12,''), $row[wr_homepage]);

처럼 $row[wr_email], 만 삭제해 주시면 됩니다.
원본파일 손대는것 이니 따로 메모해 놓으세요. 어제처럼 푸념 하시지 마시구요.^^
© SIRSOFT
현재 페이지 제일 처음으로