Checked PSR-1: Basic Coding Standard & Undefined Variable
This commit is contained in:
@ -2,34 +2,32 @@
|
||||
$sub_menu = "300200";
|
||||
include_once('./_common.php');
|
||||
|
||||
//print_r2($_POST); exit;
|
||||
|
||||
check_demo();
|
||||
|
||||
auth_check_menu($auth, $sub_menu, 'w');
|
||||
|
||||
check_admin_token();
|
||||
|
||||
$post_chk = isset($_POST['chk']) ? (array) $_POST['chk'] : array();
|
||||
$post_group_id = isset($_POST['group_id']) ? (array) $_POST['group_id'] : array();
|
||||
$act_button = isset($_POST['act_button']) ? $_POST['act_button'] : '';
|
||||
$post_chk = isset($_POST['chk']) ? (array) $_POST['chk'] : array();
|
||||
$post_group_id = isset($_POST['group_id']) ? (array) $_POST['group_id'] : array();
|
||||
$act_button = isset($_POST['act_button']) ? $_POST['act_button'] : '';
|
||||
|
||||
$count = count($post_chk);
|
||||
$chk_count = count($post_chk);
|
||||
|
||||
if(!$count)
|
||||
if (!$chk_count) {
|
||||
alert($act_button.'할 게시판그룹을 1개이상 선택해 주세요.');
|
||||
}
|
||||
|
||||
for ($i=0; $i<$count; $i++)
|
||||
{
|
||||
$k = isset($post_chk[$i]) ? (int) $post_chk[$i] : 0;
|
||||
$gr_id = preg_replace('/[^a-z0-9_]/i', '', $post_group_id[$k]);
|
||||
$gr_subject = isset($_POST['gr_subject'][$k]) ? strip_tags(clean_xss_attributes($_POST['gr_subject'][$k])) : '';
|
||||
$gr_admin = isset($_POST['gr_admin'][$k]) ? strip_tags(clean_xss_attributes($_POST['gr_admin'][$k])) : '';
|
||||
$gr_device = isset($_POST['gr_device'][$k]) ? clean_xss_tags($_POST['gr_device'][$k], 1, 1, 10) : '';
|
||||
$gr_use_access = isset($_POST['gr_use_access'][$k]) ? (int) $_POST['gr_use_access'][$k] : 0;
|
||||
$gr_order = isset($_POST['gr_order'][$k]) ? (int) $_POST['gr_order'][$k] : 0;
|
||||
for ($i=0; $i<$chk_count; $i++) {
|
||||
$k = isset($post_chk[$i]) ? (int) $post_chk[$i] : 0;
|
||||
$gr_id = preg_replace('/[^a-z0-9_]/i', '', $post_group_id[$k]);
|
||||
$gr_subject = isset($_POST['gr_subject'][$k]) ? strip_tags(clean_xss_attributes($_POST['gr_subject'][$k])) : '';
|
||||
$gr_admin = isset($_POST['gr_admin'][$k]) ? strip_tags(clean_xss_attributes($_POST['gr_admin'][$k])) : '';
|
||||
$gr_device = isset($_POST['gr_device'][$k]) ? clean_xss_tags($_POST['gr_device'][$k], 1, 1, 10) : '';
|
||||
$gr_use_access = isset($_POST['gr_use_access'][$k]) ? (int) $_POST['gr_use_access'][$k] : 0;
|
||||
$gr_order = isset($_POST['gr_order'][$k]) ? (int) $_POST['gr_order'][$k] : 0;
|
||||
|
||||
if($act_button == '선택수정') {
|
||||
if ($act_button == '선택수정') {
|
||||
$sql = " update {$g5['group_table']}
|
||||
set gr_subject = '{$gr_subject}',
|
||||
gr_device = '".sql_real_escape_string($gr_device)."',
|
||||
@ -37,13 +35,15 @@ for ($i=0; $i<$count; $i++)
|
||||
gr_use_access = '".$gr_use_access."',
|
||||
gr_order = '".$gr_order."'
|
||||
where gr_id = '{$gr_id}' ";
|
||||
if ($is_admin != 'super')
|
||||
if ($is_admin != 'super') {
|
||||
$sql .= " and gr_admin = '{$gr_admin}' ";
|
||||
}
|
||||
sql_query($sql);
|
||||
} else if($act_button == '선택삭제') {
|
||||
} elseif ($act_button == '선택삭제') {
|
||||
$row = sql_fetch(" select count(*) as cnt from {$g5['board_table']} where gr_id = '$gr_id' ");
|
||||
if ($row['cnt'])
|
||||
if ($row['cnt']) {
|
||||
alert("이 그룹에 속한 게시판이 존재하여 게시판 그룹을 삭제할 수 없습니다.\\n\\n이 그룹에 속한 게시판을 먼저 삭제하여 주십시오.", './board_list.php?sfl=gr_id&stx='.$gr_id);
|
||||
}
|
||||
|
||||
// 그룹 삭제
|
||||
sql_query(" delete from {$g5['group_table']} where gr_id = '$gr_id' ");
|
||||
@ -53,6 +53,6 @@ for ($i=0; $i<$count; $i++)
|
||||
}
|
||||
}
|
||||
|
||||
run_event('admin_boardgroup_list_update', $act_button, $chk, $post_group_id, $qstr);
|
||||
run_event('admin_boardgroup_list_update', $act_button, $post_chk, $post_group_id, $qstr);
|
||||
|
||||
goto_url('./boardgroup_list.php?'.$qstr);
|
||||
goto_url('./boardgroup_list.php?'.$qstr);
|
||||
|
||||
Reference in New Issue
Block a user