관리자권한설정자 + 9등급으로 공지사항 글 작성하기 (보안문의)
본문
안녕하세요. 9등급 관린 권한자와 보안에 대해 문의드리려 합니다.
우선 관리자 페이지에서 '관리 권한 설정'에 tree 라는 아이디를 등록했습니다.
tree 는 9등급이지만 admin 처럼 공지글을 남길 수 있어야 합니다.
그래서 제가 소스를 참조해서 수정해 봤는데요. 잘 동작합니다. (빨간색)
다만 주석 부분에 보안에 관련된 글이 있어 혹시나 하는 마음에 문의 드려봅니다.
수정된 소스를 이용해되 괜찮을지 걱정이 되서요.
조언 부탁드립니다. 좋은 하루 되세요. (__)
[bbs/write.php]----------------------------------------------------------------------------------------
/*****************************
* 9등급이면서 관리자 확인
******************************/
* 9등급이면서 관리자 확인
******************************/
$is_auth = false;
$sql = " select count(*) as cnt from $g4[auth_table] where mb_id = '$member[mb_id]' ";
$row = sql_fetch($sql);
if ($row['cnt'])
$is_auth = true;
$sql = " select count(*) as cnt from $g4[auth_table] where mb_id = '$member[mb_id]' ";
$row = sql_fetch($sql);
if ($row['cnt'])
$is_auth = true;
$is_mb_level_9 = $member[mb_level] >=9? true:false;
$is_auth_level_9 = $is_mb_level_9 && $is_auth;
/*****************************
* End: 9등급이면서 관리자 확인
******************************/
/*****************************
* End: 9등급이면서 관리자 확인
******************************/
$is_notice = false;
if ($is_admin && $w != "r" || $is_auth_level_9 )
{
$is_notice = true;
if ($w == "u")
{
// 답변 수정시 공지 체크 없음
if ($write[wr_reply])
$is_notice = false;
else
{
$notice_checked = "";
//if (preg_match("/^".$wr_id."/m", trim($board[bo_notice])))
//if (preg_match("/[^0-9]{0,1}{$wr_id}[\r]{0,1}/",$board[bo_notice]))
if (in_array((int)$wr_id, $notice_array))
$notice_checked = "checked";
}
}
}
{
// 답변 수정시 공지 체크 없음
if ($write[wr_reply])
$is_notice = false;
else
{
$notice_checked = "";
//if (preg_match("/^".$wr_id."/m", trim($board[bo_notice])))
//if (preg_match("/[^0-9]{0,1}{$wr_id}[\r]{0,1}/",$board[bo_notice]))
if (in_array((int)$wr_id, $notice_array))
$notice_checked = "checked";
}
}
}
[bbs/write_update.php]--------------------------------------------------------------
<?
$g4[title] = $wr_subject . "글입력";
include_once("./_common.php");
$g4[title] = $wr_subject . "글입력";
include_once("./_common.php");
/*****************************
* 9등급이면서 관리자 확인
******************************/
* 9등급이면서 관리자 확인
******************************/
$is_auth = false;
$sql = " select count(*) as cnt from $g4[auth_table] where mb_id = '$member[mb_id]' ";
$row = sql_fetch($sql);
if ($row['cnt'])
$is_auth = true;
$is_mb_level_9 = $member[mb_level] >=9? true:false;
$is_auth_level_9 = $is_mb_level_9 && $is_auth;
/*****************************
* End: 9등급이면서 관리자 확인
******************************/
// 외부에서 글을 등록할 수 있는 버그가 존재하므로 공지는 관리자만 등록이 가능해야 함
if (! ($is_admin||$is_auth_level_9) && $notice)
alert("관리자만 공지할 수 있습니다.");
if (! ($is_admin||$is_auth_level_9) && $notice)
alert("관리자만 공지할 수 있습니다.");
답변을 작성하시기 전에 로그인 해주세요.