Skip to content
This repository has been archived by the owner on Jun 24, 2021. It is now read-only.

Commit

Permalink
php8.0 버전 호환 코드 적용 및 PHP 끝 태그 삭제 일괄적용
Browse files Browse the repository at this point in the history
  • Loading branch information
thisgun committed Jan 4, 2021
1 parent 36cf9d7 commit 54f43f3
Show file tree
Hide file tree
Showing 1,006 changed files with 12,061 additions and 10,834 deletions.
3 changes: 1 addition & 2 deletions _common.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@
die('<p>쇼핑몰 설치 후 이용해 주십시오.</p>');

define('_SHOP_', true);
}
?>
}
3 changes: 1 addition & 2 deletions _head.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가

include_once(G5_PATH.'/head.php');
?>
include_once(G5_PATH.'/head.php');
3 changes: 1 addition & 2 deletions _tail.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가

include_once(G5_PATH.'/tail.php');
?>
include_once(G5_PATH.'/tail.php');
3 changes: 1 addition & 2 deletions adm/_common.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@
$token = @htmlspecialchars(strip_tags($token), ENT_QUOTES);
}

run_event('admin_common');
?>
run_event('admin_common');
16 changes: 11 additions & 5 deletions adm/admin.head.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,23 @@ function print_menu2($key, $no='')
{
global $menu, $auth_menu, $is_admin, $auth, $g5, $sub_menu;

$str .= "<ul>";
$str = "<ul>";
for($i=1; $i<count($menu[$key]); $i++)
{
if( ! isset($menu[$key][$i]) ){
continue;
}

if ($is_admin != 'super' && (!array_key_exists($menu[$key][$i][0],$auth) || !strstr($auth[$menu[$key][$i][0]], 'r')))
continue;

$gnb_grp_div = $gnb_grp_style = '';

if (($menu[$key][$i][4] == 1 && $gnb_grp_style == false) || ($menu[$key][$i][4] != 1 && $gnb_grp_style == true)) $gnb_grp_div = 'gnb_grp_div';
else $gnb_grp_div = '';
if (isset($menu[$key][$i][4])){
if (($menu[$key][$i][4] == 1 && $gnb_grp_style == false) || ($menu[$key][$i][4] != 1 && $gnb_grp_style == true)) $gnb_grp_div = 'gnb_grp_div';

if ($menu[$key][$i][4] == 1) $gnb_grp_style = 'gnb_grp_style';
else $gnb_grp_style = '';
if ($menu[$key][$i][4] == 1) $gnb_grp_style = 'gnb_grp_style';
}

$current_class = '';

Expand Down
21 changes: 16 additions & 5 deletions adm/admin.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,14 @@ function get_member_id_select($name, $level, $selected="", $event="")
return $str;
}

// php8 버전 호환 권한 검사 함수
function auth_check_menu($auth, $sub_menu, $attr, $return=false) {

$check_auth = isset($auth[$sub_menu]) ? $auth[$sub_menu] : '';
return auth_check($check_auth, $attr, $return);

}

// 권한 검사
function auth_check($auth, $attr, $return=false)
{
Expand Down Expand Up @@ -440,7 +448,7 @@ function check_admin_token()
// 관리자 페이지 referer 체크
function admin_referer_check($return=false)
{
$referer = trim($_SERVER['HTTP_REFERER']);
$referer = isset($_SERVER['HTTP_REFERER']) ? trim($_SERVER['HTTP_REFERER']) : '';
if(!$referer) {
$msg = '정보가 올바르지 않습니다.';

Expand Down Expand Up @@ -516,7 +524,7 @@ function admin_menu_find_by($call, $search_key){
}

if( isset($cache_menu[$call]) && isset($cache_menu[$call][$search_key]) ){
return$cache_menu[$call][$search_key];
return $cache_menu[$call][$search_key];
}

return '';
Expand Down Expand Up @@ -556,7 +564,11 @@ function admin_menu_find_by($call, $search_key){
alert_close('정상적으로 로그인하여 접근하시기 바랍니다.');
}

@ksort($auth);
if(isset($auth) && is_array($auth)) {
@ksort($auth);
} else {
$auth = array();
}

// 가변 메뉴
unset($auth_menu);
Expand Down Expand Up @@ -597,5 +609,4 @@ function admin_menu_find_by($call, $search_key){
}

// 관리자에서는 추가 스크립트는 사용하지 않는다.
//$config['cf_add_script'] = '';
?>
//$config['cf_add_script'] = '';
3 changes: 1 addition & 2 deletions adm/admin.menu100.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,4 @@
}

$menu['menu100'][] = array('100410', 'DB업그레이드', G5_ADMIN_URL.'/dbupgrade.php', 'db_upgrade');
$menu['menu100'][] = array('100400', '부가서비스', G5_ADMIN_URL.'/service.php', 'cf_service');
?>
$menu['menu100'][] = array('100400', '부가서비스', G5_ADMIN_URL.'/service.php', 'cf_service');
3 changes: 1 addition & 2 deletions adm/admin.menu200.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@
array('200820', '접속자로그삭제', G5_ADMIN_URL.'/visit_delete.php', 'mb_delete', 1),
array('200200', '포인트관리', G5_ADMIN_URL.'/point_list.php', 'mb_point'),
array('200900', '투표관리', G5_ADMIN_URL.'/poll_list.php', 'mb_poll')
);
?>
);
3 changes: 1 addition & 2 deletions adm/admin.menu300.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@
array('300600', '내용관리', G5_ADMIN_URL.'/contentlist.php', 'scf_contents', 1),
array('300700', 'FAQ관리', G5_ADMIN_URL.'/faqmasterlist.php', 'scf_faq', 1),
array('300820', '글,댓글 현황', G5_ADMIN_URL.'/write_count.php', 'scf_write_count'),
);
?>
);
3 changes: 1 addition & 2 deletions adm/admin.menu400.shop_1of2.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,4 @@
array('400810', '쿠폰존관리', G5_ADMIN_URL.'/shop_admin/couponzonelist.php', 'scf_coupon_zone'),
array('400750', '추가배송비관리', G5_ADMIN_URL.'/shop_admin/sendcostlist.php', 'scf_sendcost', 1),
array('400410', '미완료주문', G5_ADMIN_URL.'/shop_admin/inorderlist.php', 'scf_inorder', 1),
);
?>
);
3 changes: 1 addition & 2 deletions adm/admin.menu500.shop_2of2.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@
array('500500', '배너관리', G5_ADMIN_URL.'/shop_admin/bannerlist.php', 'scf_banner', 1),
array('500140', '보관함현황', G5_ADMIN_URL.'/shop_admin/wishlist.php', 'sst_wish'),
array('500210', '가격비교사이트', G5_ADMIN_URL.'/shop_admin/price.php', 'sst_compare', 1)
);
?>
);
3 changes: 1 addition & 2 deletions adm/admin.menu900.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@
array('900700', '휴대폰번호 그룹', ''.G5_SMS5_ADMIN_URL.'/num_group.php' , 'hp_group', 1),
array('900800', '휴대폰번호 관리', ''.G5_SMS5_ADMIN_URL.'/num_book.php', 'hp_manage', 1),
array('900900', '휴대폰번호 파일', ''.G5_SMS5_ADMIN_URL.'/num_book_file.php' , 'hp_file', 1)
);
?>
);
3 changes: 1 addition & 2 deletions adm/admin.tail.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,5 +150,4 @@ function menu_rearrange(el)
</script>

<?php
include_once(G5_PATH.'/tail.sub.php');
?>
include_once(G5_PATH.'/tail.sub.php');
3 changes: 1 addition & 2 deletions adm/ajax.token.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@

$token = get_admin_token();

die(json_encode(array('error'=>'', 'token'=>$token, 'url'=>'')));
?>
die(json_encode(array('error'=>'', 'token'=>$token, 'url'=>'')));
3 changes: 1 addition & 2 deletions adm/ajax.use_captcha.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@

if( isset($_POST['admin_use_captcha']) ){
set_session('ss_admin_use_captcha', true);
}
?>
}
3 changes: 1 addition & 2 deletions adm/auth_list.php
Original file line number Diff line number Diff line change
Expand Up @@ -266,5 +266,4 @@ function fauthlist_submit(f)
</script>

<?php
include_once ('./admin.tail.php');
?>
include_once ('./admin.tail.php');
10 changes: 5 additions & 5 deletions adm/auth_list_delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
check_admin_token();

$count = (isset($_POST['chk']) && is_array($_POST['chk'])) ? count($_POST['chk']) : 0;
$post_act_button = isset($_POST['act_button']) ? clean_xss_tags($_POST['act_button'], 1, 1) : '';

if (!$count)
alert($_POST['act_button']." 하실 항목을 하나 이상 체크하세요.");
Expand All @@ -21,16 +22,15 @@
for ($i=0; $i<$count; $i++)
{
// 실제 번호를 넘김
$k = $chk[$i];
$k = isset($_POST['chk'][$i]) ? (int) $_POST['chk'][$i] : 0;

$mb_id = preg_replace('/[^a-zA-Z0-9_]/', '', $_POST['mb_id'][$k]);
$au_menu = preg_replace('/[^a-zA-Z0-9_]/', '', $_POST['au_menu'][$k]);
$mb_id = isset($_POST['mb_id'][$k]) ? preg_replace('/[^a-zA-Z0-9_]/', '', $_POST['mb_id'][$k]) : '';
$au_menu = isset($_POST['au_menu'][$k]) ? preg_replace('/[^a-zA-Z0-9_]/', '', $_POST['au_menu'][$k]) : '';

$sql = " delete from {$g5['auth_table']} where mb_id = '".$mb_id."' and au_menu = '".$au_menu."' ";
sql_query($sql);

run_event('adm_auth_delete_member', $mb_id, $au_menu);
}

goto_url('./auth_list.php?'.$qstr);
?>
goto_url('./auth_list.php?'.$qstr);
20 changes: 12 additions & 8 deletions adm/auth_update.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
include_once('./_common.php');
include_once(G5_LIB_PATH.'/mailer.lib.php');

$au_menu = isset($_POST['au_menu']) ? preg_replace('/[^0-9a-z_]/i', '', $_POST['au_menu']) : '';
$post_r = isset($_POST['r']) ? preg_replace('/[^0-9a-z_]/i', '', $_POST['r']) : '';
$post_w = isset($_POST['w']) ? preg_replace('/[^0-9a-z_]/i', '', $_POST['w']) : '';
$post_d = isset($_POST['d']) ? preg_replace('/[^0-9a-z_]/i', '', $_POST['d']) : '';

if ($is_admin != 'super')
alert('최고관리자만 접근 가능합니다.');

Expand All @@ -19,15 +24,15 @@
}

$sql = " insert into {$g5['auth_table']}
set mb_id = '{$_POST['mb_id']}',
au_menu = '{$_POST['au_menu']}',
au_auth = '{$_POST['r']},{$_POST['w']},{$_POST['d']}' ";
set mb_id = '$mb_id',
au_menu = '$au_menu',
au_auth = '{$post_r},{$post_w},{$post_d}' ";
$result = sql_query($sql, FALSE);
if (!$result) {
$sql = " update {$g5['auth_table']}
set au_auth = '{$_POST['r']},{$_POST['w']},{$_POST['d']}'
where mb_id = '{$_POST['mb_id']}'
and au_menu = '{$_POST['au_menu']}' ";
set au_auth = '{$post_r},{$post_w},{$post_d}'
where mb_id = '$mb_id'
and au_menu = '$au_menu' ";
sql_query($sql);
}

Expand All @@ -45,5 +50,4 @@

run_event('adm_auth_update', $mb);

goto_url('./auth_list.php?'.$qstr);
?>
goto_url('./auth_list.php?'.$qstr);
5 changes: 2 additions & 3 deletions adm/board_copy.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
$sub_menu = "300100";
include_once("./_common.php");

auth_check($auth[$sub_menu], 'w');
auth_check_menu($auth, $sub_menu, 'w');

$g5['title'] = '게시판 복사';
include_once(G5_PATH.'/head.sub.php');
Expand Down Expand Up @@ -82,5 +82,4 @@ function fboardcopy_check(f)


<?php
include_once(G5_PATH.'/tail.sub.php');
?>
include_once(G5_PATH.'/tail.sub.php');
7 changes: 3 additions & 4 deletions adm/board_copy_update.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

check_demo();

auth_check($auth[$sub_menu], 'w');
auth_check_menu($auth, $sub_menu, 'w');

check_admin_token();

$target_table = trim($_POST['target_table']);
$target_subject = trim($_POST['target_subject']);
$target_table = isset($_POST['target_table']) ? trim($_POST['target_table']) : '';
$target_subject = isset($_POST['target_subject']) ? trim($_POST['target_subject']) : '';

$target_subject = strip_tags(clean_xss_attributes($target_subject));

Expand Down Expand Up @@ -221,4 +221,3 @@
echo "<script>opener.document.location.reload();</script>";

alert("복사에 성공 했습니다.", './board_copy.php?bo_table='.$bo_table.'&amp;'.$qstr);
?>
3 changes: 1 addition & 2 deletions adm/board_delete.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,4 @@
delete_cache_latest($tmp_bo_table);

// 게시판 폴더 전체 삭제
rm_rf(G5_DATA_PATH.'/file/'.$tmp_bo_table);
?>
rm_rf(G5_DATA_PATH.'/file/'.$tmp_bo_table);
Loading

0 comments on commit 54f43f3

Please sign in to comment.