Compare commits

...
22 Commits
Author SHA1 Message Date
thisgun e0a42d8f46 버전 5.6.31 수정 2026-06-26 10:50:29 +00:00
thisgun 6c6787ec1f 상품 스킨 디렉토리 검증 보완 2026-06-26 10:40:28 +00:00
thisgunandClaude Opus 4.8 d419f430a9 [KVE-20206-1176]XSS 취약점 - 결제 전 주문 임시데이터 저장 요청 출처 검증 추가
- shop/ajax.orderdatasave.php에 check_request_origin() 적용하여
  외부 사이트발 자동 요청에 의한 임시 주문 데이터 교체 차단

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 07:10:24 +00:00
thisgunandClaude Opus 4.8 1a5661a995 접속자검색 접속경로 출력 시 속성값 이스케이프 보완
- vi_referer 디코딩 후 title 속성에 출력할 때 따옴표를 이스케이프하도록 보완

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 00:52:40 +00:00
thisgunandClaude Opus 4.8 8a5767dc70 [KVE-2026-1176]취약점수정 - 관리자 목록 정렬 파라미터 화이트리스트 적용 보완
- member_list·index·couponzonelist·inorderlist·personalpaylist의
  정렬 컬럼/방향 값을 허용 목록으로 제한하여 ORDER BY 절에 임의 값 삽입 차단
- 기존 다른 목록 파일과 동일한 in_array 화이트리스트 패턴 적용

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 00:48:42 +00:00
thisgunandClaude Opus 4.8 935ea84c7c [KVE-2026-1122]취약점 수정 - 주문·관리자·결제·소셜 등 사용자 입력 처리 보완
- 쿠폰/희망배송일/검색어/계정/결제 콜백 등 입력값을 SQL 컨텍스트에 맞게 재처리
- dt_data·PG 응답 등 비-GPC 값과 소셜 provider 입력 정제 보완

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 00:36:35 +00:00
thisgun 1cade844fb chore: allow CRLF in PHP whitespace checks 2026-06-22 08:30:20 +00:00
thisgun dfca17a599 버전 5.6.30 수정 2026-06-16 03:33:14 +00:00
thisgun 5ed691136d 나이스페이 가상계좌 취소금액 보정 2026-06-16 03:26:42 +00:00
thisgun cdda832081 Fix register form member defaults 2026-06-16 03:26:42 +00:00
thisgun 5374fb5f74 NHN KCP 본인확인 v2 설정 안내 보완 2026-06-16 03:17:44 +00:00
thisgun 16a8dca6f7 버전 5.6.29 수정 2026-06-09 02:34:30 +00:00
thisgun b00fc18275 Merge branch 'master' into tmp_install 2026-06-09 02:27:41 +00:00
thisgun 0c6ff731f6 관리권한 부여 목록에서 최고관리자 전용 메뉴 제외 2026-06-09 02:26:01 +00:00
thisgun 77835010df 메일 테스트 발송 안내 개선 2026-06-09 02:26:01 +00:00
thisgunandClaude Opus 4.8 33416852fc 나이스페이 가상계좌 채번 시 od_app_no 누락 수정
가상계좌(4100) 채번 시 od_app_no가 빈 AuthCode로 남아
입금통보 매칭(od_app_no = VbankNum)이 실패하던 문제 수정

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-09 01:34:33 +00:00
thisgun 3a4612420c Improve installer validation and error handling 2026-06-08 02:09:17 +00:00
thisgunandClaude Opus 4.8 6a55f1457d 현재접속자 처리 시 카운트 접근 null 보정 (PHP 8 호환)
html_process 의 접속자 처리에서 count 조회 결과 접근을 empty() 로
보정. 쿼리 실패 등 비정상 상황에서 빈 배열/undefined 키 접근으로
PHP 8.0+ 경고가 나는 경우를 예방. 동작 변화 없음.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 07:32:50 +00:00
thisgunandClaude Opus 4.8 76d83c2bae 게시판 정렬 필드 화이트리스트 검증 추가
게시판 설정의 bo_sort_field 가 허용 목록 검증 없이 저장·사용되어
목록 조회 ORDER BY 절에 임의 표현식이 들어갈 수 있던 문제 수정.
정렬값은 따옴표로 감싸지 않아 escape 로 막히지 않으므로,
게시판 관리 권한 계정이 저장한 값이 비로그인 목록 조회에서
실행될 수 있었음.

get_board_sort_fields() 의 허용 목록(관리자 드롭다운과 동일)으로
저장(adm/board_form_update.php)과 사용(bbs/list.php) 양쪽을 검증.
허용 목록 외 값은 기본 정렬로 무력화하여 이미 저장된 값도 차단.
function_exists 가드로 부분 패치 환경 대비.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 07:20:58 +00:00
thisgunandClaude Opus 4.8 afd8b35423 SMS 회원정보 업데이트 토큰 방식 불일치 수정
member_update.php 가 get_token()(HMAC) 으로 발급한 토큰을
member_update_run.php 가 check_admin_token()(세션) 으로 검증해
항상 불일치 → 오류 HTML 반환으로 AJAX JSON 파싱이 실패하던 문제 수정.

sms_admin 의 다른 _run 들과 동일하게 검증측(check_admin_token)은
유지하고, 실행 시 ajax.token.php 로 세션 토큰을 발급받아 본 요청에
사용하도록 변경. check_admin_token 의 1회용 소거 특성상 재실행에도
견고함.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-02 08:22:03 +00:00
thisgunandClaude Opus 4.8 e7c89675b6 회원관리/비디오 필터 null 인자 보정 (PHP 8.1 호환)
내장함수에 null 이 전달되어 PHP 8.1+ 에서 경고가 발생하던 것을
isset 삼항 / 문자열 캐스팅으로 보정.

- adm/member_form.php: number_format(mb_point), substr(mb_id) 2곳,
  substr(mp_register_day) — null/미정의 시 0 또는 빈 문자열 처리
- plugin/htmlpurifier/extend.video.php: strstr 인자 (string) 캐스팅

표시·동작 변화 없음. PHP 5.2~8.3 호환 유지(?? 미사용).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-02 07:55:39 +00:00
thisgun 10c6c18857 Fix JavaScript alert string escaping 2026-06-01 10:26:44 +00:00
90 changed files with 1370 additions and 495 deletions
+1
View File
@@ -1,2 +1,3 @@
.gitattributes export-ignore
.gitignore export-ignore
*.php whitespace=blank-at-eol,blank-at-eof,space-before-tab,cr-at-eol
+105 -1
View File
@@ -610,6 +610,110 @@ function admin_menu_find_by($call, $search_key)
return '';
}
function admin_menu_local_path($url)
{
$url = (string) $url;
if (!$url) {
return '';
}
$url = preg_replace('/[?#].*$/', '', $url);
$maps = array(
G5_ADMIN_URL => G5_ADMIN_PATH,
);
if (defined('G5_SMS5_ADMIN_URL') && defined('G5_SMS5_ADMIN_PATH')) {
$maps[G5_SMS5_ADMIN_URL] = G5_SMS5_ADMIN_PATH;
}
foreach ($maps as $base_url => $base_path) {
if (strpos($url, $base_url) !== 0) {
continue;
}
$path = $base_path.substr($url, strlen($base_url));
if (substr($path, -1) === '/') {
$path .= 'index.php';
}
return $path;
}
return '';
}
function admin_menu_is_super_only($menu_item)
{
static $cache = array();
$sub_menu = isset($menu_item[0]) ? (string) $menu_item[0] : '';
if (!$sub_menu) {
return false;
}
if (isset($cache[$sub_menu])) {
return $cache[$sub_menu];
}
// 향후 메뉴 정의에서 명시적으로 최고관리자 전용 표시가 필요할 때 사용한다.
if (isset($menu_item[4]) && $menu_item[4] === 'super') {
return $cache[$sub_menu] = true;
}
$path = admin_menu_local_path(isset($menu_item[2]) ? $menu_item[2] : '');
if (!$path || !is_readable($path)) {
return $cache[$sub_menu] = false;
}
$content = file_get_contents($path, false, null, 0, 12000);
if ($content === false) {
return $cache[$sub_menu] = false;
}
$pattern = '/if\s*\([^\)]*\$is_admin\s*(?:!==|!=)\s*[\'"]super[\'"][^\)]*\)\s*\{?[\s\S]{0,250}(?:alert|alert_close|die)\s*\([^\;]*(?:최고관리자만|최고관리자로)/u';
return $cache[$sub_menu] = (bool) preg_match($pattern, $content);
}
function admin_get_assignable_auth_menu()
{
global $menu;
$assignable_auth_menu = array();
if (!isset($menu) || !is_array($menu)) {
return $assignable_auth_menu;
}
foreach ($menu as $menu_group) {
if (!is_array($menu_group)) {
continue;
}
for ($i=1; $i<count($menu_group); $i++) {
if (!isset($menu_group[$i]) || !is_array($menu_group[$i])) {
continue;
}
$sub_menu = isset($menu_group[$i][0]) ? $menu_group[$i][0] : '';
if (!$sub_menu || $sub_menu === '-' || substr($sub_menu, -3) === '000') {
continue;
}
if (admin_menu_is_super_only($menu_group[$i])) {
continue;
}
$assignable_auth_menu[$sub_menu] = isset($menu_group[$i][1]) ? $menu_group[$i][1] : '';
}
}
return $assignable_auth_menu;
}
// 접근 권한 검사
if (!$member['mb_id']) {
alert('로그인 하십시오.', G5_BBS_URL . '/login.php?url=' . urlencode(correct_goto_url(G5_ADMIN_URL)));
@@ -698,4 +802,4 @@ if (run_replace('safe_admin_add_script_boolean', false) === false) {
$config['cf_analytics'] = '';
$config['cf_add_script'] = '';
$config['cf_add_meta'] = '';
}
}
+6 -4
View File
@@ -54,6 +54,8 @@ $listall = '<a href="' . $_SERVER['SCRIPT_NAME'] . '" class="ov_listall btn_ov02
$g5['title'] = "관리권한설정";
require_once './admin.head.php';
$assignable_auth_menu = admin_get_assignable_auth_menu();
$colspan = 5;
?>
@@ -105,8 +107,8 @@ $colspan = 5;
$is_continue = true;
}
// 메뉴번호가 바뀌는 경우에 현재 없는 저장된 메뉴는 삭제함
if (!isset($auth_menu[$row['au_menu']])) {
// 메뉴번호가 바뀌거나 권한 부여 대상이 아닌 메뉴는 삭제함
if (!isset($assignable_auth_menu[$row['au_menu']])) {
sql_query(" delete from {$g5['auth_table']} where au_menu = '{$row['au_menu']}' ");
$is_continue = true;
}
@@ -130,7 +132,7 @@ $colspan = 5;
<td class="td_auth_mbnick"><?php echo $mb_nick ?></td>
<td class="td_menu">
<?php echo $row['au_menu'] ?>
<?php echo $auth_menu[$row['au_menu']] ?>
<?php echo $assignable_auth_menu[$row['au_menu']] ?>
</td>
<td class="td_auth"><?php echo $row['au_auth'] ?></td>
</tr>
@@ -205,7 +207,7 @@ echo $pagelist;
<select id="au_menu" name="au_menu" required class="required">
<option value=''>선택하세요</option>
<?php
foreach ($auth_menu as $key => $value) {
foreach ($assignable_auth_menu as $key => $value) {
if (!(substr($key, -3) == '000' || $key == '-' || !$key)) {
echo '<option value="' . $key . '">' . $key . ' ' . $value . '</option>';
}
+5
View File
@@ -19,6 +19,11 @@ if (!(isset($mb['mb_id']) && $mb['mb_id'])) {
check_admin_token();
$assignable_auth_menu = admin_get_assignable_auth_menu();
if (!$au_menu || !isset($assignable_auth_menu[$au_menu])) {
alert('해당 메뉴는 관리권한을 부여할 수 없습니다.');
}
require_once G5_CAPTCHA_PATH . '/captcha.lib.php';
if (!chk_captcha()) {
+1 -1
View File
@@ -12,7 +12,7 @@ $bo_table = isset($_POST['bo_table']) ? substr(preg_replace('/[^a-z0-9_]/i
$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));
$target_subject = addslashes(strip_tags(clean_xss_attributes(stripslashes($target_subject))));
$file_copy = array();
+13 -3
View File
@@ -12,8 +12,8 @@ check_admin_token();
$gr_id = isset($_POST['gr_id']) ? preg_replace('/[^a-z0-9_]/i', '', (string)$_POST['gr_id']) : '';
$bo_admin = isset($_POST['bo_admin']) ? preg_replace('/[^a-z0-9_\, \|\#]/i', '', $_POST['bo_admin']) : '';
$bo_subject = isset($_POST['bo_subject']) ? strip_tags(clean_xss_attributes($_POST['bo_subject'])) : '';
$bo_mobile_subject = isset($_POST['bo_mobile_subject']) ? strip_tags(clean_xss_attributes($_POST['bo_mobile_subject'])) : '';
$bo_subject = isset($_POST['bo_subject']) ? addslashes(strip_tags(clean_xss_attributes(stripslashes($_POST['bo_subject'])))) : '';
$bo_mobile_subject = isset($_POST['bo_mobile_subject']) ? addslashes(strip_tags(clean_xss_attributes(stripslashes($_POST['bo_mobile_subject'])))) : '';
if (!$gr_id) {
alert('그룹 ID는 반드시 선택하세요.');
@@ -176,7 +176,17 @@ $bo_write_min = isset($_POST['bo_write_min']) ? (int) $_POST['bo_write_min'] : 0
$bo_write_max = isset($_POST['bo_write_max']) ? (int) $_POST['bo_write_max'] : 0;
$bo_comment_min = isset($_POST['bo_comment_min']) ? (int) $_POST['bo_comment_min'] : 0;
$bo_comment_max = isset($_POST['bo_comment_max']) ? (int) $_POST['bo_comment_max'] : 0;
$bo_sort_field = isset($_POST['bo_sort_field']) ? addslashes(clean_xss_tags(stripslashes($_POST['bo_sort_field']), 1, 1)) : '';
$bo_sort_field = isset($_POST['bo_sort_field']) ? trim(stripslashes($_POST['bo_sort_field'])) : '';
$bo_allowed_sort_field = array('');
if (function_exists('get_board_sort_fields')) {
foreach (get_board_sort_fields(isset($board) ? $board : array()) as $bo_sort_v) {
$bo_allowed_sort_field[] = $bo_sort_v[0];
}
}
if (!in_array($bo_sort_field, $bo_allowed_sort_field, true)) {
$bo_sort_field = '';
}
$bo_sort_field = addslashes($bo_sort_field);
if (strpbrk($bo_skin.$bo_mobile_skin, "?%*:|\"<>") !== false) {
alert('스킨 디렉토리명 오류!');
+1 -1
View File
@@ -46,7 +46,7 @@ if ($act_button === "선택수정") {
}
}
$p_bo_subject = is_array($_POST['bo_subject']) ? strip_tags(clean_xss_attributes($_POST['bo_subject'][$k])) : '';
$p_bo_subject = is_array($_POST['bo_subject']) ? addslashes(strip_tags(clean_xss_attributes(stripslashes($_POST['bo_subject'][$k])))) : '';
$sql = " update {$g5['board_table']}
set gr_id = '" . sql_real_escape_string($post_gr_id) . "',
+1 -1
View File
@@ -39,7 +39,7 @@ for ($i = 1; $i <= 10; $i++) {
foreach ($check_keys as $key => $value) {
if ($key === 'gr_subject') {
$posts[$key] = isset($_POST[$key]) ? strip_tags(clean_xss_attributes($_POST[$key])) : '';
$posts[$key] = isset($_POST[$key]) ? addslashes(strip_tags(clean_xss_attributes(stripslashes($_POST[$key])))) : '';
} else {
$posts[$key] = isset($_POST[$key]) ? $_POST[$key] : '';
}
+2 -2
View File
@@ -21,7 +21,7 @@ if (!$chk_count) {
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_subject = isset($_POST['gr_subject'][$k]) ? addslashes(strip_tags(clean_xss_attributes(stripslashes($_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;
@@ -36,7 +36,7 @@ for ($i = 0; $i < $chk_count; $i++) {
gr_order = '" . $gr_order . "'
where gr_id = '{$gr_id}' ";
if ($is_admin != 'super') {
$sql .= " and gr_admin = '{$gr_admin}' ";
$sql .= " and gr_admin = '" . sql_real_escape_string($gr_admin) . "' ";
}
sql_query($sql);
} elseif ($act_button == '선택삭제') {
+11 -5
View File
@@ -1072,14 +1072,14 @@ if ($config['cf_sms_use'] && $config['cf_icode_id'] && $config['cf_icode_pw']) {
</select>
<div id="cf_cert_hp_kcp_v2_notice" style="display:<?php echo ($config['cf_cert_hp'] == 'kcp_v2') ? 'block' : 'none'; ?>; margin-top:8px; padding:10px 12px; background:#fff8e1; border:1px solid #ffd54f; border-radius:4px; color:#5d4037; line-height:1.5;">
<strong>NHN KCP 휴대폰 본인확인(api_v2)</strong> 사용 시,<br>
NHN KCP 상점관리자 &gt; 부가서비스 &gt; 휴대폰본인확인 &gt; 연동방식 설정 에서 <strong>신규 연동방식(V2) 사용여부를 &lsquo;사용&rsquo;</strong> 으로 변경해야 정상 동작합니다.
NHN KCP 상점관리자 &gt; 부가서비스 &gt; 휴대폰본인확인 &gt; 연동방식 설정 에서 <strong>신규 연동방식(V2) 사용여부를 &lsquo;사용&rsquo;</strong> 으로 변경해야 정상 동작합니다.<br>
PHP 7.0 이상 환경에서만 동작하며, PHP 7.0 미만에서는 사용할 수 없습니다.
</div>
<script>
jQuery(function($){
function toggle_kcp_v2_notice() {
var is_kcp_v2 = $('#cf_cert_hp').val() === 'kcp_v2';
$('#cf_cert_hp_kcp_v2_notice').toggle(is_kcp_v2);
$('#cf_cert_kcp_cd_prefix').toggle(!is_kcp_v2);
}
$('#cf_cert_hp').on('change', toggle_kcp_v2_notice);
@@ -1121,9 +1121,15 @@ if ($config['cf_sms_use'] && $config['cf_icode_id'] && $config['cf_icode_pw']) {
<tr>
<th scope="row" class="cf_cert_service"><label for="cf_cert_kcp_cd">NHN KCP 사이트코드</label></th>
<td class="cf_cert_service">
<?php echo help('기존 NHN KCP 휴대폰 본인확인은 SM으로 시작하는 5자리 사이트 코드 중 뒤의 3자리만 입력해 주십시오.<br>NHN KCP 휴대폰 본인확인(api_v2)은 KCP에서 발급받은 5자리 사이트코드를 그대로 입력해 주십시오.<br>서비스에 가입되어 있지 않다면, 본인확인 서비스 신청페이지에서 서비스 신청 후 사이트코드를 발급 받으실 수 있습니다.') ?>
<span class="sitecode" id="cf_cert_kcp_cd_prefix" style="display:<?php echo ($config['cf_cert_hp'] == 'kcp_v2') ? 'none' : 'inline'; ?>;">SM</span>
<input type="text" name="cf_cert_kcp_cd" value="<?php echo get_sanitize_input($config['cf_cert_kcp_cd']); ?>" id="cf_cert_kcp_cd" class="frm_input" size="10" maxlength="10"> <a href="http://sir.kr/main/service/p_cert.php" target="_blank" class="btn_frmline">NHN KCP 휴대폰 본인확인 서비스 신청페이지</a>
<?php
$cf_cert_kcp_cd = get_sanitize_input($config['cf_cert_kcp_cd']);
if (preg_match('/^SM([A-Z0-9]{3})$/i', $cf_cert_kcp_cd, $matches)) {
$cf_cert_kcp_cd = $matches[1];
}
?>
<?php echo help('SM으로 시작하는 5자리 사이트 코드중 뒤의 3자리만 입력해 주십시오.<br>서비스에 가입되어 있지 않다면, 본인확인 서비스 신청페이지에서 서비스 신청 후 사이트코드를 발급 받으실 수 있습니다.') ?>
<span class="sitecode" id="cf_cert_kcp_cd_prefix">SM</span>
<input type="text" name="cf_cert_kcp_cd" value="<?php echo $cf_cert_kcp_cd; ?>" id="cf_cert_kcp_cd" class="frm_input" size="3" maxlength="3"> <a href="http://sir.kr/main/service/p_cert.php" target="_blank" class="btn_frmline">NHN KCP 휴대폰 본인확인 서비스 신청페이지</a>
</td>
</tr>
<tr>
+3 -3
View File
@@ -13,8 +13,8 @@ if ($is_admin != 'super') {
$sql = " select * from {$g5['config_table']} limit 1";
$ori_config = sql_fetch($sql);
$cf_title = isset($_POST['cf_title']) ? strip_tags(clean_xss_attributes($_POST['cf_title'])) : '';
$cf_admin = isset($_POST['cf_admin']) ? clean_xss_tags($_POST['cf_admin'], 1, 1) : '';
$cf_title = isset($_POST['cf_title']) ? addslashes(strip_tags(clean_xss_attributes(stripslashes($_POST['cf_title'])))) : '';
$cf_admin = isset($_POST['cf_admin']) ? safe_replace_regex($_POST['cf_admin']) : '';
$mb = get_member($cf_admin);
@@ -173,7 +173,7 @@ foreach ($check_keys as $k => $v) {
if (in_array($k, array('cf_analytics', 'cf_add_meta', 'cf_add_script', 'cf_stipulation', 'cf_privacy'))) {
$_POST[$k] = isset($_POST[$k]) ? $_POST[$k] : '';
} else {
$_POST[$k] = isset($_POST[$k]) ? strip_tags(clean_xss_attributes($_POST[$k])) : '';
$_POST[$k] = isset($_POST[$k]) ? addslashes(strip_tags(clean_xss_attributes(stripslashes($_POST[$k])))) : '';
}
}
}
+1 -1
View File
@@ -26,7 +26,7 @@ if ($w == "" || $w == "u") {
}
$co_id = isset($_REQUEST['co_id']) ? preg_replace('/[^a-z0-9_]/i', '', $_REQUEST['co_id']) : '';
$co_subject = isset($_POST['co_subject']) ? strip_tags(clean_xss_attributes($_POST['co_subject'])) : '';
$co_subject = isset($_POST['co_subject']) ? addslashes(strip_tags(clean_xss_attributes(stripslashes($_POST['co_subject'])))) : '';
$co_include_head = isset($_POST['co_include_head']) ? preg_replace(array("#[\\\]+$#", "#(<\?php|<\?)#i"), "", substr($_POST['co_include_head'], 0, 255)) : '';
$co_include_tail = isset($_POST['co_include_tail']) ? preg_replace(array("#[\\\]+$#", "#(<\?php|<\?)#i"), "", substr($_POST['co_include_tail'], 0, 255)) : '';
+1 -1
View File
@@ -20,7 +20,7 @@ check_admin_token();
$fm_id = isset($_REQUEST['fm_id']) ? (int) $_REQUEST['fm_id'] : 0;
$fm_himg_del = isset($_POST['fm_himg_del']) ? (int) $_POST['fm_himg_del'] : 0;
$fm_timg_del = isset($_POST['fm_timg_del']) ? (int) $_POST['fm_timg_del'] : 0;
$fm_subject = isset($_POST['fm_subject']) ? strip_tags(clean_xss_attributes($_POST['fm_subject'])) : '';
$fm_subject = isset($_POST['fm_subject']) ? addslashes(strip_tags(clean_xss_attributes(stripslashes($_POST['fm_subject'])))) : '';
$fm_head_html = isset($_POST['fm_head_html']) ? $_POST['fm_head_html'] : '';
$fm_tail_html = isset($_POST['fm_tail_html']) ? $_POST['fm_tail_html'] : '';
$fm_mobile_head_html = isset($_POST['fm_mobile_head_html']) ? $_POST['fm_mobile_head_html'] : '';
+4
View File
@@ -35,6 +35,10 @@ if (!auth_check_menu($auth, '200100', 'r', true)) {
$sod = "desc";
}
$allowed_sst = array('mb_datetime');
if ($sst && !in_array($sst, $allowed_sst)) $sst = 'mb_datetime';
if ($sod && !in_array(strtolower($sod), array('asc', 'desc'))) $sod = '';
$sql_order = " order by {$sst} {$sod} ";
$sql = " SELECT count(*) as cnt {$sql_common} {$sql_search} {$sql_order} ";
+1 -1
View File
@@ -11,7 +11,7 @@ auth_check_menu($auth, $sub_menu, 'w');
check_admin_token();
$ma_id = isset($_POST['ma_id']) ? (int) $_POST['ma_id'] : 0;
$ma_subject = isset($_POST['ma_subject']) ? strip_tags(clean_xss_attributes($_POST['ma_subject'])) : '';
$ma_subject = isset($_POST['ma_subject']) ? addslashes(strip_tags(clean_xss_attributes(stripslashes($_POST['ma_subject'])))) : '';
$ma_content = isset($_POST['ma_content']) ? $_POST['ma_content'] : '';
if ($w == '') {
+4 -4
View File
@@ -275,7 +275,7 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
<th scope="row"><label for="mb_level">회원 권한</label></th>
<td><?php echo get_member_level_select('mb_level', 1, $member['mb_level'], $mb['mb_level']) ?></td>
<th scope="row">포인트</th>
<td><a href="./point_list.php?sfl=mb_id&amp;stx=<?php echo $mb['mb_id'] ?>" target="_blank"><?php echo number_format($mb['mb_point']) ?></a> 점</td>
<td><a href="./point_list.php?sfl=mb_id&amp;stx=<?php echo $mb['mb_id'] ?>" target="_blank"><?php echo number_format(isset($mb['mb_point']) ? $mb['mb_point'] : 0) ?></a> 점</td>
</tr>
<tr>
<th scope="row"><label for="mb_email">E-mail<strong class="sound_only">필수</strong></label></th>
@@ -338,7 +338,7 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
<?php echo help('이미지 크기는 <strong>넓이 ' . $config['cf_member_icon_width'] . '픽셀 높이 ' . $config['cf_member_icon_height'] . '픽셀</strong>로 해주세요.') ?>
<input type="file" name="mb_icon" id="mb_icon">
<?php
$mb_dir = substr($mb['mb_id'], 0, 2);
$mb_dir = substr(isset($mb['mb_id']) ? $mb['mb_id'] : '', 0, 2);
$icon_file = G5_DATA_PATH . '/member/' . $mb_dir . '/' . get_mb_icon_name($mb['mb_id']) . '.gif';
if (file_exists($icon_file)) {
$icon_url = str_replace(G5_DATA_PATH, G5_DATA_URL, $icon_file);
@@ -355,7 +355,7 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
<?php echo help('이미지 크기는 <strong>넓이 ' . $config['cf_member_img_width'] . '픽셀 높이 ' . $config['cf_member_img_height'] . '픽셀</strong>로 해주세요.') ?>
<input type="file" name="mb_img" id="mb_img">
<?php
$mb_dir = substr($mb['mb_id'], 0, 2);
$mb_dir = substr(isset($mb['mb_id']) ? $mb['mb_id'] : '', 0, 2);
$icon_file = G5_DATA_PATH . '/member_image/' . $mb_dir . '/' . get_mb_icon_name($mb['mb_id']) . '.gif';
if (file_exists($icon_file)) {
echo get_member_profile_img($mb['mb_id']);
@@ -559,7 +559,7 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
<span class="provider_name"><?php echo $provider_name; //서비스이름 ?> ( <?php echo $account['displayname']; ?> )</span>
<span class="account_hidden" style="display:none"><?php echo $account['mb_id']; ?></span>
</div>
<div class="btn_info"><a href="<?php echo G5_SOCIAL_LOGIN_URL . '/unlink.php?mp_no=' . $account['mp_no'] ?>" class="social_unlink" data-provider="<?php echo $account['mp_no']; ?>">연동해제</a> <span class="sound_only"><?php echo substr($account['mp_register_day'], 2, 14); ?></span></div>
<div class="btn_info"><a href="<?php echo G5_SOCIAL_LOGIN_URL . '/unlink.php?mp_no=' . $account['mp_no'] ?>" class="social_unlink" data-provider="<?php echo $account['mp_no']; ?>">연동해제</a> <span class="sound_only"><?php echo substr(isset($account['mp_register_day']) ? $account['mp_register_day'] : '', 2, 14); ?></span></div>
</div>
<?php } //end foreach ?>
</li>
+4
View File
@@ -42,6 +42,10 @@ if (!$sst) {
$sod = "desc";
}
$allowed_sst = array('mb_datetime', 'mb_id', 'mb_name', 'mb_nick', 'mb_level', 'mb_point', 'mb_today_login', 'mb_open', 'mb_mailling', 'mb_sms', 'mb_adult', 'mb_certify', 'mb_email_certify', 'mb_intercept_date', 'mb_leave_date');
if ($sst && !in_array($sst, $allowed_sst)) $sst = 'mb_datetime';
if ($sod && !in_array(strtolower($sod), array('asc', 'desc'))) $sod = '';
$sql_order = " order by {$sst} {$sod} ";
$sql = " select count(*) as cnt {$sql_common} {$sql_search} {$sql_order} ";
+2 -2
View File
@@ -247,8 +247,8 @@ function member_export_build_where($params)
} else {
// 수신동의기간 직접 입력 - custom_period
$date_start = isset($params['agree_date_start']) ? $params['agree_date_start'] : '';
$date_end = isset($params['agree_date_end']) ? $params['agree_date_end'] : '';
$date_start = isset($params['agree_date_start']) ? sql_escape_string(trim($params['agree_date_start'])) : '';
$date_end = isset($params['agree_date_end']) ? sql_escape_string(trim($params['agree_date_end'])) : '';
if ($date_start && $date_end) {
$emailDateCond = "mb_mailling_date BETWEEN '{$date_start} 00:00:00' AND '{$date_end} 23:59:59'";
+1 -1
View File
@@ -30,7 +30,7 @@ for ($i = 0; $i < $count; $i++) {
$code = is_array($_POST['code']) ? strip_tags($_POST['code'][$i]) : '';
$me_name = is_array($_POST['me_name']) ? strip_tags($_POST['me_name'][$i]) : '';
$me_link = (preg_match('/^javascript/i', $_POST['me_link'][$i]) || preg_match('/script:/i', $_POST['me_link'][$i])) ? G5_URL : strip_tags(clean_xss_attributes($_POST['me_link'][$i]));
$me_link = (preg_match('/^javascript/i', $_POST['me_link'][$i]) || preg_match('/script:/i', $_POST['me_link'][$i])) ? G5_URL : addslashes(strip_tags(clean_xss_attributes(stripslashes($_POST['me_link'][$i]))));
if (!$code || !$me_name || !$me_link) {
continue;
+2 -2
View File
@@ -16,7 +16,7 @@ if ($w == 'd') {
check_admin_token();
$nw_subject = isset($_POST['nw_subject']) ? strip_tags(clean_xss_attributes($_POST['nw_subject'])) : '';
$nw_subject = isset($_POST['nw_subject']) ? addslashes(strip_tags(clean_xss_attributes(stripslashes($_POST['nw_subject'])))) : '';
$posts = array();
$check_keys = array(
@@ -37,7 +37,7 @@ foreach ($check_keys as $key => $val) {
if ($val === 'int') {
$posts[$key] = isset($_POST[$key]) ? (int) $_POST[$key] : 0;
} elseif ($val === 'str') {
$posts[$key] = isset($_POST[$key]) ? clean_xss_tags($_POST[$key], 1, 1) : 0;
$posts[$key] = isset($_POST[$key]) ? addslashes(clean_xss_tags(stripslashes($_POST[$key]), 1, 1)) : 0;
} else {
$posts[$key] = isset($_POST[$key]) ? trim($_POST[$key]) : 0;
}
+7 -2
View File
@@ -43,11 +43,16 @@ foreach ($_POST as $key => $value) {
}
if (in_array($key, $check_keys)) {
$_POST[$key] = strip_tags(clean_xss_attributes($value));
if (preg_match('/^po_cnt[1-9]$/', $key) || in_array($key, array('po_level', 'po_point', 'po_id'), true)) {
$_POST[$key] = (int) $value;
} else {
$_POST[$key] = addslashes(strip_tags(clean_xss_attributes(stripslashes($value))));
}
}
}
$po_id = isset($_POST['po_id']) ? $_POST['po_id'] : '';
$po_id = isset($_POST['po_id']) ? (int) $_POST['po_id'] : 0;
$_POST['po_use'] = isset($_POST['po_use']) ? (int) $_POST['po_use'] : 0;
if ($w == '') {
$sql = " insert {$g5['poll_table']}
+1 -1
View File
@@ -15,7 +15,7 @@ $qaconfig = get_qa_config();
$check_keys = array('qa_title', 'qa_category', 'qa_skin', 'qa_mobile_skin', 'qa_use_email', 'qa_req_email', 'qa_use_hp', 'qa_req_hp', 'qa_use_sms', 'qa_send_number', 'qa_admin_hp', 'qa_admin_email', 'qa_subject_len', 'qa_mobile_subject_len', 'qa_page_rows', 'qa_mobile_page_rows', 'qa_image_width', 'qa_upload_size');
foreach ($check_keys as $key) {
$$key = $_POST[$key] = isset($_POST[$key]) ? strip_tags(clean_xss_attributes($_POST[$key])) : '';
$$key = $_POST[$key] = isset($_POST[$key]) ? addslashes(strip_tags(clean_xss_attributes(stripslashes($_POST[$key])))) : '';
}
$qa_include_head = isset($qa_include_head) ? preg_replace(array("#[\\\]+$#", "#(<\?php|<\?)#i"), "", substr($qa_include_head, 0, 255)) : '';
+56 -24
View File
@@ -20,33 +20,65 @@ if (isset($_POST['email'])) {
$_POST['email'] = strip_tags($_POST['email']);
$email = explode(',', $_POST['email']);
$real_email = array();
$sent_email = array(); // 발송 요청 성공
$failed_email = array(); // 발송 실패 (메일 서버에서 거부/오류)
for ($i=0; $i<count($email); $i++){
if (!preg_match("/([0-9a-zA-Z_-]+)@([0-9a-zA-Z_-]+)\.([0-9a-zA-Z_-]+)/", $email[$i])) continue;
$real_email[] = $email[$i];
mailer($config['cf_admin_email_name'], $config['cf_admin_email'], trim($email[$i]), '[메일검사] 제목', '<span style="font-size:9pt;">[메일검사] 내용<p>이 내용이 제대로 보인다면 보내는 메일 서버에는 이상이 없는것입니다.<p>'.G5_TIME_YMDHIS.'<p>이 메일 주소로는 회신되지 않습니다.</span>', 1);
$to = trim($email[$i]);
$send_result = mailer($config['cf_admin_email_name'], $config['cf_admin_email'], $to, '[메일검사] 제목', '<span style="font-size:9pt;">[메일검사] 내용<p>이 내용이 제대로 보인다면 보내는 메일 서버에는 이상이 없는것입니다.<p>'.G5_TIME_YMDHIS.'<p>이 메일 주소로는 회신되지 않습니다.</span>', 1);
if ($send_result) {
$sent_email[] = $to;
} else {
$failed_email[] = $to;
}
}
if( $real_email ){
if( $sent_email || $failed_email ){
echo '<section>';
echo '<h2>결과메세지</h2>';
echo '<div class="local_desc01 local_desc"><p>';
echo '다음 '.count($real_email).'개의 메일 주소로 테스트 메일 발송이 완료되었습니다.';
echo '</p></div>';
echo '<ul>';
for ($i=0;$i<count($real_email);$i++) {
echo '<li>'.$real_email[$i].'</li>';
echo '<h2>결과 메시지</h2>';
if( $sent_email ){
echo '<div class="local_desc01 local_desc"><p>';
echo '다음 '.count($sent_email).'개의 메일 주소로 테스트 메일 <strong>발송 요청이 성공</strong>했습니다. <strong>수신함 도착 여부는 별도 확인이 필요합니다.</strong>';
echo '</p></div>';
echo '<ul>';
for ($i=0;$i<count($sent_email);$i++) {
echo '<li>'.get_text($sent_email[$i]).'</li>';
}
echo '</ul>';
echo '<div class="local_desc02 local_desc"><p>';
echo '<strong>발송 요청 성공은 사이트가 메일 서버에 메일을 넘겼다는 의미이며, 받은편지함 도착을 보장하지는 않습니다.</strong><br>';
echo '메일이 보이지 않는다면 아래 항목을 순서대로 확인해 주십시오.';
echo '</p></div>';
echo '<ol>';
echo '<li>받은편지함뿐 아니라 <strong>스팸함, 정크메일함, 프로모션함</strong>을 확인합니다.</li>';
echo '<li>네이버, 지메일, 회사메일 등 <strong>서로 다른 메일 주소</strong>로 다시 테스트합니다.</li>';
echo '<li>관리자 메일 주소가 사이트 도메인과 같은지 확인합니다. 도메인이 다르면 스팸으로 분류될 가능성이 높습니다.</li>';
echo '<li>도메인 메일을 사용한다면 <strong>SPF, DKIM, DMARC</strong> 설정을 확인합니다.</li>';
echo '<li>계속 도착하지 않으면 서버 개발자에게 메일 발송 로그를 확인해주세요.</li>';
echo '</ol>';
}
echo '</ul>';
echo '<div class="local_desc02 local_desc"><p>';
echo '해당 주소로 테스트 메일이 도착했는지 확인해 주십시오.<br>';
echo '만약, 테스트 메일이 오지 않는다면 더 다양한 계정의 메일 주소로 메일을 보내 보십시오.<br>';
echo '그래도 메일이 하나도 도착하지 않는다면 메일 서버(sendmail server)의 오류일 가능성이 높으니, 웹 서버관리자에게 문의하여 주십시오.<br>';
echo '도메인을 소유하고 있을시 SPF, DKIM 설정이 필요할수 있습니다.<br>';
echo '</p></div>';
if( $failed_email ){
echo '<div class="local_desc01 local_desc" style="color:#d9534f"><p>';
echo '다음 '.count($failed_email).'개의 메일 주소는 <strong>발송에 실패</strong>했습니다.';
echo '</p></div>';
echo '<ul>';
for ($i=0;$i<count($failed_email);$i++) {
echo '<li>'.get_text($failed_email[$i]).'</li>';
}
echo '</ul>';
echo '<div class="local_desc02 local_desc"><p>';
echo '발송 실패는 받는 사람의 문제가 아니라 <strong>보내는 서버(메일 발송) 설정 문제</strong>일 가능성이 높습니다.<br>';
echo 'SMTP 정보(주소/포트/인증)가 올바른지, 서버에서 메일 발송(sendmail/mail 함수)이 허용되어 있는지 확인하시고, 웹 서버 관리자(호스팅 업체)에게 문의해 주십시오.<br>';
echo '자세한 오류 내용은 서버의 PHP error_log 에 기록됩니다.<br>';
echo '</p></div>';
}
echo '</section>';
}
}
@@ -56,11 +88,11 @@ if (isset($_POST['email'])) {
<h2>테스트 메일 발송</h2>
<div class="local_desc02 local_desc">
<p>
메일서버가 정상적으로 동작 중인지 확인할 수 있습니다.<br>
사이트에서 메일 서버로 메일을 전달할 수 있는지 확인합니다. 이 테스트는 받은편지함 도착을 보장하지 않습니다.<br>
아래 입력칸에 테스트 메일을 발송하실 메일 주소를 입력하시면, [메일검사] 라는 제목으로 테스트 메일을 발송합니다.<br>
보내는 메일주소 : <?php echo get_sanitize_input($config['cf_admin_email']); ?><br>
<?php if (function_exists('domain_mail_host') && $config['cf_admin_email'] && stripos($config['cf_admin_email'], domain_mail_host()) === false) { ?>
<?php echo '외부메일설정이나 기타 설정을 하지 않았다면, 도메인과 다른 헤더로 여겨 스팸이나 차단될 가능성이 있습니다.<br>기본환경설정에서 관리자 메일 주소를 name'.domain_mail_host().' 과 같은 도메인 형식으로 설정할것을 권장합니다.'; ?>
<?php echo '외부메일설정이나 기타 설정을 하지 않았다면, 도메인과 다른 헤더로 여겨 스팸이나 차단될 가능성이 있습니다.<br>외부메일설정이나 기타 설정을 하지 않았다면, 기본환경설정에서 관리자 메일 주소를 name'.domain_mail_host().' 과 같은 도메인 형식으로 설정할것을 권장합니다.'; ?>
<?php } ?>
</p>
</div>
@@ -75,11 +107,11 @@ if (isset($_POST['email'])) {
</form>
<div class="local_desc02 local_desc">
<p>
만약 [메일검사] 라는 내용으로 테스트 메일이 도착하지 않는다면 보내는 메일서버 혹은 받는 메일서버 중 문제가 발생했을 가능성이 있습니다.<br>
따라서 보다 정확한 테스트를 원하신다면 여러 곳으로 테스트 메일을 발송하시기 바랍니다.<br>
테스트 결과가 발송 요청 성공으로 표시되어도 수신 메일 서버의 스팸 정책에 따라 도착하지 않을 수 있습니다.<br>
정확한 확인을 위해 여러 메일 서비스로 테스트하고, 도착하지 않으면 스팸함과 도메인 인증(SPF, DKIM, DMARC)을 확인해 주십시오.<br>
</p>
</div>
</section>
<?php
include_once('./admin.tail.php');
include_once('./admin.tail.php');
+40 -1
View File
@@ -1,6 +1,45 @@
<?php
if (!defined('_GNUBOARD_')) exit;
function get_shop_skin_dirs($is_mobile=false)
{
global $config;
$skin_path = $is_mobile ? G5_MOBILE_PATH.'/'.G5_SKIN_DIR : G5_SKIN_PATH;
$skins = get_skin_dir('shop', $skin_path);
if(defined('G5_THEME_PATH') && $config['cf_theme']) {
$theme_skin_path = $is_mobile ? G5_THEME_MOBILE_PATH.'/'.G5_SKIN_DIR : G5_THEME_PATH.'/'.G5_SKIN_DIR;
$dirs = get_skin_dir('shop', $theme_skin_path);
if(!empty($dirs)) {
foreach($dirs as $dir) {
$skins[] = 'theme/'.$dir;
}
}
}
return $skins;
}
function check_shop_skin_dir($skin_dir, $label, $is_mobile=false)
{
if( $skin_dir === '' ) {
return;
}
if( preg_match('#\.+(\/|\\\)#', $skin_dir) ){
alert($label.' 폴더명에 포함될수 없는 문자가 들어있습니다.');
}
if( ! is_include_path_check($skin_dir, 1) ){
alert('오류 : 데이터폴더가 포함된 path 또는 잘못된 path 를 포함할수 없습니다.');
}
if( ! in_array($skin_dir, get_shop_skin_dirs($is_mobile), true) ){
alert($label.'을 올바르게 선택해 주십시오.');
}
}
// 상품옵션별재고 또는 상품재고에 더하기
function add_io_stock($it_id, $ct_qty, $io_id="", $io_type=0)
{
@@ -241,4 +280,4 @@ function check_order_inicis_tmps(){
set_cookie('admin_visit_time', G5_SERVER_TIME, 3600); //1시간 간격으로 체크
}
} //end function check_order_inicis_tmps;
} //end function check_order_inicis_tmps;
+7 -7
View File
@@ -20,14 +20,14 @@ $bn_bimg = isset($_FILES['bn_bimg']['tmp_name']) ? $_FILES['bn_bimg']['tmp_
$bn_bimg_name = isset($_FILES['bn_bimg']['name']) ? $_FILES['bn_bimg']['name'] : '';
$bn_id = isset($_REQUEST['bn_id']) ? preg_replace('/[^0-9]/', '', $_REQUEST['bn_id']) : 0;
$bn_bimg_del = (isset($_POST['bn_bimg_del']) && $_POST['bn_bimg_del']) ? preg_replace('/[^0-9]/', '', $_POST['bn_id']) : 0;
$bn_url = isset($_POST['bn_url']) ? strip_tags(clean_xss_attributes($bn_url)) : '';
$bn_alt = isset($_POST['bn_alt']) ? strip_tags(clean_xss_attributes($bn_alt)) : '';
$bn_device = isset($_POST['bn_device']) ? clean_xss_tags($_POST['bn_device'], 1, 1) : '';
$bn_position = isset($_POST['bn_position']) ? clean_xss_tags($_POST['bn_position'], 1, 1) : '';
$bn_url = isset($_POST['bn_url']) ? addslashes(strip_tags(clean_xss_attributes(stripslashes($_POST['bn_url'])))) : '';
$bn_alt = isset($_POST['bn_alt']) ? addslashes(strip_tags(clean_xss_attributes(stripslashes($_POST['bn_alt'])))) : '';
$bn_device = isset($_POST['bn_device']) ? safe_replace_regex($_POST['bn_device']) : '';
$bn_position = isset($_POST['bn_position']) ? addslashes(clean_xss_tags(stripslashes($_POST['bn_position']), 1, 1)) : '';
$bn_border = isset($_POST['bn_border']) ? (int) $_POST['bn_border'] : 0;
$bn_new_win = isset($_POST['bn_new_win']) ? (int) $_POST['bn_new_win'] : 0;
$bn_begin_time = isset($_POST['bn_begin_time']) ? clean_xss_tags($_POST['bn_begin_time'], 1, 1) : '';
$bn_end_time = isset($_POST['bn_end_time']) ? clean_xss_tags($_POST['bn_end_time'], 1, 1) : '';
$bn_begin_time = isset($_POST['bn_begin_time']) ? safe_replace_regex($_POST['bn_begin_time'], 'time') : '';
$bn_end_time = isset($_POST['bn_end_time']) ? safe_replace_regex($_POST['bn_end_time'], 'time') : '';
$bn_order = isset($_POST['bn_order']) ? (int) $_POST['bn_order'] : 0;
if ($bn_bimg_del) @unlink(G5_DATA_PATH."/banner/$bn_id");
@@ -99,4 +99,4 @@ if ($w == "" || $w == "u")
goto_url("./bannerform.php?w=u&amp;bn_id=$bn_id");
} else {
goto_url("./bannerlist.php");
}
}
+3 -3
View File
@@ -75,7 +75,7 @@ foreach( $check_str_keys as $key=>$val ){
if( $val === 'int' ){
$value = isset($_POST[$key]) ? (int) $_POST[$key] : 0;
} else {
$value = isset($_POST[$key]) ? clean_xss_tags($_POST[$key], 1, 1) : '';
$value = isset($_POST[$key]) ? addslashes(clean_xss_tags(stripslashes($_POST[$key]), 1, 1)) : '';
}
$$key = $_POST[$key] = $value;
}
@@ -123,7 +123,7 @@ if ($w == "" || $w == "u")
$sql = " select mb_id from {$g5['member_table']} where mb_id = '$ca_mb_id' ";
$row = sql_fetch($sql);
if (!$row['mb_id'])
alert("\'$ca_mb_id\' 은(는) 존재하는 회원아이디가 아닙니다.");
alert("'$ca_mb_id' 은(는) 존재하는 회원아이디가 아닙니다.");
}
}
@@ -256,4 +256,4 @@ if ($w == "" || $w == "u")
goto_url("./categoryform.php?w=u&amp;ca_id=$ca_id&amp;$qstr");
} else {
goto_url("./categorylist.php?$qstr");
}
}
+3 -3
View File
@@ -19,7 +19,7 @@ for ($i=0; $i<$post_ca_id_count; $i++)
$sql = " select mb_id from {$g5['member_table']} where mb_id = '".sql_real_escape_string($str_ca_mb_id)."' ";
$row = sql_fetch($sql);
if (!$row['mb_id'])
alert("\'{$str_ca_mb_id}\' 은(는) 존재하는 회원아이디가 아닙니다.", "./categorylist.php?$qstr");
alert("'{$str_ca_mb_id}' 은(는) 존재하는 회원아이디가 아닙니다.", "./categorylist.php?$qstr");
}
$check_files = array();
@@ -62,7 +62,7 @@ for ($i=0; $i<$post_ca_id_count; $i++)
}
}
$p_ca_name = is_array($_POST['ca_name']) ? strip_tags(clean_xss_attributes($_POST['ca_name'][$i])) : '';
$p_ca_name = is_array($_POST['ca_name']) ? addslashes(strip_tags(clean_xss_attributes(stripslashes($_POST['ca_name'][$i])))) : '';
$posts = array();
@@ -94,4 +94,4 @@ for ($i=0; $i<$post_ca_id_count; $i++)
}
goto_url("./categorylist.php?$qstr");
goto_url("./categorylist.php?$qstr");
+3 -3
View File
@@ -247,9 +247,9 @@ $check_sanitize_keys = array(
foreach( $check_sanitize_keys as $key ){
if( in_array($key, array('de_bank_account')) ){
$$key = isset($_POST[$key]) ? clean_xss_tags($_POST[$key], 1, 1, 0, 0) : '';
$$key = isset($_POST[$key]) ? addslashes(clean_xss_tags(stripslashes($_POST[$key]), 1, 1, 0, 0)) : '';
} else {
$$key = isset($_POST[$key]) ? clean_xss_tags($_POST[$key], 1, 1) : '';
$$key = isset($_POST[$key]) ? addslashes(clean_xss_tags(stripslashes($_POST[$key]), 1, 1)) : '';
}
}
@@ -480,4 +480,4 @@ if( $warning_msg ){
alert($warning_msg, "./configform.php");
} else {
goto_url("./configform.php");
}
}
+2 -2
View File
@@ -4,7 +4,7 @@ include_once('./_common.php');
auth_check_menu($auth, $sub_menu, "w");
$cp_id = isset($_REQUEST['cp_id']) ? clean_xss_tags($_REQUEST['cp_id'], 1, 1) : '';
$cp_id = isset($_REQUEST['cp_id']) ? safe_replace_regex($_REQUEST['cp_id'], 'cp_id') : '';
$cp = array(
'cp_method'=>'',
'cp_subject'=>'',
@@ -292,4 +292,4 @@ function form_check(f)
</script>
<?php
include_once (G5_ADMIN_PATH.'/admin.tail.php');
include_once (G5_ADMIN_PATH.'/admin.tail.php');
+4 -2
View File
@@ -6,6 +6,8 @@ auth_check_menu($auth, $sub_menu, "w");
check_admin_token();
$cp_id = isset($_REQUEST['cp_id']) ? safe_replace_regex($_REQUEST['cp_id'], 'cp_id') : '';
$_POST = array_map('trim', $_POST);
$check_sanitize_keys = array(
@@ -25,7 +27,7 @@ $check_sanitize_keys = array(
);
foreach( $check_sanitize_keys as $key ){
$$key = $_POST[$key] = isset($_POST[$key]) ? strip_tags(clean_xss_attributes($_POST[$key])) : '';
$$key = $_POST[$key] = isset($_POST[$key]) ? addslashes(strip_tags(clean_xss_attributes(stripslashes($_POST[$key])))) : '';
}
if(!$_POST['cp_subject'])
@@ -264,4 +266,4 @@ if ($w == '' && (isset($_POST['cp_sms_send']) || isset($_POST['cp_email_send']))
}
}
goto_url('./couponlist.php');
goto_url('./couponlist.php');
+4 -2
View File
@@ -6,6 +6,8 @@ auth_check_menu($auth, $sub_menu, "w");
check_admin_token();
$cz_id = isset($_REQUEST['cz_id']) ? (int) $_REQUEST['cz_id'] : 0;
@mkdir(G5_DATA_PATH."/coupon", G5_DIR_PERMISSION);
@chmod(G5_DATA_PATH."/coupon", G5_DIR_PERMISSION);
@@ -28,7 +30,7 @@ $check_sanitize_keys = array(
);
foreach( $check_sanitize_keys as $key ){
$$key = $_POST[$key] = isset($_POST[$key]) ? strip_tags(clean_xss_attributes($_POST[$key])) : '';
$$key = $_POST[$key] = isset($_POST[$key]) ? addslashes(strip_tags(clean_xss_attributes(stripslashes($_POST[$key])))) : '';
}
if(!$_POST['cz_subject'])
@@ -150,4 +152,4 @@ if($_FILES['cp_img']['tmp_name']) {
sql_query($sql);
}
goto_url('./couponzonelist.php?'.$qstr);
goto_url('./couponzonelist.php?'.$qstr);
+3
View File
@@ -15,6 +15,9 @@ if (!$sst) {
$sst = "cz_id";
$sod = "desc";
}
$allowed_sst = array('cz_id');
if ($sst && !in_array($sst, $allowed_sst)) $sst = 'cz_id';
if ($sod && !in_array(strtolower($sod), array('asc', 'desc'))) $sod = '';
$sql_order = " order by {$sst} {$sod} ";
$sql = " select count(*) as cnt
+9 -7
View File
@@ -20,6 +20,8 @@ if (!$od['od_id']) {
// 주문정보
$data = unserialize(base64_decode($od['dt_data']));
$data_od_cp_id = isset($data['od_cp_id']) ? safe_replace_regex($data['od_cp_id'], 'cp_id') : '';
$data_sc_cp_id = isset($data['sc_cp_id']) ? safe_replace_regex($data['sc_cp_id'], 'cp_id') : '';
$sql_common = " from {$g5['g5_shop_cart_table']} where od_id = '{$od['cart_id']}' and ct_status = '쇼핑' and ct_select = '1' ";
@@ -38,8 +40,8 @@ if($od['mb_id']) {
$it_cp_cnt = (isset($data['cp_id']) && is_array($data['cp_id'])) ? count($data['cp_id']) : 0;
$arr_it_cp_prc = array();
for($i=0; $i<$it_cp_cnt; $i++) {
$cid = $data['cp_id'][$i];
$it_id = $data['it_id'][$i];
$cid = isset($data['cp_id'][$i]) ? safe_replace_regex($data['cp_id'][$i], 'cp_id') : '';
$it_id = isset($data['it_id'][$i]) ? safe_replace_regex($data['it_id'][$i], 'it_id') : '';
$sql = " select cp_id, cp_method, cp_target, cp_type, cp_price, cp_trunc, cp_minimum, cp_maximum
from {$g5['g5_shop_coupon_table']}
where cp_id = '$cid'
@@ -98,10 +100,10 @@ if($od['mb_id']) {
$tot_od_price -= $tot_it_cp_price;
// 주문쿠폰
if(isset($data['od_cp_id']) && $data['od_cp_id']) {
if($data_od_cp_id) {
$sql = " select cp_id, cp_type, cp_price, cp_trunc, cp_minimum, cp_maximum
from {$g5['g5_shop_coupon_table']}
where cp_id = '{$data['od_cp_id']}'
where cp_id = '$data_od_cp_id'
and mb_id IN ( '{$od['mb_id']}', '전체회원' )
and cp_method = '2' ";
$cp = sql_fetch($sql);
@@ -134,10 +136,10 @@ $od_send_cost = get_sendcost($od['cart_id']);
$tot_sc_cp_price = 0;
if($od['mb_id'] && $od_send_cost > 0) {
// 배송쿠폰
if($data['sc_cp_id']) {
if($data_sc_cp_id) {
$sql = " select cp_id, cp_type, cp_price, cp_trunc, cp_minimum, cp_maximum
from {$g5['g5_shop_coupon_table']}
where cp_id = '{$data['sc_cp_id']}'
where cp_id = '$data_sc_cp_id'
and mb_id IN ( '{$od['mb_id']}', '전체회원' )
and cp_method = '3' ";
$cp = sql_fetch($sql);
@@ -571,4 +573,4 @@ function del_confirm()
</script>
<?php
include_once(G5_ADMIN_PATH.'/admin.tail.php');
include_once(G5_ADMIN_PATH.'/admin.tail.php');
+25 -17
View File
@@ -30,6 +30,8 @@ if($w == 'd') {
// 주문정보
$data = unserialize(base64_decode($od['dt_data']));
$data_od_cp_id = isset($data['od_cp_id']) ? safe_replace_regex($data['od_cp_id'], 'cp_id') : '';
$data_sc_cp_id = isset($data['sc_cp_id']) ? safe_replace_regex($data['sc_cp_id'], 'cp_id') : '';
$sql_common = " from {$g5['g5_shop_cart_table']} where od_id = '{$od['cart_id']}' and ct_status = '쇼핑' ";
@@ -53,8 +55,8 @@ if($od['mb_id']) {
$it_cp_cnt = (isset($data['cp_id']) && is_array($data['cp_id'])) ? count($data['cp_id']) : 0;
$arr_it_cp_prc = array();
for($i=0; $i<$it_cp_cnt; $i++) {
$cid = $data['cp_id'][$i];
$it_id = $data['it_id'][$i];
$cid = isset($data['cp_id'][$i]) ? safe_replace_regex($data['cp_id'][$i], 'cp_id') : '';
$it_id = isset($data['it_id'][$i]) ? safe_replace_regex($data['it_id'][$i], 'it_id') : '';
$sql = " select cp_id, cp_method, cp_target, cp_type, cp_price, cp_trunc, cp_minimum, cp_maximum
from {$g5['g5_shop_coupon_table']}
where cp_id = '$cid'
@@ -113,10 +115,10 @@ if($od['mb_id']) {
$tot_od_price -= $tot_it_cp_price;
// 주문쿠폰
if(isset($data['od_cp_id']) && $data['od_cp_id']) {
if($data_od_cp_id) {
$sql = " select cp_id, cp_type, cp_price, cp_trunc, cp_minimum, cp_maximum
from {$g5['g5_shop_coupon_table']}
where cp_id = '{$data['od_cp_id']}'
where cp_id = '$data_od_cp_id'
and mb_id IN ( '{$od['mb_id']}', '전체회원' )
and cp_method = '2' ";
$cp = sql_fetch($sql);
@@ -149,10 +151,10 @@ $od_send_cost = get_sendcost($od['cart_id']);
$tot_sc_cp_price = 0;
if($od['mb_id'] && $od_send_cost > 0) {
// 배송쿠폰
if($data['sc_cp_id']) {
if($data_sc_cp_id) {
$sql = " select cp_id, cp_type, cp_price, cp_trunc, cp_minimum, cp_maximum
from {$g5['g5_shop_coupon_table']}
where cp_id = '{$data['sc_cp_id']}'
where cp_id = '$data_sc_cp_id'
and mb_id IN ( '{$od['mb_id']}', '전체회원' )
and cp_method = '3' ";
$cp = sql_fetch($sql);
@@ -240,10 +242,10 @@ $od_receipt_point = $od_temp_point;
$od_receipt_time = $od['dt_time'];
$od_misu = 0;
$od_status = '입금';
$od_bank_account = isset($data['od_bank_account']) ? clean_xss_tags($data['od_bank_account'], 1, 1) : '';
$od_bank_account = isset($data['od_bank_account']) ? addslashes(clean_xss_tags(stripslashes($data['od_bank_account']), 1, 1)) : '';
$od_tno = '';
$od_app_no = '';
$od_hope_date = isset($data['od_hope_date']) ? clean_xss_tags($data['od_hope_date'], 1, 1) : '';
$od_hope_date = isset($data['od_hope_date']) ? addslashes(clean_xss_tags(stripslashes($data['od_hope_date']), 1, 1)) : '';
// 주문서에 입력
$sql = " insert {$g5['g5_shop_order_table']}
@@ -321,8 +323,8 @@ if ($od['mb_id'] && $od_receipt_point)
if($od['mb_id']) {
$it_cp_cnt = (isset($data['cp_id']) && is_array($data['cp_id'])) ? count($data['cp_id']) : 0;
for($i=0; $i<$it_cp_cnt; $i++) {
$cid = $data['cp_id'][$i];
$cp_it_id = $data['it_id'][$i];
$cid = isset($data['cp_id'][$i]) ? safe_replace_regex($data['cp_id'][$i], 'cp_id') : '';
$cp_it_id = isset($data['it_id'][$i]) ? safe_replace_regex($data['it_id'][$i], 'it_id') : '';
$cp_prc = isset($arr_it_cp_prc[$cp_it_id]) ? (int) $arr_it_cp_prc[$cp_it_id] : 0;
if(trim($cid)) {
@@ -346,9 +348,9 @@ if($od['mb_id']) {
sql_query($sql);
}
if(isset($data['od_cp_id']) && $data['od_cp_id']) {
if($data_od_cp_id) {
$sql = " insert into {$g5['g5_shop_coupon_log_table']}
set cp_id = '{$data['od_cp_id']}',
set cp_id = '$data_od_cp_id',
mb_id = '{$od['mb_id']}',
od_id = '$od_id',
cp_price = '$tot_od_cp_price',
@@ -356,9 +358,9 @@ if($od['mb_id']) {
sql_query($sql);
}
if(isset($data['sc_cp_id']) && $data['sc_cp_id']) {
if($data_sc_cp_id) {
$sql = " insert into {$g5['g5_shop_coupon_log_table']}
set cp_id = '{$data['sc_cp_id']}',
set cp_id = '$data_sc_cp_id',
mb_id = '{$od['mb_id']}',
od_id = '$od_id',
cp_price = '$tot_sc_cp_price',
@@ -384,10 +386,16 @@ sql_query($sql);
$sql = " delete from {$g5['g5_shop_order_data_table']} where od_id = '$od_id' and dt_pg = '$od_pg' ";
sql_query($sql, true);
$orderform_url = './orderform.php?od_id='.$od_id;
$inorderlist_url = './inorderlist.php?'.str_replace('&amp;', '&', $qstr);
$js_replace = array('\\' => '\\\\', '"' => '\\"', "'" => '\\u0027', '/' => '\\/', "\r" => '\\r', "\n" => '\\n', "\t" => '\\t', '<' => '\\u003C', '>' => '\\u003E', '&' => '\\u0026', "\xE2\x80\xA8" => '\\u2028', "\xE2\x80\xA9" => '\\u2029');
$js_orderform_url = function_exists('get_js_safe_string') ? get_js_safe_string($orderform_url) : '"'.strtr((string)$orderform_url, $js_replace).'"';
$js_inorderlist_url = function_exists('get_js_safe_string') ? get_js_safe_string($inorderlist_url) : '"'.strtr((string)$inorderlist_url, $js_replace).'"';
echo '<meta http-equiv="content-type" content="text/html; charset=utf-8">'.PHP_EOL;
echo '<script>'.PHP_EOL;
echo 'if(confirm("복구하신 주문 상세페이지로 이동하시겠습니까?"))'.PHP_EOL;
echo 'document.location.href = "./orderform.php?od_id='.$od_id.'";'.PHP_EOL;
echo 'document.location.href = '.$js_orderform_url.';'.PHP_EOL;
echo 'else'.PHP_EOL;
echo 'document.location.href = "./inorderlist.php?'.str_replace('&amp;', '&', $qstr).'";'.PHP_EOL;
echo '</script>'.PHP_EOL;
echo 'document.location.href = '.$js_inorderlist_url.';'.PHP_EOL;
echo '</script>'.PHP_EOL;
+3
View File
@@ -24,6 +24,9 @@ if (!$sst) {
$sst = "od_id";
$sod = "desc";
}
$allowed_sst = array('od_id');
if ($sst && !in_array($sst, $allowed_sst)) $sst = 'od_id';
if ($sod && !in_array(strtolower($sod), array('asc', 'desc'))) $sod = '';
$sql_order = " order by {$sst} {$sod} ";
$sql = " select count(*) as cnt
+2 -2
View File
@@ -33,7 +33,7 @@ $ev_mobile_list_row = isset($_POST['ev_mobile_list_row']) ? (int) $_POST['ev_mob
$ev_use = isset($_POST['ev_use']) ? (int) $_POST['ev_use'] : 0;
$ev_subject_strong = isset($_POST['ev_subject_strong']) ? (int) $_POST['ev_subject_strong'] : 0;
$ev_subject = isset($_POST['ev_subject']) ? clean_xss_tags($_POST['ev_subject'], 1, 1) : '';
$ev_subject = isset($_POST['ev_subject']) ? addslashes(clean_xss_tags(stripslashes($_POST['ev_subject']), 1, 1)) : '';
$ev_head_html = isset($_POST['ev_head_html']) ? $_POST['ev_head_html'] : '';
$ev_tail_html = isset($_POST['ev_tail_html']) ? $_POST['ev_tail_html'] : '';
@@ -129,4 +129,4 @@ if ($w == "" || $w == "u")
else
{
goto_url("./itemevent.php");
}
}
+2 -2
View File
@@ -105,7 +105,7 @@ else if ($w == "u")
and b.ca_mb_id = '{$member['mb_id']}' ";
$row = sql_fetch($sql);
if (!$row['it_id'])
alert("\'{$member['mb_id']}\' 님께서 수정 할 권한이 없는 상품입니다.");
alert("'{$member['mb_id']}' 님께서 수정 할 권한이 없는 상품입니다.");
}
$it = get_shop_item($it_id);
@@ -1901,4 +1901,4 @@ categorychange(document.fitemform);
</script>
<?php
include_once (G5_ADMIN_PATH.'/admin.tail.php');
include_once (G5_ADMIN_PATH.'/admin.tail.php');
+13 -27
View File
@@ -319,7 +319,7 @@ for($i=0; $i<$count_ii_article; $i++) {
}
$it_info_value = addslashes(serialize($value_array));
$it_name = isset($_POST['it_name']) ? strip_tags(clean_xss_attributes(trim($_POST['it_name']))) : '';
$it_name = isset($_POST['it_name']) ? addslashes(strip_tags(clean_xss_attributes(trim(stripslashes($_POST['it_name']))))) : '';
// KVE-2019-0708
$check_sanitize_keys = array(
@@ -356,7 +356,7 @@ $check_sanitize_keys = array(
);
foreach( $check_sanitize_keys as $key ){
$$key = isset($_POST[$key]) ? strip_tags(clean_xss_attributes($_POST[$key])) : '';
$$key = isset($_POST[$key]) ? addslashes(strip_tags(clean_xss_attributes(stripslashes($_POST[$key])))) : '';
}
$it_basic = preg_replace('#<script(.*?)>(.*?)<\/script>#is', '', $it_basic);
@@ -365,32 +365,18 @@ $it_explan = isset($_POST['it_explan']) ? $_POST['it_explan'] : '';
if ($it_name == "")
alert("상품명을 입력해 주십시오.");
// 스킨 경로 검증
$it_skin = isset($_POST['it_skin']) ? strip_tags(clean_xss_attributes($_POST['it_skin'])) : '';
$it_mobile_skin = isset($_POST['it_mobile_skin']) ? strip_tags(clean_xss_attributes($_POST['it_mobile_skin'])) : '';
// 상품 스킨은 파일 경로가 아니라 스킨 디렉토리명(basic, theme/basic 등)을 저장한다.
$it_skin = isset($_POST['it_skin']) ? trim(strip_tags(clean_xss_attributes(stripslashes($_POST['it_skin'])))) : '';
$it_mobile_skin = isset($_POST['it_mobile_skin']) ? trim(strip_tags(clean_xss_attributes(stripslashes($_POST['it_mobile_skin'])))) : '';
$check_files = array();
if( !empty($it_skin) ) $check_files[] = $it_skin;
if( !empty($it_mobile_skin) ) $check_files[] = $it_mobile_skin;
foreach( $check_files as $file ){
if( empty($file) ) continue;
if( preg_match('#\.+(\/|\\\)#', $file) ){
alert('스킨파일명에 포함될수 없는 문자가 들어있습니다.');
}
if( ! is_include_path_check($file, 1) ){
alert('오류 : 데이터폴더가 포함된 path 또는 잘못된 path 를 포함할수 없습니다.');
}
$file_ext = pathinfo($file, PATHINFO_EXTENSION);
if( ! $file_ext || ! in_array($file_ext, array('php', 'htm', 'html')) || ! preg_match('/^.*\.(php|htm|html)$/i', $file) ) {
alert('스킨 파일 경로의 확장자는 php, htm, html 만 허용합니다.');
}
if (function_exists('check_shop_skin_dir')) {
check_shop_skin_dir($it_skin, 'PC용 스킨');
check_shop_skin_dir($it_mobile_skin, '모바일용 스킨', true);
}
$it_skin = addslashes($it_skin);
$it_mobile_skin = addslashes($it_mobile_skin);
$sql_common = " ca_id = '$ca_id',
ca_id2 = '$ca_id2',
ca_id3 = '$ca_id3',
@@ -410,7 +396,7 @@ $sql_common = " ca_id = '$ca_id',
it_type5 = '$it_type5',
it_basic = '$it_basic',
it_explan = '$it_explan',
it_explan2 = '".strip_tags(trim(clean_xss_attributes($it_explan)))."',
it_explan2 = '".addslashes(strip_tags(trim(clean_xss_attributes(stripslashes($it_explan)))))."',
it_mobile_explan = '$it_mobile_explan',
it_cust_price = '$it_cust_price',
it_price = '$it_price',
@@ -513,7 +499,7 @@ else if ($w == "d")
and b.ca_mb_id = '{$member['mb_id']}' ";
$row = sql_fetch($sql);
if (!$row['it_id'])
alert("\'{$member['mb_id']}\' 님께서 삭제 할 권한이 없는 상품입니다.");
alert("'{$member['mb_id']}' 님께서 삭제 할 권한이 없는 상품입니다.");
}
itemdelete($it_id);
+9 -4
View File
@@ -29,17 +29,22 @@ if ($post_act_button == "선택수정") {
$p_ca_id = (isset($_POST['ca_id']) && is_array($_POST['ca_id'])) ? strip_tags($_POST['ca_id'][$k]) : '';
$p_ca_id2 = (isset($_POST['ca_id2']) && is_array($_POST['ca_id2'])) ? strip_tags($_POST['ca_id2'][$k]) : '';
$p_ca_id3 = (isset($_POST['ca_id3']) && is_array($_POST['ca_id3'])) ? strip_tags($_POST['ca_id3'][$k]) : '';
$p_it_name = (isset($_POST['it_name']) && is_array($_POST['it_name'])) ? strip_tags(clean_xss_attributes($_POST['it_name'][$k])) : '';
$p_it_name = (isset($_POST['it_name']) && is_array($_POST['it_name'])) ? addslashes(strip_tags(clean_xss_attributes(stripslashes($_POST['it_name'][$k])))) : '';
$p_it_cust_price = (isset($_POST['it_cust_price']) && is_array($_POST['it_cust_price'])) ? strip_tags($_POST['it_cust_price'][$k]) : '';
$p_it_price = (isset($_POST['it_price']) && is_array($_POST['it_price'])) ? strip_tags($_POST['it_price'][$k]) : '';
$p_it_stock_qty = (isset($_POST['it_stock_qty']) && is_array($_POST['it_stock_qty'])) ? strip_tags($_POST['it_stock_qty'][$k]) : '';
$p_it_skin = (isset($_POST['it_skin']) && is_array($_POST['it_skin'])) ? strip_tags($_POST['it_skin'][$k]) : '';
$p_it_mobile_skin = (isset($_POST['it_mobile_skin']) && is_array($_POST['it_mobile_skin'])) ? strip_tags($_POST['it_mobile_skin'][$k]) : '';
$p_it_skin = (isset($_POST['it_skin']) && is_array($_POST['it_skin'])) ? trim(strip_tags(clean_xss_attributes(stripslashes($_POST['it_skin'][$k])))) : '';
$p_it_mobile_skin = (isset($_POST['it_mobile_skin']) && is_array($_POST['it_mobile_skin'])) ? trim(strip_tags(clean_xss_attributes(stripslashes($_POST['it_mobile_skin'][$k])))) : '';
$p_it_use = isset($_POST['it_use'][$k]) ? clean_xss_tags($_POST['it_use'][$k], 1, 1) : 0;
$p_it_soldout = isset($_POST['it_soldout'][$k]) ? clean_xss_tags($_POST['it_soldout'][$k], 1, 1) : 0;
$p_it_order = (isset($_POST['it_order']) && is_array($_POST['it_order'])) ? strip_tags($_POST['it_order'][$k]) : '';
$p_it_id = isset($_POST['it_id'][$k]) ? preg_replace('/[^a-z0-9_\-]/i', '', $_POST['it_id'][$k]) : '';
if (function_exists('check_shop_skin_dir')) {
check_shop_skin_dir($p_it_skin, 'PC용 스킨');
check_shop_skin_dir($p_it_mobile_skin, '모바일용 스킨', true);
}
if ($is_admin != 'super') { // 최고관리자가 아니면 체크
$sql = "select a.it_id, b.ca_mb_id from {$g5['g5_shop_item_table']} a , {$g5['g5_shop_category_table']} b where (a.ca_id = b.ca_id) and a.it_id = '$p_it_id'";
$checks = sql_fetch($sql);
@@ -89,4 +94,4 @@ if ($post_act_button == "선택수정") {
}
}
goto_url("./itemlist.php?sca=$sca&amp;sst=$sst&amp;sod=$sod&amp;sfl=$sfl&amp;stx=$stx&amp;page=$page");
goto_url("./itemlist.php?sca=$sca&amp;sst=$sst&amp;sod=$sod&amp;sfl=$sfl&amp;stx=$stx&amp;page=$page");
+4 -2
View File
@@ -18,8 +18,10 @@ foreach($check_keys as $key){
if( in_array($key, array('is_content', 'is_reply_content')) ){
$posts[$key] = isset($_POST[$key]) ? $_POST[$key] : '';
} else if( $key === 'is_id' ) {
$posts[$key] = isset($_POST[$key]) ? (int) $_POST[$key] : 0;
} else {
$posts[$key] = isset($_POST[$key]) ? clean_xss_tags($_POST[$key], 1, 1) : '';
$posts[$key] = isset($_POST[$key]) ? addslashes(clean_xss_tags(stripslashes($_POST[$key]), 1, 1)) : '';
}
}
@@ -46,4 +48,4 @@ if ($w == "u")
else
{
alert();
}
}
+2 -2
View File
@@ -35,7 +35,7 @@ $check_keys = array(
$posts = array();
foreach($check_keys as $key){
$posts[$key] = isset($_POST[$key]) ? clean_xss_tags($_POST[$key], 1, 1) : '';
$posts[$key] = isset($_POST[$key]) ? addslashes(clean_xss_tags(stripslashes($_POST[$key]), 1, 1)) : '';
}
$od_send_mail = $posts['od_send_mail'];
@@ -175,4 +175,4 @@ if($posts['od_tno'] && $posts['od_escrow'] == 1)
$qstr = "sort1=$sort1&amp;sort2=$sort2&amp;sel_field=$sel_field&amp;search=$search&amp;page=$page";
goto_url("./orderform.php?od_id=$od_id&amp;$qstr");
goto_url("./orderform.php?od_id=$od_id&amp;$qstr");
+18 -18
View File
@@ -4,7 +4,7 @@ include_once('./_common.php');
check_admin_token();
$od_shop_memo = isset($_POST['od_shop_memo']) ? strip_tags($_POST['od_shop_memo']) : '';
$od_shop_memo = isset($_POST['od_shop_memo']) ? addslashes(strip_tags(stripslashes($_POST['od_shop_memo']))) : '';
$od_id = isset($_POST['od_id']) ? safe_replace_regex($_POST['od_id'], 'od_id') : '';
$search = isset($_REQUEST['search']) ? get_search_string($_REQUEST['search']) : '';
@@ -17,22 +17,22 @@ if(isset($_POST['mod_type']) && $_POST['mod_type'] === 'info') {
$od_zip2 = isset($_POST['od_zip']) ? preg_replace('/[^0-9]/', '', substr($_POST['od_zip'], 3)) : '';
$od_b_zip1 = isset($_POST['od_b_zip']) ? preg_replace('/[^0-9]/', '', substr($_POST['od_b_zip'], 0, 3)) : '';
$od_b_zip2 = isset($_POST['od_b_zip']) ? preg_replace('/[^0-9]/', '', substr($_POST['od_b_zip'], 3)) : '';
$od_email = isset($_POST['od_email']) ? strip_tags(clean_xss_attributes($_POST['od_email'])) : '';
$od_name = isset($_POST['od_name']) ? clean_xss_tags($_POST['od_name'], 1, 1) : '';
$od_tel = isset($_POST['od_tel']) ? clean_xss_tags($_POST['od_tel'], 1, 1) : '';
$od_hp = isset($_POST['od_hp']) ? clean_xss_tags($_POST['od_hp'], 1, 1) : '';
$od_addr1 = isset($_POST['od_addr1']) ? clean_xss_tags($_POST['od_addr1'], 1, 1) : '';
$od_addr2 = isset($_POST['od_addr2']) ? clean_xss_tags($_POST['od_addr2'], 1, 1) : '';
$od_addr3 = isset($_POST['od_addr3']) ? clean_xss_tags($_POST['od_addr3'], 1, 1) : '';
$od_addr_jibeon = isset($_POST['od_addr_jibeon']) ? clean_xss_tags($_POST['od_addr_jibeon'], 1, 1) : '';
$od_b_name = isset($_POST['od_b_name']) ? clean_xss_tags($_POST['od_b_name'], 1, 1) : '';
$od_b_tel = isset($_POST['od_b_tel']) ? clean_xss_tags($_POST['od_b_tel'], 1, 1) : '';
$od_b_hp = isset($_POST['od_b_hp']) ? clean_xss_tags($_POST['od_b_hp'], 1, 1) : '';
$od_b_addr1 = isset($_POST['od_b_addr1']) ? clean_xss_tags($_POST['od_b_addr1'], 1, 1) : '';
$od_b_addr2 = isset($_POST['od_b_addr2']) ? clean_xss_tags($_POST['od_b_addr2'], 1, 1) : '';
$od_b_addr3 = isset($_POST['od_b_addr3']) ? clean_xss_tags($_POST['od_b_addr3'], 1, 1) : '';
$od_b_addr_jibeon = isset($_POST['od_b_addr_jibeon']) ? clean_xss_tags($_POST['od_b_addr_jibeon'], 1, 1) : '';
$od_hope_date = isset($_POST['od_hope_date']) ? clean_xss_tags($_POST['od_hope_date'], 1, 1) : '';
$od_email = isset($_POST['od_email']) ? addslashes(strip_tags(clean_xss_attributes(stripslashes($_POST['od_email'])))) : '';
$od_name = isset($_POST['od_name']) ? addslashes(clean_xss_tags(stripslashes($_POST['od_name']), 1, 1)) : '';
$od_tel = isset($_POST['od_tel']) ? addslashes(clean_xss_tags(stripslashes($_POST['od_tel']), 1, 1)) : '';
$od_hp = isset($_POST['od_hp']) ? addslashes(clean_xss_tags(stripslashes($_POST['od_hp']), 1, 1)) : '';
$od_addr1 = isset($_POST['od_addr1']) ? addslashes(clean_xss_tags(stripslashes($_POST['od_addr1']), 1, 1)) : '';
$od_addr2 = isset($_POST['od_addr2']) ? addslashes(clean_xss_tags(stripslashes($_POST['od_addr2']), 1, 1)) : '';
$od_addr3 = isset($_POST['od_addr3']) ? addslashes(clean_xss_tags(stripslashes($_POST['od_addr3']), 1, 1)) : '';
$od_addr_jibeon = isset($_POST['od_addr_jibeon']) ? addslashes(clean_xss_tags(stripslashes($_POST['od_addr_jibeon']), 1, 1)) : '';
$od_b_name = isset($_POST['od_b_name']) ? addslashes(clean_xss_tags(stripslashes($_POST['od_b_name']), 1, 1)) : '';
$od_b_tel = isset($_POST['od_b_tel']) ? addslashes(clean_xss_tags(stripslashes($_POST['od_b_tel']), 1, 1)) : '';
$od_b_hp = isset($_POST['od_b_hp']) ? addslashes(clean_xss_tags(stripslashes($_POST['od_b_hp']), 1, 1)) : '';
$od_b_addr1 = isset($_POST['od_b_addr1']) ? addslashes(clean_xss_tags(stripslashes($_POST['od_b_addr1']), 1, 1)) : '';
$od_b_addr2 = isset($_POST['od_b_addr2']) ? addslashes(clean_xss_tags(stripslashes($_POST['od_b_addr2']), 1, 1)) : '';
$od_b_addr3 = isset($_POST['od_b_addr3']) ? addslashes(clean_xss_tags(stripslashes($_POST['od_b_addr3']), 1, 1)) : '';
$od_b_addr_jibeon = isset($_POST['od_b_addr_jibeon']) ? addslashes(clean_xss_tags(stripslashes($_POST['od_b_addr_jibeon']), 1, 1)) : '';
$od_hope_date = isset($_POST['od_hope_date']) ? addslashes(clean_xss_tags(stripslashes($_POST['od_hope_date']), 1, 1)) : '';
$sql = " update {$g5['g5_shop_order_table']}
set od_name = '$od_name',
@@ -66,4 +66,4 @@ sql_query($sql);
$qstr = "sort1=$sort1&amp;sort2=$sort2&amp;sel_field=$sel_field&amp;search=$search&amp;page=$page";
goto_url("./orderform.php?od_id=$od_id&amp;$qstr");
goto_url("./orderform.php?od_id=$od_id&amp;$qstr");
+4 -4
View File
@@ -4,7 +4,7 @@ include_once('./_common.php');
check_admin_token();
$pp_name = isset($_POST['pp_name']) ? strip_tags(clean_xss_attributes($_POST['pp_name'])) : '';
$pp_name = isset($_POST['pp_name']) ? addslashes(strip_tags(clean_xss_attributes(stripslashes($_POST['pp_name'])))) : '';
$pp_id = isset($_REQUEST['pp_id']) ? preg_replace('/[^0-9]/', '', $_REQUEST['pp_id']) : 0;
$pp_price = isset($_POST['pp_price']) ? preg_replace('/[^0-9]/', '', $_REQUEST['pp_price']) : 0;
@@ -40,8 +40,8 @@ if($w == 'd') {
$post_pp_content = isset($_POST['pp_content']) ? $_POST['pp_content'] : '';
$post_pp_receipt_price = isset($_POST['pp_receipt_price']) ? (int) $_POST['pp_receipt_price'] : 0;
$post_pp_settle_case = isset($_POST['pp_settle_case']) ? clean_xss_tags($_POST['pp_settle_case'], 1, 1) : '';
$post_pp_receipt_time = isset($_POST['pp_receipt_time']) ? clean_xss_tags($_POST['pp_receipt_time'], 1, 1) : '';
$post_pp_settle_case = isset($_POST['pp_settle_case']) ? addslashes(clean_xss_tags(stripslashes($_POST['pp_settle_case']), 1, 1)) : '';
$post_pp_receipt_time = isset($_POST['pp_receipt_time']) ? safe_replace_regex($_POST['pp_receipt_time'], 'time') : '';
$post_pp_shop_memo = isset($_POST['pp_shop_memo']) ? $_POST['pp_shop_memo'] : '';
$post_pp_use = isset($_POST['pp_use']) ? (int) $_POST['pp_use'] : 0;
@@ -79,4 +79,4 @@ if($w == '') {
if($popup == 'yes')
alert_close('개인결제가 추가됐습니다.');
else
goto_url('./personalpayform.php?w=u&amp;pp_id='.$pp_id.'&amp;'.$qstr);
goto_url('./personalpayform.php?w=u&amp;pp_id='.$pp_id.'&amp;'.$qstr);
+3
View File
@@ -27,6 +27,9 @@ if (!$sst) {
$sst = "pp_id";
$sod = "desc";
}
$allowed_sst = array('pp_id', 'od_id', 'pp_receipt_time');
if ($sst && !in_array($sst, $allowed_sst)) $sst = 'pp_id';
if ($sod && !in_array(strtolower($sod), array('asc', 'desc'))) $sod = '';
$sql_order = " order by {$sst} {$sod} ";
$sql = " select count(*) as cnt
+2 -2
View File
@@ -22,7 +22,7 @@ if($w == 'd') {
sql_query(" delete from {$g5['g5_shop_sendcost_table']} where sc_id = '$sc_id' ");
}
} else {
$sc_name = isset($_POST['sc_name']) ? trim(strip_tags(clean_xss_attributes($_POST['sc_name']))) : '';
$sc_name = isset($_POST['sc_name']) ? addslashes(trim(strip_tags(clean_xss_attributes(stripslashes($_POST['sc_name']))))) : '';
$sc_zip1 = isset($_POST['sc_zip1']) ? preg_replace('/[^0-9]/', '', $_POST['sc_zip1']) : '';
$sc_zip2 = isset($_POST['sc_zip2']) ? preg_replace('/[^0-9]/', '', $_POST['sc_zip2']) : '';
$sc_price = isset($_POST['sc_price']) ? preg_replace('/[^0-9]/', '', $_POST['sc_price']) : '';
@@ -43,4 +43,4 @@ if($w == 'd') {
sql_query($sql);
}
goto_url('./sendcostlist.php?page='.$page);
goto_url('./sendcostlist.php?page='.$page);
+5 -4
View File
@@ -22,13 +22,14 @@ else
$st = clean_xss_tags($st);
$sv = clean_xss_tags($sv);
$sql_sv = sql_real_escape_string(stripslashes($sv));
if ($st == 'all') {
$sql_search = "and (fo_name like '%{$sv}%' or fo_content like '%{$sv}%')";
$sql_search = "and (fo_name like '%{$sql_sv}%' or fo_content like '%{$sql_sv}%')";
} else if ($st == 'name') {
$sql_search = "and fo_name like '%{$sv}%'";
$sql_search = "and fo_name like '%{$sql_sv}%'";
} else if ($st == 'content') {
$sql_search = "and fo_content like '%{$sv}%'";
$sql_search = "and fo_content like '%{$sql_sv}%'";
} else {
$sql_search = '';
}
@@ -238,4 +239,4 @@ function select_copy(sw, f) {
<?php
echo get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, $_SERVER['SCRIPT_NAME']."?fg_no=$fg_no&amp;st=$st&amp;sv=$sv&amp;page=");
include_once(G5_ADMIN_PATH.'/admin.tail.php');
include_once(G5_ADMIN_PATH.'/admin.tail.php');
+5 -3
View File
@@ -6,8 +6,10 @@ auth_check_menu($auth, $sub_menu, "w");
check_admin_token();
$fo_name = isset($_REQUEST['fo_name']) ? strip_tags(clean_xss_attributes($_REQUEST['fo_name'])) : '';
$fo_content = isset($_REQUEST['fo_content']) ? strip_tags(clean_xss_attributes($_REQUEST['fo_content'])) : '';
$fo_no = isset($_REQUEST['fo_no']) ? (int) $_REQUEST['fo_no'] : 0;
$fg_no = isset($_REQUEST['fg_no']) ? (int) $_REQUEST['fg_no'] : 0;
$fo_name = isset($_REQUEST['fo_name']) ? addslashes(strip_tags(clean_xss_attributes(stripslashes($_REQUEST['fo_name'])))) : '';
$fo_content = isset($_REQUEST['fo_content']) ? addslashes(strip_tags(clean_xss_attributes(stripslashes($_REQUEST['fo_content'])))) : '';
$fo_receipt = isset($_REQUEST['fo_receipt']) ? clean_xss_tags($_REQUEST['fo_receipt'], 1, 1) : '';
$get_fg_no = '';
@@ -81,4 +83,4 @@ else // 등록
}
$go_url = './form_list.php?page='.$page.'&amp;fg_no='.$get_fg_no;
goto_url($go_url);
goto_url($go_url);
+30 -14
View File
@@ -4,8 +4,6 @@ include_once("./_common.php");
auth_check_menu($auth, $sub_menu, "r");
$token = get_token();
$g5['title'] = "회원정보 업데이트";
include_once(G5_ADMIN_PATH.'/admin.head.php');
@@ -39,21 +37,39 @@ include_once(G5_ADMIN_PATH.'/admin.head.php');
$( "#mb_update_form" ).submit(function( e ) {
e.preventDefault();
$("#res_msg").html('업데이트 중입니다. 잠시만 기다려 주십시오...');
var params = { mtype : 'json', token : '<?php echo $token; ?>' };
var action = $(this).attr("action");
$.ajax({
url: $(this).attr("action"),
cache:false,
timeout : 30000,
dataType:"json",
data:params,
success: function(data) {
if(data.error){
alert( data.error );
url: '<?php echo G5_ADMIN_URL; ?>/ajax.token.php',
type: 'POST',
dataType: 'json',
data: { admin_csrf_token_key: '<?php echo admin_csrf_token_key(1); ?>' },
success: function(tokenData) {
if(tokenData.error){
alert(tokenData.error);
$("#res_msg").html("");
} else {
$("#datetime").html( data.datetime );
$("#res_msg").html( data.res_msg );
return;
}
$.ajax({
url: action,
type: 'POST',
cache:false,
timeout : 30000,
dataType:"json",
data: { mtype : 'json', token : tokenData.token },
success: function(data) {
if(data.error){
alert( data.error );
$("#res_msg").html("");
} else {
$("#datetime").html( data.datetime );
$("#res_msg").html( data.res_msg );
}
},
error: function (xhr, ajaxOptions, thrownError) {
alert(xhr.status);
alert(thrownError);
}
});
},
error: function (xhr, ajaxOptions, thrownError) {
alert(xhr.status);
+2 -1
View File
@@ -3,6 +3,7 @@ $sub_menu = "900900";
include_once("./_common.php");
$bg_no = isset($_REQUEST['bg_no']) ? clean_xss_tags($_REQUEST['bg_no'], 1, 1) : '';
$bg_no = ($bg_no === 'all') ? 'all' : (int) $bg_no;
$no_hp = isset($_REQUEST['no_hp']) ? clean_xss_tags($_REQUEST['no_hp'], 1, 1) : '';
auth_check_menu($auth, $sub_menu, "r");
@@ -66,4 +67,4 @@ header("Cache-Control: max-age=0");
$writer = PHPExcel_IOFactory::createWriter($excel, 'Excel5');
$writer->save('php://output');
exit;
exit;
+1 -1
View File
@@ -4,7 +4,7 @@ include_once("./_common.php");
auth_check_menu($auth, $sub_menu, "w");
$upload_bg_no = isset($_REQUEST['upload_bg_no']) ? clean_xss_tags($_REQUEST['upload_bg_no'], 1, 1) : '';
$upload_bg_no = isset($_REQUEST['upload_bg_no']) ? (int) $_REQUEST['upload_bg_no'] : 0;
$confirm = isset($_REQUEST['confirm']) ? clean_xss_tags($_REQUEST['confirm'], 1, 1) : '';
if (!$upload_bg_no)
+5 -5
View File
@@ -13,7 +13,7 @@ if ($w == 'u') // 업데이트
// 실제 번호를 넘김
$k = $post_chk[$i];
$bg_no = isset($_POST['bg_no'][$k]) ? (int) $_POST['bg_no'][$k] : 0;
$bg_name = isset($_POST['bg_name'][$k]) ? strip_tags(clean_xss_attributes($_POST['bg_name'][$k])) : '';
$bg_name = isset($_POST['bg_name'][$k]) ? strip_tags(clean_xss_attributes(stripslashes($_POST['bg_name'][$k]))) : '';
if (!is_numeric($bg_no))
alert('그룹 고유번호가 없습니다.');
@@ -65,16 +65,16 @@ else if ($w == 'em') // 비우기
}
else // 등록
{
$bg_name = isset($_REQUEST['bg_name']) ? strip_tags(clean_xss_attributes($_REQUEST['bg_name'])) : '';
$bg_name = isset($_REQUEST['bg_name']) ? strip_tags(clean_xss_attributes(stripslashes($_REQUEST['bg_name']))) : '';
if (!strlen(trim($bg_name)))
alert('그룹명을 입력해주세요');
$res = sql_fetch("select bg_name from {$g5['sms5_book_group_table']} where bg_name='$bg_name'");
$res = sql_fetch("select bg_name from {$g5['sms5_book_group_table']} where bg_name='".sql_real_escape_string($bg_name)."'");
if ($res)
alert('같은 그룹명이 존재합니다.');
sql_query("insert into {$g5['sms5_book_group_table']} set bg_name='$bg_name'");
sql_query("insert into {$g5['sms5_book_group_table']} set bg_name='".sql_real_escape_string($bg_name)."'");
}
goto_url('./num_group.php');
goto_url('./num_group.php');
+1 -1
View File
@@ -8,7 +8,7 @@ $list = $hps = array();
$overlap = 0;
$send_list = isset($_REQUEST['send_list']) ? clean_xss_tags($_REQUEST['send_list'], 1, 1) : '';
$send_list = isset($_REQUEST['send_list']) ? addslashes(clean_xss_tags(stripslashes($_REQUEST['send_list']), 1, 1)) : '';
if( !$send_list ){
die("넘어온 데이터 값이 없습니다.");
+2 -2
View File
@@ -25,8 +25,8 @@ if ( ! (($config['cf_icode_id'] && $config['cf_icode_pw']) || $config['cf_icode_
}
$wr_reply = isset($_REQUEST['wr_reply']) ? preg_replace('#[^0-9\-]#', '', trim($_REQUEST['wr_reply'])) : '';
$wr_message = isset($_REQUEST['wr_message']) ? clean_xss_tags(trim($_REQUEST['wr_message']), 1, 1, 0, 0) : '';
$send_list = isset($_REQUEST['send_list']) ? clean_xss_tags(trim($_REQUEST['send_list']), 1, 1) : '';
$wr_message = isset($_REQUEST['wr_message']) ? addslashes(clean_xss_tags(stripslashes(trim($_REQUEST['wr_message'])), 1, 1, 0, 0)) : '';
$send_list = isset($_REQUEST['send_list']) ? addslashes(clean_xss_tags(stripslashes(trim($_REQUEST['send_list'])), 1, 1)) : '';
$wr_by = isset($_REQUEST['wr_by']) ? clean_xss_tags(trim($_REQUEST['wr_by']), 1, 1) : '';
$wr_bm = isset($_REQUEST['wr_bm']) ? clean_xss_tags(trim($_REQUEST['wr_bm']), 1, 1) : '';
+1 -1
View File
@@ -96,7 +96,7 @@ if(isset($sfl) && $sfl && !in_array($sfl, array('vi_ip','vi_date','vi_time','vi_
$referer = iconv('euc-kr', 'utf-8', $referer);
}
$title = str_replace(array("<", ">"), array("&lt;", "&gt;"), $referer);
$title = str_replace(array("<", ">", "\"", "'"), array("&lt;", "&gt;", "&#034;", "&#039;"), $referer);
$link = '<a href="'.get_text($row['vi_referer']).'" target="_blank" title="'.$title.'">';
}
+7 -3
View File
@@ -40,6 +40,10 @@ $url = preg_replace('/\r\n|\r|\n|[^\x20-\x7e]/','', $url);
// url 체크
check_url_host($url, $msg);
$alert_url = str_replace('&amp;', '&', $url);
$js_replace = array('\\' => '\\\\', '"' => '\\"', "'" => '\\u0027', '/' => '\\/', "\r" => '\\r', "\n" => '\\n', "\t" => '\\t', '<' => '\\u003C', '>' => '\\u003E', '&' => '\\u0026', "\xE2\x80\xA8" => '\\u2028', "\xE2\x80\xA9" => '\\u2029');
$js_alert_msg = function_exists('get_js_safe_string') ? get_js_safe_string($alert_msg) : '"'.strtr((string)$alert_msg, $js_replace).'"';
$js_alert_url = function_exists('get_js_safe_string') ? get_js_safe_string($alert_url) : '"'.strtr((string)$alert_url, $js_replace).'"';
if($error) {
$header2 = "다음 항목에 오류가 있습니다.";
@@ -49,9 +53,9 @@ if($error) {
?>
<script>
alert(<?php echo function_exists('get_js_safe_string') ? get_js_safe_string($alert_msg) : '""'; ?>);
alert(<?php echo $js_alert_msg; ?>);
<?php if ($url) { ?>
document.location.replace("<?php echo str_replace('&amp;', '&', $url); ?>");
document.location.replace(<?php echo $js_alert_url; ?>);
<?php } else { ?>
history.back();
<?php } ?>
@@ -114,4 +118,4 @@ history.back();
</noscript>
<?php
include_once(G5_PATH.'/tail.sub.php');
include_once(G5_PATH.'/tail.sub.php');
+3 -1
View File
@@ -6,6 +6,8 @@ $msg = isset($msg) ? strip_tags($msg) : '';
$msg2 = str_replace(array("\\r\\n", "\\n", "\\r"), "<br>", $msg);
$alert_msg = str_replace(array("\\r\\n", "\\n", "\\r"), "\n", $msg);
$js_replace = array('\\' => '\\\\', '"' => '\\"', "'" => '\\u0027', '/' => '\\/', "\r" => '\\r', "\n" => '\\n', "\t" => '\\t', '<' => '\\u003C', '>' => '\\u003E', '&' => '\\u0026', "\xE2\x80\xA8" => '\\u2028', "\xE2\x80\xA9" => '\\u2029');
$js_alert_msg = function_exists('get_js_safe_string') ? get_js_safe_string($alert_msg) : '"'.strtr((string)$alert_msg, $js_replace).'"';
if($error) {
$header2 = "다음 항목에 오류가 있습니다.";
@@ -17,7 +19,7 @@ if($error) {
?>
<script>
alert(<?php echo function_exists('get_js_safe_string') ? get_js_safe_string($alert_msg) : '""'; ?>);
alert(<?php echo $js_alert_msg; ?>);
try {
window.close();
} catch(error) {
+2 -2
View File
@@ -7,7 +7,7 @@ $count = (isset($_POST['chk_wr_id']) && is_array($_POST['chk_wr_id'])) ? count($
$post_btn_submit = isset($_POST['btn_submit']) ? clean_xss_tags($_POST['btn_submit'], 1, 1) : '';
if(!$count) {
alert(addcslashes($post_btn_submit, '"\\/').' 하실 항목을 하나 이상 선택하세요.');
alert($post_btn_submit.' 하실 항목을 하나 이상 선택하세요.');
}
if($post_btn_submit === '선택삭제') {
@@ -20,4 +20,4 @@ if($post_btn_submit === '선택삭제') {
include './move.php';
} else {
alert('올바른 방법으로 이용해 주세요.');
}
}
+10 -4
View File
@@ -14,6 +14,12 @@ $url3 = preg_replace($pattern2, "", $url3);
$msg = isset($msg) ? $msg : '';
$header = isset($header) ? $msg : '';
$confirm_msg = str_replace(array('<br>', '<br/>', '<br />'), "\n", $msg);
$confirm_msg = strip_tags($confirm_msg);
$js_replace = array('\\' => '\\\\', '"' => '\\"', "'" => '\\u0027', '/' => '\\/', "\r" => '\\r', "\n" => '\\n', "\t" => '\\t', '<' => '\\u003C', '>' => '\\u003E', '&' => '\\u0026', "\xE2\x80\xA8" => '\\u2028', "\xE2\x80\xA9" => '\\u2029');
$js_confirm_msg = function_exists('get_js_safe_string') ? get_js_safe_string($confirm_msg) : '"'.strtr((string)$confirm_msg, $js_replace).'"';
$js_url1 = function_exists('get_js_safe_string') ? get_js_safe_string($url1) : '"'.strtr((string)$url1, $js_replace).'"';
$js_url2 = function_exists('get_js_safe_string') ? get_js_safe_string($url2) : '"'.strtr((string)$url2, $js_replace).'"';
// url 체크
check_url_host($url1);
@@ -22,11 +28,11 @@ check_url_host($url3);
?>
<script>
var conf = "<?php echo strip_tags($msg); ?>";
var conf = <?php echo $js_confirm_msg; ?>;
if (confirm(conf)) {
document.location.replace("<?php echo $url1; ?>");
document.location.replace(<?php echo $js_url1; ?>);
} else {
document.location.replace("<?php echo $url2; ?>");
document.location.replace(<?php echo $js_url2; ?>);
}
</script>
@@ -49,4 +55,4 @@ if (confirm(conf)) {
</noscript>
<?php
include_once(G5_PATH.'/tail.sub.php');
include_once(G5_PATH.'/tail.sub.php');
+2 -2
View File
@@ -3,7 +3,7 @@ include_once('./_common.php');
include_once(G5_CAPTCHA_PATH.'/captcha.lib.php');
if (!$config['cf_email_use'])
alert_close('환경설정에서 \"메일발송 사용\"에 체크하셔야 메일을 발송할 수 있습니다.\\n\\n관리자에게 문의하시기 바랍니다.');
alert_close('환경설정에서 "메일발송 사용"에 체크하셔야 메일을 발송할 수 있습니다.\\n\\n관리자에게 문의하시기 바랍니다.');
if (!$is_member && $config['cf_formmail_is_member'])
alert_close('회원만 이용하실 수 있습니다.');
@@ -52,4 +52,4 @@ $type_checked[$type] = 'checked';
include_once($member_skin_path.'/formmail.skin.php');
include_once(G5_PATH.'/tail.sub.php');
include_once(G5_PATH.'/tail.sub.php');
+7 -1
View File
@@ -170,7 +170,13 @@ $td_width = (int)(100 / $bo_gallery_cols);
// 인덱스 필드가 아니면 정렬에 사용하지 않음
//if (!$sst || ($sst && !(strstr($sst, 'wr_id') || strstr($sst, "wr_datetime")))) {
if (!$sst) {
if ($board['bo_sort_field']) {
$bo_allowed_sort_field = array();
if (function_exists('get_board_sort_fields')) {
foreach (get_board_sort_fields($board) as $bo_sort_v) {
$bo_allowed_sort_field[] = $bo_sort_v[0];
}
}
if ($board['bo_sort_field'] && in_array($board['bo_sort_field'], $bo_allowed_sort_field, true)) {
$sst = $board['bo_sort_field'];
} else {
$sst = "wr_num, wr_reply";
+2 -2
View File
@@ -38,10 +38,10 @@ if ($is_member) {
sql_query($sql);
if (get_sql_affected_rows() <= 0) {
alert(addcslashes($po['po_subject'], '"\\/').'에 이미 참여하셨습니다.', $result_url);
alert($po['po_subject'].'에 이미 참여하셨습니다.', $result_url);
}
insert_point($member['mb_id'], $po['po_point'], $po['po_id'] . '. ' . cut_str($po['po_subject'],20) . ' 투표 참여 ', '@poll', $po['po_id'], '투표');
//goto_url($g5['bbs_url'].'/poll_result.php?po_id='.$po_id.'&amp;skin_dir='.$skin_dir);
goto_url($result_url);
goto_url($result_url);
+4 -4
View File
@@ -174,11 +174,11 @@ for ($i=1; $i<=$upload_count; $i++) {
// 서버에 설정된 값보다 큰파일을 업로드 한다면
if ($filename) {
if ($_FILES['bf_file']['error'][$i] == 1) {
$file_upload_msg .= '\"'.$filename.'\" 파일의 용량이 서버에 설정('.$upload_max_filesize.')된 값보다 크므로 업로드 할 수 없습니다.\\n';
$file_upload_msg .= '"'.$filename.'" 파일의 용량이 서버에 설정('.$upload_max_filesize.')된 값보다 크므로 업로드 할 수 없습니다.\\n';
continue;
}
else if ($_FILES['bf_file']['error'][$i] != 0) {
$file_upload_msg .= '\"'.$filename.'\" 파일이 정상적으로 업로드 되지 않았습니다.\\n';
$file_upload_msg .= '"'.$filename.'" 파일이 정상적으로 업로드 되지 않았습니다.\\n';
continue;
}
}
@@ -186,7 +186,7 @@ for ($i=1; $i<=$upload_count; $i++) {
if (is_uploaded_file($tmp_file)) {
// 관리자가 아니면서 설정한 업로드 사이즈보다 크다면 건너뜀
if (!$is_admin && $filesize > $qaconfig['qa_upload_size']) {
$file_upload_msg .= '\"'.$filename.'\" 파일의 용량('.number_format($filesize).' 바이트)이 게시판에 설정('.number_format($qaconfig['qa_upload_size']).' 바이트)된 값보다 크므로 업로드 하지 않습니다.\\n';
$file_upload_msg .= '"'.$filename.'" 파일의 용량('.number_format($filesize).' 바이트)이 게시판에 설정('.number_format($qaconfig['qa_upload_size']).' 바이트)된 값보다 크므로 업로드 하지 않습니다.\\n';
continue;
}
@@ -482,4 +482,4 @@ else
if ($file_upload_msg)
alert($file_upload_msg, $result_url);
else
goto_url($result_url);
goto_url($result_url);
+10 -1
View File
@@ -150,6 +150,15 @@ $hp_readonly = (($config['cf_cert_use'] && $config['cf_cert_req']) && ($config['
$agree = isset($_REQUEST['agree']) ? preg_replace('#[^0-9]#', '', $_REQUEST['agree']) : '';
$agree2 = isset($_REQUEST['agree2']) ? preg_replace('#[^0-9]#', '', $_REQUEST['agree2']) : '';
$member['mb_marketing_agree'] = isset($member['mb_marketing_agree']) ? $member['mb_marketing_agree'] : 0;
$member['mb_marketing_date'] = isset($member['mb_marketing_date']) ? $member['mb_marketing_date'] : '0000-00-00 00:00:00';
$member['mb_thirdparty_agree'] = isset($member['mb_thirdparty_agree']) ? $member['mb_thirdparty_agree'] : 0;
$member['mb_thirdparty_date'] = isset($member['mb_thirdparty_date']) ? $member['mb_thirdparty_date'] : '0000-00-00 00:00:00';
$member['mb_mailling'] = isset($member['mb_mailling']) ? $member['mb_mailling'] : 0;
$member['mb_mailling_date'] = isset($member['mb_mailling_date']) ? $member['mb_mailling_date'] : '0000-00-00 00:00:00';
$member['mb_sms'] = isset($member['mb_sms']) ? $member['mb_sms'] : 0;
$member['mb_sms_date'] = isset($member['mb_sms_date']) ? $member['mb_sms_date'] : '0000-00-00 00:00:00';
// add_javascript('js 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
if ($config['cf_use_addr'])
add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
@@ -158,4 +167,4 @@ include_once($member_skin_path.'/register_form.skin.php');
run_event('register_form_after', $w, $agree, $agree2);
include_once('./_tail.php');
include_once('./_tail.php');
+5 -2
View File
@@ -678,8 +678,11 @@ if(isset($_SESSION['ss_cert_hash'])) unset($_SESSION['ss_cert_hash']);
if(isset($_SESSION['ss_cert_birth'])) unset($_SESSION['ss_cert_birth']);
if(isset($_SESSION['ss_cert_adult'])) unset($_SESSION['ss_cert_adult']);
if ($msg)
echo '<script>alert(\''.$msg.'\');</script>';
if ($msg) {
$js_replace = array('\\' => '\\\\', '"' => '\\"', "'" => '\\u0027', '/' => '\\/', "\r" => '\\r', "\n" => '\\n', "\t" => '\\t', '<' => '\\u003C', '>' => '\\u003E', '&' => '\\u0026', "\xE2\x80\xA8" => '\\u2028', "\xE2\x80\xA9" => '\\u2029');
$js_msg = function_exists('get_js_safe_string') ? get_js_safe_string($msg) : '"'.strtr((string)$msg, $js_replace).'"';
echo '<script>alert('.$js_msg.');</script>';
}
run_event('register_form_update_after', $mb_id, $w);
+5 -2
View File
@@ -6,7 +6,10 @@ include_once(G5_PATH.'/head.sub.php');
if (!$is_member)
{
$href = './login.php?'.$qstr.'&amp;url='.urlencode(get_pretty_url($bo_table, $wr_id));
echo '<script> alert(\'회원만 접근 가능합니다.\'); top.location.href = \''.str_replace('&amp;', '&', $href).'\'; </script>';
$href = str_replace('&amp;', '&', $href);
$js_replace = array('\\' => '\\\\', '"' => '\\"', "'" => '\\u0027', '/' => '\\/', "\r" => '\\r', "\n" => '\\n', "\t" => '\\t', '<' => '\\u003C', '>' => '\\u003E', '&' => '\\u0026', "\xE2\x80\xA8" => '\\u2028', "\xE2\x80\xA9" => '\\u2029');
$js_href = function_exists('get_js_safe_string') ? get_js_safe_string($href) : '"'.strtr((string)$href, $js_replace).'"';
echo '<script> alert(\'회원만 접근 가능합니다.\'); top.location.href = '.$js_href.'; </script>';
exit;
}
@@ -115,4 +118,4 @@ delete_cache_latest($bo_table);
<noscript>
<p>이 글을 스크랩 하였습니다.</p>
<a href="./scrap.php">스크랩 확인하기</a>
</noscript>
</noscript>
+3 -3
View File
@@ -528,11 +528,11 @@ if(isset($_FILES['bf_file']['name']) && is_array($_FILES['bf_file']['name'])) {
// 서버에 설정된 값보다 큰파일을 업로드 한다면
if ($filename) {
if ($_FILES['bf_file']['error'][$i] == 1) {
$file_upload_msg .= '\"'.$filename.'\" 파일의 용량이 서버에 설정('.$upload_max_filesize.')된 값보다 크므로 업로드 할 수 없습니다.\\n';
$file_upload_msg .= '"'.$filename.'" 파일의 용량이 서버에 설정('.$upload_max_filesize.')된 값보다 크므로 업로드 할 수 없습니다.\\n';
continue;
}
else if ($_FILES['bf_file']['error'][$i] != 0) {
$file_upload_msg .= '\"'.$filename.'\" 파일이 정상적으로 업로드 되지 않았습니다.\\n';
$file_upload_msg .= '"'.$filename.'" 파일이 정상적으로 업로드 되지 않았습니다.\\n';
continue;
}
}
@@ -540,7 +540,7 @@ if(isset($_FILES['bf_file']['name']) && is_array($_FILES['bf_file']['name'])) {
if (is_uploaded_file($tmp_file)) {
// 관리자가 아니면서 설정한 업로드 사이즈보다 크다면 건너뜀
if (!$is_admin && $filesize > $board['bo_upload_size']) {
$file_upload_msg .= '\"'.$filename.'\" 파일의 용량('.number_format($filesize).' 바이트)이 게시판에 설정('.number_format($board['bo_upload_size']).' 바이트)된 값보다 크므로 업로드 하지 않습니다.\\n';
$file_upload_msg .= '"'.$filename.'" 파일의 용량('.number_format($filesize).' 바이트)이 게시판에 설정('.number_format($board['bo_upload_size']).' 바이트)된 값보다 크므로 업로드 하지 않습니다.\\n';
continue;
}
+19 -14
View File
@@ -7,6 +7,8 @@ include_once('../lib/common.lib.php'); // 공통 라이브러리
include_once('../lib/hook.lib.php'); // hook 함수 파일
include_once('../lib/get_data.lib.php'); // 데이터 가져오는 함수 모음
@header('Content-Type: application/json; charset=utf-8');
$data_path = '../'.G5_DATA_DIR;
// 파일이 존재한다면 설치할 수 없다.
@@ -30,29 +32,32 @@ $ajax_token = md5($tmp_str.$_SERVER['REMOTE_ADDR'].dirname(dirname(__FILE__).'/'
$bool_ajax_token = (isset($_POST['ajax_token']) && ($ajax_token == $_POST['ajax_token'])) ? true : false;
if (!($mysql_host && $mysql_user && $mysql_pass && $mysql_db && $table_prefix && $bool_ajax_token)) {
if (!($mysql_host && $mysql_user && $mysql_db && $table_prefix && $bool_ajax_token)) {
die(install_json_msg('잘못된 요청입니다.'));
}
try {
$dblink = sql_connect($mysql_host, $mysql_user, $mysql_pass, $mysql_db);
} catch (Exception $e) {
$connect = install_db_connect($mysql_host, $mysql_user, $mysql_pass, $mysql_db);
$dblink = $connect['link'];
if (!$dblink || $connect['message']) {
if ($connect['error']) {
install_error_log($connect['message'].' | '.$connect['error']);
}
die(install_json_msg($connect['message'] ? $connect['message'] : 'MySQL 정보를 확인해 주십시오.'));
}
if (!isset($dblink)) {
die(install_json_msg('MySQL Host, User, Password 를 확인해 주십시오.'));
$db_check = install_check_db_capability($dblink, $table_prefix);
if (!$db_check[0]) {
die(install_json_msg($db_check[1]));
}
try {
$select_db = sql_select_db($mysql_db, $dblink);
} catch (Exception $e) {
$table_check_error = '';
$table_exists = install_table_exists($dblink, $table_prefix.'config', $table_check_error);
if ($table_check_error) {
die(install_json_msg('테이블 존재 여부를 확인하지 못했습니다. DB 계정 권한을 확인해 주십시오.'));
}
if (!isset($select_db)) {
die(install_json_msg('MySQL DB 를 확인해 주십시오.'));
}
if (sql_query("SHOW TABLES LIKE `{$table_prefix}config`", G5_DISPLAY_SQL_ERROR, $dblink)) {
if ($table_exists) {
die(install_json_msg('주의! 이미 테이블이 존재하므로, 기존 DB 자료가 망실됩니다. 계속 진행하겠습니까?', 'exists'));
}
+2
View File
@@ -12,6 +12,7 @@ include_once ('./install.inc.php');
if ($exists_data_dir && $write_data_dir) {
// 필수 모듈 체크
require_once('./library.check.php');
if (empty($install_library_required_missing)) {
?>
<form action="./install_config.php" method="post" onsubmit="return frm_submit(this);">
@@ -48,6 +49,7 @@ function frm_submit(f)
}
</script>
<?php
}
} // if
?>
+395 -1
View File
@@ -56,4 +56,398 @@ if( ! function_exists('install_json_msg') ){
return json_encode(array('error'=>$error_msg, 'success'=>$success_msg, 'exists'=>$exists_msg));
}
}
}
if( ! function_exists('install_error_log') ){
function install_error_log($message) {
$err_file = isset($_SERVER['SCRIPT_NAME']) ? $_SERVER['SCRIPT_NAME'] : '';
@error_log('[g5 install] '.$message.' | file: '.$err_file);
}
}
if( ! function_exists('install_html_escape') ){
function install_html_escape($str) {
return htmlspecialchars((string) $str, ENT_QUOTES, 'UTF-8');
}
}
if( ! function_exists('install_db_error') ){
function install_db_error($link=null) {
if (function_exists('mysqli_connect') && G5_MYSQLI_USE) {
if ($link) {
return mysqli_errno($link).' : '.mysqli_error($link);
}
return mysqli_connect_errno().' : '.mysqli_connect_error();
}
if (function_exists('mysql_error')) {
return $link ? mysql_errno($link).' : '.mysql_error($link) : mysql_errno().' : '.mysql_error();
}
return '';
}
}
if( ! function_exists('install_db_query') ){
function install_db_query($sql, $link) {
if (function_exists('mysqli_query') && G5_MYSQLI_USE) {
return @mysqli_query($link, $sql);
}
return @mysql_query($sql, $link);
}
}
if( ! function_exists('install_db_fetch_row') ){
function install_db_fetch_row($result) {
if (!$result) {
return false;
}
if (function_exists('mysqli_fetch_row') && G5_MYSQLI_USE) {
return mysqli_fetch_row($result);
}
return mysql_fetch_row($result);
}
}
if( ! function_exists('install_db_num_rows') ){
function install_db_num_rows($result) {
if (!$result) {
return 0;
}
if (function_exists('mysqli_num_rows') && G5_MYSQLI_USE) {
return mysqli_num_rows($result);
}
return mysql_num_rows($result);
}
}
if( ! function_exists('install_db_connect') ){
function install_db_connect($host, $user, $pass, $db) {
$result = array('link'=>false, 'error'=>'', 'message'=>'');
if (function_exists('mysqli_connect') && G5_MYSQLI_USE) {
if (function_exists('mysqli_report')) {
mysqli_report(MYSQLI_REPORT_OFF);
}
$link = @mysqli_connect($host, $user, $pass);
if (!$link) {
$result['error'] = install_db_error();
$result['message'] = 'MySQL Host, User, Password 정보를 확인해 주십시오.';
return $result;
}
if (!@mysqli_select_db($link, $db)) {
$result['link'] = $link;
$result['error'] = install_db_error($link);
$result['message'] = 'MySQL DB 정보를 확인해 주십시오.';
return $result;
}
$result['link'] = $link;
return $result;
}
if (!function_exists('mysql_connect')) {
$result['message'] = 'MySQL 확장(mysqli/mysql)이 설치되어 있지 않습니다.';
return $result;
}
$link = @mysql_connect($host, $user, $pass);
if (!$link) {
$result['error'] = install_db_error();
$result['message'] = 'MySQL Host, User, Password 정보를 확인해 주십시오.';
return $result;
}
if (!@mysql_select_db($db, $link)) {
$result['link'] = $link;
$result['error'] = install_db_error($link);
$result['message'] = 'MySQL DB 정보를 확인해 주십시오.';
return $result;
}
$result['link'] = $link;
return $result;
}
}
if( ! function_exists('install_sql_like_escape') ){
function install_sql_like_escape($str) {
return str_replace(array('\\', '%', '_'), array('\\\\', '\%', '\_'), $str);
}
}
if( ! function_exists('install_sql_escape') ){
function install_sql_escape($str, $link) {
if (function_exists('mysqli_real_escape_string') && G5_MYSQLI_USE) {
return mysqli_real_escape_string($link, $str);
}
return mysql_real_escape_string($str, $link);
}
}
if( ! function_exists('install_table_exists') ){
function install_table_exists($link, $table, &$error='') {
$error = '';
$table_like = install_sql_escape(install_sql_like_escape($table), $link);
$result = install_db_query("SHOW TABLES LIKE '{$table_like}'", $link);
if (!$result) {
$error = install_db_error($link);
install_error_log('table exists check failed: '.$error.' | table: '.$table);
return false;
}
return install_db_num_rows($result) > 0;
}
}
if( ! function_exists('install_get_existing_tables') ){
function install_get_existing_tables($link, $prefixes) {
$tables = array();
foreach ($prefixes as $prefix) {
if (!$prefix) {
continue;
}
$table_like = install_sql_escape(install_sql_like_escape($prefix).'%', $link);
$result = install_db_query("SHOW TABLES LIKE '{$table_like}'", $link);
while ($row = install_db_fetch_row($result)) {
if (isset($row[0])) {
$tables[$row[0]] = $row[0];
}
}
}
ksort($tables);
return array_values($tables);
}
}
if( ! function_exists('install_fail_page') ){
function install_fail_page($message, $link=null, $prefixes=array()) {
global $install_progress_started;
install_error_log($message);
if (!empty($install_progress_started)) {
$install_progress_started = false;
?>
</ol>
</div>
<?php
}
?>
<div class="ins_inner">
<h2>설치를 계속할 수 없습니다.</h2>
<p><?php echo nl2br(install_html_escape($message)); ?></p>
<?php
if ($link && $prefixes) {
$tables = install_get_existing_tables($link, $prefixes);
if ($tables) {
?>
<p>설치가 중간에 멈춘 경우 아래 테이블이 일부 생성되었을 수 있습니다. 다시 설치하려면 DB에서 해당 테이블을 정리하거나, 재설치 옵션을 선택한 뒤 진행해 주십시오.</p>
<ul>
<?php
for ($i=0; $i<count($tables); $i++) {
?>
<li><?php echo install_html_escape($tables[$i]); ?></li>
<?php
}
?>
</ul>
<?php
}
}
?>
<div class="inner_btn"><a href="./install_config.php">뒤로가기</a></div>
</div>
<?php
include_once('./install.inc2.php');
exit;
}
}
if( ! function_exists('install_query_or_fail') ){
function install_query_or_fail($sql, $link, $message, $prefixes=array()) {
$result = install_db_query($sql, $link);
if (!$result) {
install_error_log($message.' | '.install_db_error($link).' | SQL: '.$sql);
install_fail_page($message."\n서버 오류 로그를 확인해 주십시오.", $link, $prefixes);
}
return $result;
}
}
if( ! function_exists('install_check_db_capability') ){
function install_check_db_capability($link, $table_prefix) {
$suffix = substr(md5(uniqid('', true)), 0, 12);
$table = $table_prefix.'install_check_'.$suffix;
$charset = preg_replace('/[^0-9a-z_]/i', '', G5_DB_CHARSET);
$engine = '';
if (!$charset) {
$charset = 'utf8';
}
if (in_array(strtolower(G5_DB_ENGINE), array('innodb', 'myisam'))) {
$engine = ' ENGINE='.G5_DB_ENGINE;
}
$checks = array(
"CREATE TABLE `{$table}` (`id` int(11) NOT NULL){$engine} DEFAULT CHARSET={$charset}",
"INSERT INTO `{$table}` (`id`) VALUES (1)",
"ALTER TABLE `{$table}` ADD `memo` varchar(20) NOT NULL DEFAULT ''",
"DROP TABLE `{$table}`"
);
for ($i=0; $i<count($checks); $i++) {
if (!install_db_query($checks[$i], $link)) {
$error = install_db_error($link);
install_db_query("DROP TABLE IF EXISTS `{$table}`", $link);
install_error_log('DB capability check failed: '.$error.' | SQL: '.$checks[$i]);
return array(false, 'DB 계정에 테이블 생성/입력/수정/삭제 권한이 있는지, DB 문자셋('.G5_DB_CHARSET.')을 사용할 수 있는지 확인해 주십시오.');
}
}
return array(true, '');
}
}
if( ! function_exists('install_split_sql') ){
function install_split_sql($sql) {
$queries = array();
$query = '';
$quote = '';
$len = strlen($sql);
for ($i=0; $i<$len; $i++) {
$char = $sql[$i];
$next = ($i + 1 < $len) ? $sql[$i + 1] : '';
if ($quote) {
$query .= $char;
if ($quote !== '`' && $char === '\\' && $next !== '') {
$query .= $next;
$i++;
continue;
}
if ($char === $quote) {
$quote = '';
}
continue;
}
if ($char === "'" || $char === '"' || $char === '`') {
$quote = $char;
$query .= $char;
continue;
}
if ($char === '-' && $next === '-' && ($i === 0 || preg_match('/\s/', $sql[$i - 1]))) {
while ($i < $len && $sql[$i] !== "\n") {
$i++;
}
continue;
}
if ($char === '#') {
while ($i < $len && $sql[$i] !== "\n") {
$i++;
}
continue;
}
if ($char === '/' && $next === '*') {
$i += 2;
while ($i < $len - 1 && !($sql[$i] === '*' && $sql[$i + 1] === '/')) {
$i++;
}
$i++;
continue;
}
if ($char === ';') {
$trimmed = trim($query);
if ($trimmed !== '') {
$queries[] = $trimmed;
}
$query = '';
continue;
}
$query .= $char;
}
$trimmed = trim($query);
if ($trimmed !== '') {
$queries[] = $trimmed;
}
return $queries;
}
}
if( ! function_exists('install_load_sql_file') ){
function install_load_sql_file($file, $from_prefix, $to_prefix) {
if (!is_readable($file)) {
return false;
}
$sql = file_get_contents($file);
if ($sql === false) {
return false;
}
$sql = preg_replace('/`'.preg_quote($from_prefix, '/').'([^`]+`)/', '`'.$to_prefix.'$1', $sql);
return install_split_sql($sql);
}
}
if( ! function_exists('install_ensure_dir') ){
function install_ensure_dir($dir) {
if (!is_dir($dir) && !@mkdir($dir, G5_DIR_PERMISSION)) {
return false;
}
@chmod($dir, G5_DIR_PERMISSION);
return is_dir($dir) && is_writable($dir);
}
}
if( ! function_exists('install_file_write') ){
function install_file_write($handle, $content) {
global $install_file_write_error;
if ($install_file_write_error) {
return false;
}
$result = @fwrite($handle, $content);
if ($result === false || $result < strlen($content)) {
$install_file_write_error = true;
return false;
}
return true;
}
}
+71 -2
View File
@@ -135,8 +135,56 @@ $ajax_token = md5($tmp_str.$_SERVER['REMOTE_ADDR'].dirname(dirname(__FILE__).'/'
<script src="../js/jquery-1.8.3.min.js"></script>
<script>
function get_install_check_error_message(xhr)
{
var status = (xhr && xhr.status) ? ' (HTTP ' + xhr.status + ')' : '';
var default_msg = 'DB 연결 점검 중 오류가 발생했습니다.' + status + '\n'
+ 'MySQL Host/User/Password/DB 정보가 올바른지, DB 서버가 동작 중인지 확인해 주십시오.\n'
+ '문제가 계속되면 PHP 오류 로그를 확인하시기 바랍니다.';
var response_text = xhr ? (xhr.responseText || '') : '';
if (response_text && window.jQuery) {
try {
var data = jQuery.parseJSON(response_text);
if (data && data.error) {
return data.error;
}
} catch (e) {
}
}
response_text = response_text.replace(/<[^>]*>/g, ' ').replace(/\s+/g, ' ');
response_text = window.jQuery ? jQuery.trim(response_text) : response_text;
return response_text || default_msg;
}
function set_install_submit_state(f, submitting)
{
var submit_btn = f.querySelector ? f.querySelector('input[type="submit"]') : null;
if (submitting) {
f.setAttribute('data-install-submitting', '1');
if (submit_btn) {
submit_btn.setAttribute('data-original-value', submit_btn.value);
submit_btn.disabled = true;
submit_btn.value = '점검 중...';
}
} else {
f.removeAttribute('data-install-submitting');
if (submit_btn) {
submit_btn.disabled = false;
submit_btn.value = submit_btn.getAttribute('data-original-value') || '다음';
}
}
}
function frm_install_submit(f)
{
if (f.getAttribute('data-install-submitting') == '1') {
return false;
}
if (f.mysql_host.value == '')
{
alert('MySQL Host 를 입력하십시오.'); f.mysql_host.focus(); return false;
@@ -194,25 +242,46 @@ function frm_install_submit(f)
f.admin_id.focus();
return false;
}
if (f.g5_install.checked) {
var reinstall_msg = '재설치를 선택했습니다.\n\n'
+ 'DB: ' + f.mysql_db.value + '\n'
+ 'TABLE명 접두사: ' + f.table_prefix.value + '\n'
+ '쇼핑몰 TABLE명 접두사: ' + f.g5_shop_prefix.value + '\n\n'
+ '기존 테이블과 자료가 삭제되거나 덮어써질 수 있습니다. 계속 진행하시겠습니까?';
if (!confirm(reinstall_msg)) {
return false;
}
}
set_install_submit_state(f, true);
if (window.jQuery) {
var jqxhr = jQuery.post( "ajax.install.check.php", $(f).serialize(), function(data) {
if( data.error ){
set_install_submit_state(f, false);
alert(data.error);
} else if( data.exists ) {
if( confirm(data.exists) ){
if( f.g5_install.checked || confirm(data.exists) ){
f.submit();
} else {
set_install_submit_state(f, false);
}
} else if( data.success ) {
f.submit();
} else {
set_install_submit_state(f, false);
alert(get_install_check_error_message());
}
}, "json");
jqxhr.fail(function(xhr) {
alert( xhr.responseText );
set_install_submit_state(f, false);
alert(get_install_check_error_message(xhr));
});
return false;
+173 -151
View File
@@ -37,17 +37,17 @@ $admin_name = isset($_POST['admin_name']) ? $_POST['admin_name'] : '';
$admin_email = isset($_POST['admin_email']) ? $_POST['admin_email'] : '';
if (preg_match("/[^0-9a-z_]+/i", $table_prefix) ) {
die('<div class="ins_inner"><p>TABLE명 접두사는 영문자, 숫자, _ 만 입력하세요.</p><div class="inner_btn"><a href="./install_config.php">뒤로가기</a></div></div>');
install_fail_page('TABLE명 접두사는 영문자, 숫자, _ 만 입력하세요.');
}
if (preg_match("/[^0-9a-z_]+/i", $admin_id)) {
die('<div class="ins_inner"><p>관리자 아이디는 영문자, 숫자, _ 만 입력하세요.</p><div class="inner_btn"><a href="./install_config.php">뒤로가기</a></div></div>');
install_fail_page('관리자 아이디는 영문자, 숫자, _ 만 입력하세요.');
}
// 관리자 이메일 형식 검증
$admin_email = trim($admin_email);
if (!$admin_email || !filter_var($admin_email, FILTER_VALIDATE_EMAIL)) {
die('<div class="ins_inner"><p>올바른 관리자 E-mail 주소를 입력하세요.</p><div class="inner_btn"><a href="./install_config.php">뒤로가기</a></div></div>');
install_fail_page('올바른 관리자 E-mail 주소를 입력하세요.');
}
$g5_install = isset($_POST['g5_install']) ? (int) $_POST['g5_install'] : 0;
@@ -55,36 +55,29 @@ $g5_shop_prefix = isset($_POST['g5_shop_prefix']) ? safe_install_string_check($_
$g5_shop_install = isset($_POST['g5_shop_install']) ? (int) $_POST['g5_shop_install'] : 0;
if (preg_match("/[^0-9a-z_]+/i", $g5_shop_prefix)) {
die('<div class="ins_inner"><p>쇼핑몰 TABLE명 접두사는 영문자, 숫자, _ 만 입력하세요.</p><div class="inner_btn"><a href="./install_config.php">뒤로가기</a></div></div>');
install_fail_page('쇼핑몰 TABLE명 접두사는 영문자, 숫자, _ 만 입력하세요.');
}
$dblink = sql_connect($mysql_host, $mysql_user, $mysql_pass, $mysql_db);
if (!$dblink) {
?>
$install_table_prefixes = array($table_prefix);
if ($g5_shop_install) {
$install_table_prefixes[] = $g5_shop_prefix;
}
<div class="ins_inner">
<p>MySQL Host, User, Password 를 확인해 주십시오.</p>
<div class="inner_btn"><a href="./install_config.php">뒤로가기</a></div>
</div>
$connect = install_db_connect($mysql_host, $mysql_user, $mysql_pass, $mysql_db);
$dblink = $connect['link'];
<?php
include_once('./install.inc2.php');
exit;
if (!$dblink || $connect['message']) {
if ($connect['error']) {
install_error_log($connect['message'].' | '.$connect['error']);
}
install_fail_page($connect['message'] ? $connect['message'] : 'MySQL 정보를 확인해 주십시오.', $dblink, $install_table_prefixes);
}
$g5['connect_db'] = $dblink;
$select_db = sql_select_db($mysql_db, $dblink);
if (!$select_db) {
?>
<div class="ins_inner">
<p>MySQL DB 를 확인해 주십시오.</p>
<div class="inner_btn"><a href="./install_config.php">뒤로가기</a></div>
</div>
<?php
include_once('./install.inc2.php');
exit;
$db_check = install_check_db_capability($dblink, $table_prefix);
if (!$db_check[0]) {
install_fail_page($db_check[1], $dblink, $install_table_prefixes);
}
$mysql_set_mode = 'false';
@@ -93,57 +86,52 @@ sql_set_charset(G5_DB_CHARSET, $dblink);
// 관리자 입력값 SQL escape — sql_set_charset 이후 적용
$admin_name = sql_real_escape_string(trim($admin_name), $dblink);
$admin_email = sql_real_escape_string($admin_email, $dblink);
$result = sql_query(" SELECT @@sql_mode as mode ", true, $dblink);
$result = install_query_or_fail(" SELECT @@sql_mode as mode ", $dblink, 'DB SQL 모드를 확인하지 못했습니다.', $install_table_prefixes);
$row = sql_fetch_array($result);
if($row['mode']) {
sql_query("SET SESSION sql_mode = ''", true, $dblink);
install_query_or_fail("SET SESSION sql_mode = ''", $dblink, 'DB SQL 모드를 변경하지 못했습니다.', $install_table_prefixes);
$mysql_set_mode = 'true';
}
unset($result);
unset($row);
?>
<?php $install_progress_started = true; ?>
<div class="ins_inner">
<h2><?php echo G5_VERSION ?> 설치가 시작되었습니다.</h2>
<ol>
<?php
$sql = "SHOW TABLES LIKE '{$table_prefix}config'";
$is_install = sql_query($sql, false, $dblink)->num_rows > 0;
$table_check_error = '';
$is_install = install_table_exists($dblink, $table_prefix.'config', $table_check_error);
if ($table_check_error) {
install_fail_page('기존 테이블 존재 여부를 확인하지 못했습니다. DB 계정 권한을 확인해 주십시오.', $dblink, $install_table_prefixes);
}
// 그누보드5 재설치에 체크하였거나 그누보드5가 설치되어 있지 않다면
if ($g5_install || $is_install === false) {
// 테이블 생성 ------------------------------------
$file = implode('', file('./gnuboard5.sql'));
eval("\$file = \"$file\";");
$queries = install_load_sql_file('./gnuboard5.sql', 'g5_', $table_prefix);
if ($queries === false) {
install_fail_page('gnuboard5.sql 파일을 읽을 수 없습니다.', $dblink, $install_table_prefixes);
}
$file = preg_replace('/^--.*$/m', '', $file);
$file = preg_replace('/`g5_([^`]+`)/', '`'.$table_prefix.'$1', $file);
$f = explode(';', $file);
for ($i=0; $i<count($f); $i++) {
if (trim($f[$i]) == '') {
continue;
}
$sql = get_db_create_replace($f[$i]);
sql_query($sql, true, $dblink);
for ($i=0; $i<count($queries); $i++) {
$sql = get_db_create_replace($queries[$i]);
install_query_or_fail($sql, $dblink, '그누보드 기본 테이블 생성 중 오류가 발생했습니다.', $install_table_prefixes);
}
}
// 쇼핑몰 테이블 생성 -----------------------------
if($g5_shop_install) {
$file = implode('', file('./gnuboard5shop.sql'));
$queries = install_load_sql_file('./gnuboard5shop.sql', 'g5_shop_', $g5_shop_prefix);
if ($queries === false) {
install_fail_page('gnuboard5shop.sql 파일을 읽을 수 없습니다.', $dblink, $install_table_prefixes);
}
$file = preg_replace('/^--.*$/m', '', $file);
$file = preg_replace('/`g5_shop_([^`]+`)/', '`'.$g5_shop_prefix.'$1', $file);
$f = explode(';', $file);
for ($i=0; $i<count($f); $i++) {
if (trim($f[$i]) == '') {
continue;
}
$sql = get_db_create_replace($f[$i]);
sql_query($sql, true, $dblink);
for ($i=0; $i<count($queries); $i++) {
$sql = get_db_create_replace($queries[$i]);
install_query_or_fail($sql, $dblink, '쇼핑몰 테이블 생성 중 오류가 발생했습니다.', $install_table_prefixes);
}
}
// 테이블 생성 ------------------------------------
@@ -233,14 +221,14 @@ if ($g5_install || $is_install === false) {
cf_stipulation = '해당 홈페이지에 맞는 회원가입약관을 입력합니다.',
cf_privacy = '해당 홈페이지에 맞는 개인정보처리방침을 입력합니다.'
";
sql_query($sql, true, $dblink);
install_query_or_fail($sql, $dblink, '기본 환경설정을 저장하지 못했습니다.', $install_table_prefixes);
// 1:1문의 설정
$sql = " insert into `{$table_prefix}qa_config`
( qa_title, qa_category, qa_skin, qa_mobile_skin, qa_use_email, qa_req_email, qa_use_hp, qa_req_hp, qa_use_editor, qa_subject_len, qa_mobile_subject_len, qa_page_rows, qa_mobile_page_rows, qa_image_width, qa_upload_size, qa_insert_content )
values
( '1:1문의', '회원|포인트', 'basic', 'basic', '1', '0', '1', '0', '1', '60', '30', '15', '15', '600', '1048576', '' ) ";
sql_query($sql, true, $dblink);
install_query_or_fail($sql, $dblink, '1:1문의 설정을 저장하지 못했습니다.', $install_table_prefixes);
// 관리자 회원가입
$sql = " insert into `{$table_prefix}member`
@@ -257,15 +245,15 @@ if ($g5_install || $is_install === false) {
mb_datetime = '".G5_TIME_YMDHIS."',
mb_ip = '{$_SERVER['REMOTE_ADDR']}'
";
sql_query($sql, true, $dblink);
install_query_or_fail($sql, $dblink, '관리자 회원 정보를 저장하지 못했습니다.', $install_table_prefixes);
// 내용관리 생성
sql_query(" insert into `{$table_prefix}content` set co_id = 'company', co_html = '1', co_subject = '회사소개', co_content= '<p align=center><b>회사소개에 대한 내용을 입력하십시오.</b></p>', co_skin = 'basic', co_mobile_skin = 'basic' ", true, $dblink);
sql_query(" insert into `{$table_prefix}content` set co_id = 'privacy', co_html = '1', co_subject = '개인정보 처리방침', co_content= '<p align=center><b>개인정보 처리방침에 대한 내용을 입력하십시오.</b></p>', co_skin = 'basic', co_mobile_skin = 'basic' ", true, $dblink);
sql_query(" insert into `{$table_prefix}content` set co_id = 'provision', co_html = '1', co_subject = '서비스 이용약관', co_content= '<p align=center><b>서비스 이용약관에 대한 내용을 입력하십시오.</b></p>', co_skin = 'basic', co_mobile_skin = 'basic' ", true, $dblink);
install_query_or_fail(" insert into `{$table_prefix}content` set co_id = 'company', co_html = '1', co_subject = '회사소개', co_content= '<p align=center><b>회사소개에 대한 내용을 입력하십시오.</b></p>', co_skin = 'basic', co_mobile_skin = 'basic' ", $dblink, '회사소개 기본 내용을 저장하지 못했습니다.', $install_table_prefixes);
install_query_or_fail(" insert into `{$table_prefix}content` set co_id = 'privacy', co_html = '1', co_subject = '개인정보 처리방침', co_content= '<p align=center><b>개인정보 처리방침에 대한 내용을 입력하십시오.</b></p>', co_skin = 'basic', co_mobile_skin = 'basic' ", $dblink, '개인정보 처리방침 기본 내용을 저장하지 못했습니다.', $install_table_prefixes);
install_query_or_fail(" insert into `{$table_prefix}content` set co_id = 'provision', co_html = '1', co_subject = '서비스 이용약관', co_content= '<p align=center><b>서비스 이용약관에 대한 내용을 입력하십시오.</b></p>', co_skin = 'basic', co_mobile_skin = 'basic' ", $dblink, '서비스 이용약관 기본 내용을 저장하지 못했습니다.', $install_table_prefixes);
// FAQ Master
sql_query(" insert into `{$table_prefix}faq_master` set fm_id = '1', fm_subject = '자주하시는 질문' ", true, $dblink);
install_query_or_fail(" insert into `{$table_prefix}faq_master` set fm_id = '1', fm_subject = '자주하시는 질문' ", $dblink, 'FAQ 기본 정보를 저장하지 못했습니다.', $install_table_prefixes);
// 그누보드, 영카트 통합으로 인하여 게시판그룹을 커뮤니티(community)로 생성 (NaviGator님,210624)
// $tmp_gr_id = defined('G5_YOUNGCART_VER') ? 'shop' : 'community';
@@ -274,7 +262,7 @@ if ($g5_install || $is_install === false) {
$tmp_gr_subject = '커뮤니티';
// 게시판 그룹 생성
sql_query(" insert into `{$table_prefix}group` set gr_id = '$tmp_gr_id', gr_subject = '$tmp_gr_subject' ", true, $dblink);
install_query_or_fail(" insert into `{$table_prefix}group` set gr_id = '$tmp_gr_id', gr_subject = '$tmp_gr_subject' ", $dblink, '게시판 그룹을 생성하지 못했습니다.', $install_table_prefixes);
// 게시판 생성
$tmp_bo_subject = array ("공지사항", "질문답변", "자유게시판", "갤러리");
@@ -359,10 +347,14 @@ if ($g5_install || $is_install === false) {
bo_use_search = '0',
bo_order = '0'
";
sql_query($sql, true, $dblink);
install_query_or_fail($sql, $dblink, '게시판 기본 설정을 저장하지 못했습니다.', $install_table_prefixes);
// 게시판 테이블 생성
$file = file("../".G5_ADMIN_DIR."/sql_write.sql");
$file = @file("../".G5_ADMIN_DIR."/sql_write.sql");
if ($file === false) {
install_fail_page(G5_ADMIN_DIR."/sql_write.sql 파일을 읽을 수 없습니다.", $dblink, $install_table_prefixes);
}
$file = get_db_create_replace($file);
$sql = implode("\n", $file);
@@ -372,7 +364,7 @@ if ($g5_install || $is_install === false) {
$source = array("/__TABLE_NAME__/", "/;/");
$target = array($create_table, "");
$sql = preg_replace($source, $target, $sql);
sql_query($sql, false, $dblink);
install_query_or_fail($sql, $dblink, '게시판 글쓰기 테이블을 생성하지 못했습니다.', $install_table_prefixes);
}
}
@@ -530,7 +522,7 @@ if($g5_shop_install) {
de_sms_cont4 = '{이름}님 입금 감사합니다.\n{입금액}원\n주문번호:\n{주문번호}\n{회사명}',
de_sms_cont5 = '{이름}님 배송합니다.\n택배:{택배회사}\n운송장번호:\n{운송장번호}\n{회사명}'
";
sql_query($sql, true, $dblink);
install_query_or_fail($sql, $dblink, '쇼핑몰 기본 설정을 저장하지 못했습니다.', $install_table_prefixes);
}
?>
@@ -554,15 +546,17 @@ $dir_arr = array (
);
for ($i=0; $i<count($dir_arr); $i++) {
@mkdir($dir_arr[$i], G5_DIR_PERMISSION);
@chmod($dir_arr[$i], G5_DIR_PERMISSION);
if (!install_ensure_dir($dir_arr[$i])) {
install_fail_page($dir_arr[$i]." 디렉토리를 생성하거나 쓸 수 없습니다.\ndata 디렉토리 권한을 확인해 주십시오.", $dblink, $install_table_prefixes);
}
}
// 게시판 디렉토리 생성 (작은별님,211206)
for ($i=0; $i<count($tmp_bo_table); $i++) {
$board_dir = $data_path.'/file/'.$tmp_bo_table[$i];
@mkdir($board_dir, G5_DIR_PERMISSION);
@chmod($board_dir, G5_DIR_PERMISSION);
if (!install_ensure_dir($board_dir)) {
install_fail_page($board_dir." 디렉토리를 생성하거나 쓸 수 없습니다.\ndata 디렉토리 권한을 확인해 주십시오.", $dblink, $install_table_prefixes);
}
}
if($g5_shop_install) {
@@ -574,8 +568,9 @@ if($g5_shop_install) {
);
for ($i=0; $i<count($dir_arr); $i++) {
@mkdir($dir_arr[$i], G5_DIR_PERMISSION);
@chmod($dir_arr[$i], G5_DIR_PERMISSION);
if (!install_ensure_dir($dir_arr[$i])) {
install_fail_page($dir_arr[$i]." 디렉토리를 생성하거나 쓸 수 없습니다.\ndata 디렉토리 권한을 확인해 주십시오.", $dblink, $install_table_prefixes);
}
}
}
?>
@@ -587,84 +582,92 @@ if($g5_shop_install) {
// DB 설정 파일 생성
$file = '../'.G5_DATA_DIR.'/'.G5_DBCONFIG_FILE;
$f = @fopen($file, 'a');
$install_file_write_error = false;
$f = @fopen($file, 'w');
fwrite($f, "<?php\n");
fwrite($f, "if (!defined('_GNUBOARD_')) exit;\n");
fwrite($f, "define('G5_MYSQL_HOST', '".addcslashes($mysql_host, "\\'")."');\n");
fwrite($f, "define('G5_MYSQL_USER', '".addcslashes($mysql_user, "\\'")."');\n");
fwrite($f, "define('G5_MYSQL_PASSWORD', '".addcslashes($mysql_pass, "\\'")."');\n");
fwrite($f, "define('G5_MYSQL_DB', '".addcslashes($mysql_db, "\\'")."');\n");
fwrite($f, "define('G5_MYSQL_SET_MODE', {$mysql_set_mode});\n\n");
fwrite($f, "define('G5_TABLE_PREFIX', '{$table_prefix}');\n\n");
fwrite($f, "define('G5_TOKEN_ENCRYPTION_KEY', '".get_random_token_string(16)."'); // 토큰 암호화에 사용할 키\n\n");
fwrite($f, "\$g5['write_prefix'] = G5_TABLE_PREFIX.'write_'; // 게시판 테이블명 접두사\n\n");
fwrite($f, "\$g5['auth_table'] = G5_TABLE_PREFIX.'auth'; // 관리권한 설정 테이블\n");
fwrite($f, "\$g5['config_table'] = G5_TABLE_PREFIX.'config'; // 기본환경 설정 테이블\n");
fwrite($f, "\$g5['group_table'] = G5_TABLE_PREFIX.'group'; // 게시판 그룹 테이블\n");
fwrite($f, "\$g5['group_member_table'] = G5_TABLE_PREFIX.'group_member'; // 게시판 그룹+회원 테이블\n");
fwrite($f, "\$g5['board_table'] = G5_TABLE_PREFIX.'board'; // 게시판 설정 테이블\n");
fwrite($f, "\$g5['board_file_table'] = G5_TABLE_PREFIX.'board_file'; // 게시판 첨부파일 테이블\n");
fwrite($f, "\$g5['board_good_table'] = G5_TABLE_PREFIX.'board_good'; // 게시물 추천,비추천 테이블\n");
fwrite($f, "\$g5['board_new_table'] = G5_TABLE_PREFIX.'board_new'; // 게시판 새글 테이블\n");
fwrite($f, "\$g5['login_table'] = G5_TABLE_PREFIX.'login'; // 로그인 테이블 (접속자수)\n");
fwrite($f, "\$g5['mail_table'] = G5_TABLE_PREFIX.'mail'; // 회원메일 테이블\n");
fwrite($f, "\$g5['member_table'] = G5_TABLE_PREFIX.'member'; // 회원 테이블\n");
fwrite($f, "\$g5['member_auto_login_table'] = G5_TABLE_PREFIX.'member_auto_login'; // 자동 로그인 토큰 테이블\n");
fwrite($f, "\$g5['memo_table'] = G5_TABLE_PREFIX.'memo'; // 메모 테이블\n");
fwrite($f, "\$g5['poll_table'] = G5_TABLE_PREFIX.'poll'; // 투표 테이블\n");
fwrite($f, "\$g5['poll_etc_table'] = G5_TABLE_PREFIX.'poll_etc'; // 투표 기타의견 테이블\n");
fwrite($f, "\$g5['point_table'] = G5_TABLE_PREFIX.'point'; // 포인트 테이블\n");
fwrite($f, "\$g5['popular_table'] = G5_TABLE_PREFIX.'popular'; // 인기검색어 테이블\n");
fwrite($f, "\$g5['scrap_table'] = G5_TABLE_PREFIX.'scrap'; // 게시글 스크랩 테이블\n");
fwrite($f, "\$g5['visit_table'] = G5_TABLE_PREFIX.'visit'; // 방문자 테이블\n");
fwrite($f, "\$g5['visit_sum_table'] = G5_TABLE_PREFIX.'visit_sum'; // 방문자 합계 테이블\n");
fwrite($f, "\$g5['uniqid_table'] = G5_TABLE_PREFIX.'uniqid'; // 유니크한 값을 만드는 테이블\n");
fwrite($f, "\$g5['autosave_table'] = G5_TABLE_PREFIX.'autosave'; // 게시글 작성시 일정시간마다 글을 임시 저장하는 테이블\n");
fwrite($f, "\$g5['cert_history_table'] = G5_TABLE_PREFIX.'cert_history'; // 인증내역 테이블\n");
fwrite($f, "\$g5['qa_config_table'] = G5_TABLE_PREFIX.'qa_config'; // 1:1문의 설정테이블\n");
fwrite($f, "\$g5['qa_content_table'] = G5_TABLE_PREFIX.'qa_content'; // 1:1문의 테이블\n");
fwrite($f, "\$g5['content_table'] = G5_TABLE_PREFIX.'content'; // 내용(컨텐츠)정보 테이블\n");
fwrite($f, "\$g5['faq_table'] = G5_TABLE_PREFIX.'faq'; // 자주하시는 질문 테이블\n");
fwrite($f, "\$g5['faq_master_table'] = G5_TABLE_PREFIX.'faq_master'; // 자주하시는 질문 마스터 테이블\n");
fwrite($f, "\$g5['new_win_table'] = G5_TABLE_PREFIX.'new_win'; // 새창 테이블\n");
fwrite($f, "\$g5['menu_table'] = G5_TABLE_PREFIX.'menu'; // 메뉴관리 테이블\n");
fwrite($f, "\$g5['social_profile_table'] = G5_TABLE_PREFIX.'member_social_profiles'; // 소셜 로그인 테이블\n");
fwrite($f, "\$g5['member_cert_history_table'] = G5_TABLE_PREFIX.'member_cert_history'; // 본인인증 변경내역 테이블\n");
if($g5_shop_install) {
fwrite($f, "\n");
fwrite($f, "define('G5_USE_SHOP', true);\n\n");
fwrite($f, "define('G5_SHOP_TABLE_PREFIX', '{$g5_shop_prefix}');\n\n");
fwrite($f, "\$g5['g5_shop_default_table'] = G5_SHOP_TABLE_PREFIX.'default'; // 쇼핑몰설정 테이블\n");
fwrite($f, "\$g5['g5_shop_banner_table'] = G5_SHOP_TABLE_PREFIX.'banner'; // 배너 테이블\n");
fwrite($f, "\$g5['g5_shop_cart_table'] = G5_SHOP_TABLE_PREFIX.'cart'; // 장바구니 테이블\n");
fwrite($f, "\$g5['g5_shop_category_table'] = G5_SHOP_TABLE_PREFIX.'category'; // 상품분류 테이블\n");
fwrite($f, "\$g5['g5_shop_event_table'] = G5_SHOP_TABLE_PREFIX.'event'; // 이벤트 테이블\n");
fwrite($f, "\$g5['g5_shop_event_item_table'] = G5_SHOP_TABLE_PREFIX.'event_item'; // 상품, 이벤트 연결 테이블\n");
fwrite($f, "\$g5['g5_shop_item_table'] = G5_SHOP_TABLE_PREFIX.'item'; // 상품 테이블\n");
fwrite($f, "\$g5['g5_shop_item_option_table'] = G5_SHOP_TABLE_PREFIX.'item_option'; // 상품옵션 테이블\n");
fwrite($f, "\$g5['g5_shop_item_use_table'] = G5_SHOP_TABLE_PREFIX.'item_use'; // 상품 사용후기 테이블\n");
fwrite($f, "\$g5['g5_shop_item_qa_table'] = G5_SHOP_TABLE_PREFIX.'item_qa'; // 상품 질문답변 테이블\n");
fwrite($f, "\$g5['g5_shop_item_relation_table'] = G5_SHOP_TABLE_PREFIX.'item_relation'; // 관련 상품 테이블\n");
fwrite($f, "\$g5['g5_shop_order_table'] = G5_SHOP_TABLE_PREFIX.'order'; // 주문서 테이블\n");
fwrite($f, "\$g5['g5_shop_order_delete_table'] = G5_SHOP_TABLE_PREFIX.'order_delete'; // 주문서 삭제 테이블\n");
fwrite($f, "\$g5['g5_shop_wish_table'] = G5_SHOP_TABLE_PREFIX.'wish'; // 보관함(위시리스트) 테이블\n");
fwrite($f, "\$g5['g5_shop_coupon_table'] = G5_SHOP_TABLE_PREFIX.'coupon'; // 쿠폰정보 테이블\n");
fwrite($f, "\$g5['g5_shop_coupon_zone_table'] = G5_SHOP_TABLE_PREFIX.'coupon_zone'; // 쿠폰존 테이블\n");
fwrite($f, "\$g5['g5_shop_coupon_log_table'] = G5_SHOP_TABLE_PREFIX.'coupon_log'; // 쿠폰사용정보 테이블\n");
fwrite($f, "\$g5['g5_shop_sendcost_table'] = G5_SHOP_TABLE_PREFIX.'sendcost'; // 추가배송비 테이블\n");
fwrite($f, "\$g5['g5_shop_personalpay_table'] = G5_SHOP_TABLE_PREFIX.'personalpay'; // 개인결제 정보 테이블\n");
fwrite($f, "\$g5['g5_shop_order_address_table'] = G5_SHOP_TABLE_PREFIX.'order_address'; // 배송지이력 정보 테이블\n");
fwrite($f, "\$g5['g5_shop_item_stocksms_table'] = G5_SHOP_TABLE_PREFIX.'item_stocksms'; // 재입고SMS 알림 정보 테이블\n");
fwrite($f, "\$g5['g5_shop_post_log_table'] = G5_SHOP_TABLE_PREFIX.'order_post_log'; // 주문요청 로그 테이블\n");
fwrite($f, "\$g5['g5_shop_order_data_table'] = G5_SHOP_TABLE_PREFIX.'order_data'; // 모바일 결제정보 임시저장 테이블\n");
fwrite($f, "\$g5['g5_shop_inicis_log_table'] = G5_SHOP_TABLE_PREFIX.'inicis_log'; // 이니시스 모바일 계좌이체 로그 테이블\n");
if (!$f) {
install_fail_page($file." 파일을 생성할 수 없습니다.\ndata 디렉토리 쓰기 권한을 확인해 주십시오.", $dblink, $install_table_prefixes);
}
fwrite($f, "?>");
install_file_write($f, "<?php\n");
install_file_write($f, "if (!defined('_GNUBOARD_')) exit;\n");
install_file_write($f, "define('G5_MYSQL_HOST', '".addcslashes($mysql_host, "\\'")."');\n");
install_file_write($f, "define('G5_MYSQL_USER', '".addcslashes($mysql_user, "\\'")."');\n");
install_file_write($f, "define('G5_MYSQL_PASSWORD', '".addcslashes($mysql_pass, "\\'")."');\n");
install_file_write($f, "define('G5_MYSQL_DB', '".addcslashes($mysql_db, "\\'")."');\n");
install_file_write($f, "define('G5_MYSQL_SET_MODE', {$mysql_set_mode});\n\n");
install_file_write($f, "define('G5_TABLE_PREFIX', '{$table_prefix}');\n\n");
install_file_write($f, "define('G5_TOKEN_ENCRYPTION_KEY', '".get_random_token_string(16)."'); // 토큰 암호화에 사용할 키\n\n");
install_file_write($f, "\$g5['write_prefix'] = G5_TABLE_PREFIX.'write_'; // 게시판 테이블명 접두사\n\n");
install_file_write($f, "\$g5['auth_table'] = G5_TABLE_PREFIX.'auth'; // 관리권한 설정 테이블\n");
install_file_write($f, "\$g5['config_table'] = G5_TABLE_PREFIX.'config'; // 기본환경 설정 테이블\n");
install_file_write($f, "\$g5['group_table'] = G5_TABLE_PREFIX.'group'; // 게시판 그룹 테이블\n");
install_file_write($f, "\$g5['group_member_table'] = G5_TABLE_PREFIX.'group_member'; // 게시판 그룹+회원 테이블\n");
install_file_write($f, "\$g5['board_table'] = G5_TABLE_PREFIX.'board'; // 게시판 설정 테이블\n");
install_file_write($f, "\$g5['board_file_table'] = G5_TABLE_PREFIX.'board_file'; // 게시판 첨부파일 테이블\n");
install_file_write($f, "\$g5['board_good_table'] = G5_TABLE_PREFIX.'board_good'; // 게시물 추천,비추천 테이블\n");
install_file_write($f, "\$g5['board_new_table'] = G5_TABLE_PREFIX.'board_new'; // 게시판 새글 테이블\n");
install_file_write($f, "\$g5['login_table'] = G5_TABLE_PREFIX.'login'; // 로그인 테이블 (접속자수)\n");
install_file_write($f, "\$g5['mail_table'] = G5_TABLE_PREFIX.'mail'; // 회원메일 테이블\n");
install_file_write($f, "\$g5['member_table'] = G5_TABLE_PREFIX.'member'; // 회원 테이블\n");
install_file_write($f, "\$g5['member_auto_login_table'] = G5_TABLE_PREFIX.'member_auto_login'; // 자동 로그인 토큰 테이블\n");
install_file_write($f, "\$g5['memo_table'] = G5_TABLE_PREFIX.'memo'; // 메모 테이블\n");
install_file_write($f, "\$g5['poll_table'] = G5_TABLE_PREFIX.'poll'; // 투표 테이블\n");
install_file_write($f, "\$g5['poll_etc_table'] = G5_TABLE_PREFIX.'poll_etc'; // 투표 기타의견 테이블\n");
install_file_write($f, "\$g5['point_table'] = G5_TABLE_PREFIX.'point'; // 포인트 테이블\n");
install_file_write($f, "\$g5['popular_table'] = G5_TABLE_PREFIX.'popular'; // 인기검색어 테이블\n");
install_file_write($f, "\$g5['scrap_table'] = G5_TABLE_PREFIX.'scrap'; // 게시글 스크랩 테이블\n");
install_file_write($f, "\$g5['visit_table'] = G5_TABLE_PREFIX.'visit'; // 방문자 테이블\n");
install_file_write($f, "\$g5['visit_sum_table'] = G5_TABLE_PREFIX.'visit_sum'; // 방문자 합계 테이블\n");
install_file_write($f, "\$g5['uniqid_table'] = G5_TABLE_PREFIX.'uniqid'; // 유니크한 값을 만드는 테이블\n");
install_file_write($f, "\$g5['autosave_table'] = G5_TABLE_PREFIX.'autosave'; // 게시글 작성시 일정시간마다 글을 임시 저장하는 테이블\n");
install_file_write($f, "\$g5['cert_history_table'] = G5_TABLE_PREFIX.'cert_history'; // 인증내역 테이블\n");
install_file_write($f, "\$g5['qa_config_table'] = G5_TABLE_PREFIX.'qa_config'; // 1:1문의 설정테이블\n");
install_file_write($f, "\$g5['qa_content_table'] = G5_TABLE_PREFIX.'qa_content'; // 1:1문의 테이블\n");
install_file_write($f, "\$g5['content_table'] = G5_TABLE_PREFIX.'content'; // 내용(컨텐츠)정보 테이블\n");
install_file_write($f, "\$g5['faq_table'] = G5_TABLE_PREFIX.'faq'; // 자주하시는 질문 테이블\n");
install_file_write($f, "\$g5['faq_master_table'] = G5_TABLE_PREFIX.'faq_master'; // 자주하시는 질문 마스터 테이블\n");
install_file_write($f, "\$g5['new_win_table'] = G5_TABLE_PREFIX.'new_win'; // 새창 테이블\n");
install_file_write($f, "\$g5['menu_table'] = G5_TABLE_PREFIX.'menu'; // 메뉴관리 테이블\n");
install_file_write($f, "\$g5['social_profile_table'] = G5_TABLE_PREFIX.'member_social_profiles'; // 소셜 로그인 테이블\n");
install_file_write($f, "\$g5['member_cert_history_table'] = G5_TABLE_PREFIX.'member_cert_history'; // 본인인증 변경내역 테이블\n");
fclose($f);
if($g5_shop_install) {
install_file_write($f, "\n");
install_file_write($f, "define('G5_USE_SHOP', true);\n\n");
install_file_write($f, "define('G5_SHOP_TABLE_PREFIX', '{$g5_shop_prefix}');\n\n");
install_file_write($f, "\$g5['g5_shop_default_table'] = G5_SHOP_TABLE_PREFIX.'default'; // 쇼핑몰설정 테이블\n");
install_file_write($f, "\$g5['g5_shop_banner_table'] = G5_SHOP_TABLE_PREFIX.'banner'; // 배너 테이블\n");
install_file_write($f, "\$g5['g5_shop_cart_table'] = G5_SHOP_TABLE_PREFIX.'cart'; // 장바구니 테이블\n");
install_file_write($f, "\$g5['g5_shop_category_table'] = G5_SHOP_TABLE_PREFIX.'category'; // 상품분류 테이블\n");
install_file_write($f, "\$g5['g5_shop_event_table'] = G5_SHOP_TABLE_PREFIX.'event'; // 이벤트 테이블\n");
install_file_write($f, "\$g5['g5_shop_event_item_table'] = G5_SHOP_TABLE_PREFIX.'event_item'; // 상품, 이벤트 연결 테이블\n");
install_file_write($f, "\$g5['g5_shop_item_table'] = G5_SHOP_TABLE_PREFIX.'item'; // 상품 테이블\n");
install_file_write($f, "\$g5['g5_shop_item_option_table'] = G5_SHOP_TABLE_PREFIX.'item_option'; // 상품옵션 테이블\n");
install_file_write($f, "\$g5['g5_shop_item_use_table'] = G5_SHOP_TABLE_PREFIX.'item_use'; // 상품 사용후기 테이블\n");
install_file_write($f, "\$g5['g5_shop_item_qa_table'] = G5_SHOP_TABLE_PREFIX.'item_qa'; // 상품 질문답변 테이블\n");
install_file_write($f, "\$g5['g5_shop_item_relation_table'] = G5_SHOP_TABLE_PREFIX.'item_relation'; // 관련 상품 테이블\n");
install_file_write($f, "\$g5['g5_shop_order_table'] = G5_SHOP_TABLE_PREFIX.'order'; // 주문서 테이블\n");
install_file_write($f, "\$g5['g5_shop_order_delete_table'] = G5_SHOP_TABLE_PREFIX.'order_delete'; // 주문서 삭제 테이블\n");
install_file_write($f, "\$g5['g5_shop_wish_table'] = G5_SHOP_TABLE_PREFIX.'wish'; // 보관함(위시리스트) 테이블\n");
install_file_write($f, "\$g5['g5_shop_coupon_table'] = G5_SHOP_TABLE_PREFIX.'coupon'; // 쿠폰정보 테이블\n");
install_file_write($f, "\$g5['g5_shop_coupon_zone_table'] = G5_SHOP_TABLE_PREFIX.'coupon_zone'; // 쿠폰존 테이블\n");
install_file_write($f, "\$g5['g5_shop_coupon_log_table'] = G5_SHOP_TABLE_PREFIX.'coupon_log'; // 쿠폰사용정보 테이블\n");
install_file_write($f, "\$g5['g5_shop_sendcost_table'] = G5_SHOP_TABLE_PREFIX.'sendcost'; // 추가배송비 테이블\n");
install_file_write($f, "\$g5['g5_shop_personalpay_table'] = G5_SHOP_TABLE_PREFIX.'personalpay'; // 개인결제 정보 테이블\n");
install_file_write($f, "\$g5['g5_shop_order_address_table'] = G5_SHOP_TABLE_PREFIX.'order_address'; // 배송지이력 정보 테이블\n");
install_file_write($f, "\$g5['g5_shop_item_stocksms_table'] = G5_SHOP_TABLE_PREFIX.'item_stocksms'; // 재입고SMS 알림 정보 테이블\n");
install_file_write($f, "\$g5['g5_shop_post_log_table'] = G5_SHOP_TABLE_PREFIX.'order_post_log'; // 주문요청 로그 테이블\n");
install_file_write($f, "\$g5['g5_shop_order_data_table'] = G5_SHOP_TABLE_PREFIX.'order_data'; // 모바일 결제정보 임시저장 테이블\n");
install_file_write($f, "\$g5['g5_shop_inicis_log_table'] = G5_SHOP_TABLE_PREFIX.'inicis_log'; // 이니시스 모바일 계좌이체 로그 테이블\n");
}
install_file_write($f, "?>");
$install_file_closed = @fclose($f);
if ($install_file_write_error || !$install_file_closed) {
install_fail_page($file." 파일에 DB 설정을 저장하지 못했습니다.\ndata 디렉토리 용량과 쓰기 권한을 확인해 주십시오.", $dblink, $install_table_prefixes);
}
@chmod($file, G5_FILE_PERMISSION);
?>
@@ -672,7 +675,14 @@ fclose($f);
<?php
// data 디렉토리 및 하위 디렉토리에서는 .htaccess .htpasswd .php .phtml .html .htm .inc .cgi .pl .phar 파일을 실행할수 없게함.
$f = fopen($data_path.'/.htaccess', 'w');
$htaccess_file = $data_path.'/.htaccess';
$install_file_write_error = false;
$f = @fopen($htaccess_file, 'w');
if (!$f) {
install_fail_page($htaccess_file." 파일을 생성할 수 없습니다.\ndata 디렉토리 쓰기 권한을 확인해 주십시오.", $dblink, $install_table_prefixes);
}
$str = <<<EOD
<FilesMatch "\.(htaccess|htpasswd|[Pp][Hh][Pp]|[Pp][Hh][Tt]|[Ss]?[Pp]?[Hh][Tt][Mm][Ll]?|[Ii][Nn][Cc]|[Cc][Gg][Ii]|[Pp][Ll]|[Pp][Hh][Aa][Rr]|[Ss][Vv][Gg][Zz]?)">
Order allow,deny
@@ -680,14 +690,26 @@ Deny from all
</FilesMatch>
RedirectMatch 403 /session/.*
EOD;
fwrite($f, $str);
fclose($f);
install_file_write($f, $str);
$install_file_closed = @fclose($f);
if ($install_file_write_error || !$install_file_closed) {
install_fail_page($htaccess_file." 파일을 저장하지 못했습니다.\ndata 디렉토리 용량과 쓰기 권한을 확인해 주십시오.", $dblink, $install_table_prefixes);
}
if($g5_shop_install) {
@copy('./logo_img', $data_path.'/common/logo_img');
@copy('./logo_img', $data_path.'/common/logo_img2');
@copy('./mobile_logo_img', $data_path.'/common/mobile_logo_img');
@copy('./mobile_logo_img', $data_path.'/common/mobile_logo_img2');
$copy_files = array(
array('./logo_img', $data_path.'/common/logo_img'),
array('./logo_img', $data_path.'/common/logo_img2'),
array('./mobile_logo_img', $data_path.'/common/mobile_logo_img'),
array('./mobile_logo_img', $data_path.'/common/mobile_logo_img2')
);
for ($i=0; $i<count($copy_files); $i++) {
if (!@copy($copy_files[$i][0], $copy_files[$i][1])) {
install_fail_page($copy_files[$i][1]." 파일을 복사하지 못했습니다.\ndata 디렉토리 권한을 확인해 주십시오.", $dblink, $install_table_prefixes);
}
}
}
//-------------------------------------------------------------------------------------------------
?>
+71 -5
View File
@@ -1,8 +1,74 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
if(!extension_loaded('gd') || !function_exists('gd_info')) {
echo '<script>'.PHP_EOL;
echo 'alert("'.G5_VERSION.'의 정상적인 사용을 위해서는 GD 라이브러리가 필요합니다.\nGD 라이브러리가 없을 경우 자동등록방지 문자와 썸네일 기능이 작동하지 않습니다.");'.PHP_EOL;
echo '</script>'.PHP_EOL;
}
$install_library_required_missing = false;
$install_library_checks = array(
array(
'name' => 'MySQL 확장',
'required' => true,
'ok' => (function_exists('mysqli_connect') && G5_MYSQLI_USE) || function_exists('mysql_connect'),
'message' => 'MySQL DB 연결에 필요합니다.'
),
array(
'name' => 'JSON',
'required' => true,
'ok' => function_exists('json_encode') && function_exists('json_decode'),
'message' => '설치 전 DB 점검 응답 처리에 필요합니다.'
),
array(
'name' => 'iconv 또는 mbstring',
'required' => true,
'ok' => function_exists('iconv') || function_exists('mb_convert_encoding'),
'message' => '문자열 인코딩 처리에 필요합니다.'
),
array(
'name' => 'GD',
'required' => false,
'ok' => extension_loaded('gd') && function_exists('gd_info'),
'message' => '자동등록방지 문자와 썸네일 기능에 필요합니다.'
),
array(
'name' => 'OpenSSL',
'required' => false,
'ok' => extension_loaded('openssl'),
'message' => '암호화, 외부 연동, 보안 통신 기능 사용 시 권장됩니다.'
),
array(
'name' => 'cURL',
'required' => false,
'ok' => function_exists('curl_init'),
'message' => '외부 API, 결제, 소셜 연동 사용 시 권장됩니다.'
),
array(
'name' => 'Fileinfo',
'required' => false,
'ok' => function_exists('finfo_open'),
'message' => '업로드 파일의 MIME 타입 확인에 권장됩니다.'
)
);
foreach ($install_library_checks as $check) {
if ($check['required'] && !$check['ok']) {
$install_library_required_missing = true;
break;
}
}
?>
<div class="ins_inner">
<h2>서버 환경 점검</h2>
<ul>
<?php for ($i=0; $i<count($install_library_checks); $i++) { ?>
<li>
<strong><?php echo $install_library_checks[$i]['ok'] ? '확인' : ($install_library_checks[$i]['required'] ? '필수 누락' : '권장 누락'); ?></strong>
- <?php echo $install_library_checks[$i]['name']; ?>
(<?php echo $install_library_checks[$i]['required'] ? '필수' : '권장'; ?>)
: <?php echo $install_library_checks[$i]['message']; ?>
</li>
<?php } ?>
</ul>
<?php if ($install_library_required_missing) { ?>
<p>필수 서버 환경이 준비되지 않아 설치를 진행할 수 없습니다. 누락된 PHP 확장을 설치한 뒤 새로고침해 주십시오.</p>
<?php } else { ?>
<p>필수 서버 환경을 확인했습니다. 권장 항목은 설치 후 일부 기능 사용에 영향을 줄 수 있습니다.</p>
<?php } ?>
</div>
+14 -6
View File
@@ -112,11 +112,14 @@ function goto_url($url)
if (!headers_sent())
header('Location: '.$url);
else {
$js_replace = array('\\' => '\\\\', '"' => '\\"', "'" => '\\u0027', '/' => '\\/', "\r" => '\\r', "\n" => '\\n', "\t" => '\\t', '<' => '\\u003C', '>' => '\\u003E', '&' => '\\u0026', "\xE2\x80\xA8" => '\\u2028', "\xE2\x80\xA9" => '\\u2029');
$js_url = function_exists('get_js_safe_string') ? get_js_safe_string($url) : '"'.strtr((string)$url, $js_replace).'"';
$html_url = htmlspecialchars($url, ENT_QUOTES);
echo '<script>';
echo 'location.replace("'.$url.'");';
echo 'location.replace('.$js_url.');';
echo '</script>';
echo '<noscript>';
echo '<meta http-equiv="refresh" content="0;url='.$url.'" />';
echo '<meta http-equiv="refresh" content="0;url='.$html_url.'" />';
echo '</noscript>';
}
exit;
@@ -3301,7 +3304,7 @@ class html_process {
$member['mb_id'] = '';
}
if ($tmp_row['cnt']) {
if (!empty($tmp_row['cnt'])) {
$tmp_sql = " update {$g5['login_table']} set mb_id = '{$member['mb_id']}', lo_datetime = '".G5_TIME_YMDHIS."', lo_location = '{$g5['lo_location']}', lo_url = '{$g5['lo_url']}' where lo_ip = '{$_SERVER['REMOTE_ADDR']}' ";
sql_query($tmp_sql, FALSE);
} else {
@@ -3740,7 +3743,9 @@ function module_exec_check($exe, $type)
}
if($error) {
$error = '<script>alert("'.$error.'");</script>';
$js_replace = array('\\' => '\\\\', '"' => '\\"', "'" => '\\u0027', '/' => '\\/', "\r" => '\\r', "\n" => '\\n', "\t" => '\\t', '<' => '\\u003C', '>' => '\\u003E', '&' => '\\u0026', "\xE2\x80\xA8" => '\\u2028', "\xE2\x80\xA9" => '\\u2029');
$js_error = function_exists('get_js_safe_string') ? get_js_safe_string($error) : '"'.strtr((string)$error, $js_replace).'"';
$error = '<script>alert('.$js_error.');</script>';
}
return $error;
@@ -4165,13 +4170,16 @@ function check_url_host($url, $msg='', $return_url=G5_URL, $is_redirect=false)
if ((isset($p['scheme']) && $p['scheme']) || (isset($p['host']) && $p['host']) || $is_host_check) {
//if ($p['host'].(isset($p['port']) ? ':'.$p['port'] : '') != $_SERVER['HTTP_HOST']) {
if (run_replace('check_same_url_host', (($p['host'] != $host) || $is_host_check), $p, $host, $is_host_check, $return_url, $is_redirect)) {
$js_replace = array('\\' => '\\\\', '"' => '\\"', "'" => '\\u0027', '/' => '\\/', "\r" => '\\r', "\n" => '\\n', "\t" => '\\t', '<' => '\\u003C', '>' => '\\u003E', '&' => '\\u0026', "\xE2\x80\xA8" => '\\u2028', "\xE2\x80\xA9" => '\\u2029');
$js_return_url = function_exists('get_js_safe_string') ? get_js_safe_string($return_url) : '"'.strtr((string)$return_url, $js_replace).'"';
$html_return_url = htmlspecialchars($return_url, ENT_QUOTES);
echo '<script>'.PHP_EOL;
echo 'alert("url에 타 도메인을 지정할 수 없습니다.");'.PHP_EOL;
echo 'document.location.href = "'.$return_url.'";'.PHP_EOL;
echo 'document.location.href = '.$js_return_url.';'.PHP_EOL;
echo '</script>'.PHP_EOL;
echo '<noscript>'.PHP_EOL;
echo '<p>'.$msg.'</p>'.PHP_EOL;
echo '<p><a href="'.$return_url.'">돌아가기</a></p>'.PHP_EOL;
echo '<p><a href="'.$html_return_url.'">돌아가기</a></p>'.PHP_EOL;
echo '</noscript>'.PHP_EOL;
exit;
}
+7 -3
View File
@@ -1405,11 +1405,15 @@ function alert_opener($msg='', $url='')
global $g5;
if (!$msg) $msg = '올바른 방법으로 이용해 주십시오.';
$msg = strip_tags($msg);
$js_replace = array('\\' => '\\\\', '"' => '\\"', "'" => '\\u0027', '/' => '\\/', "\r" => '\\r', "\n" => '\\n', "\t" => '\\t', '<' => '\\u003C', '>' => '\\u003E', '&' => '\\u0026', "\xE2\x80\xA8" => '\\u2028', "\xE2\x80\xA9" => '\\u2029');
$js_msg = function_exists('get_js_safe_string') ? get_js_safe_string($msg) : '"'.strtr((string)$msg, $js_replace).'"';
$js_url = function_exists('get_js_safe_string') ? get_js_safe_string($url) : '"'.strtr((string)$url, $js_replace).'"';
echo "<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">";
echo "<script>";
echo "alert(\"$msg\");";
echo "opener.location.href=\"$url\";";
echo "alert(".$js_msg.");";
echo "opener.location.href=".$js_url.";";
echo "self.close();";
echo "</script>";
exit;
@@ -2976,4 +2980,4 @@ function is_coupon_downloaded($mb_id, $cz_id)
//==============================================================================
// 쇼핑몰 라이브러리 모음 끝
//==============================================================================;
//==============================================================================;
+16 -14
View File
@@ -78,8 +78,10 @@ if(!isset($check_tmp['od_other_pay_type'])){
$od_other_pay_type = '';
$od_temp_point = isset($_POST['od_temp_point']) ? (int) $_POST['od_temp_point'] : 0;
$od_hope_date = isset($_POST['od_hope_date']) ? clean_xss_tags($_POST['od_hope_date'], 1, 1) : '';
$od_hope_date = isset($_POST['od_hope_date']) ? addslashes(clean_xss_tags(stripslashes($_POST['od_hope_date']), 1, 1)) : '';
$ad_default = isset($_POST['ad_default']) ? (int) $_POST['ad_default'] : 0;
$post_od_cp_id = isset($_POST['od_cp_id']) ? safe_replace_regex($_POST['od_cp_id'], 'cp_id') : '';
$post_sc_cp_id = isset($_POST['sc_cp_id']) ? safe_replace_regex($_POST['sc_cp_id'], 'cp_id') : '';
$error = "";
// 장바구니 상품 재고 검사
@@ -141,7 +143,7 @@ if($is_member) {
$it_cp_cnt = (isset($_POST['cp_id']) && is_array($_POST['cp_id'])) ? count($_POST['cp_id']) : 0;
$arr_it_cp_prc = array();
for($i=0; $i<$it_cp_cnt; $i++) {
$cid = isset($_POST['cp_id'][$i]) ? $_POST['cp_id'][$i] : '';
$cid = isset($_POST['cp_id'][$i]) ? safe_replace_regex($_POST['cp_id'][$i], 'cp_id') : '';
$it_id = isset($_POST['it_id'][$i]) ? safe_replace_regex($_POST['it_id'][$i], 'it_id') : '';
$sql = " select cp_id, cp_method, cp_target, cp_type, cp_price, cp_trunc, cp_minimum, cp_maximum
from {$g5['g5_shop_coupon_table']}
@@ -207,10 +209,10 @@ if($is_member) {
$tot_od_price -= $tot_it_cp_price;
// 주문쿠폰
if(isset($_POST['od_cp_id']) && $_POST['od_cp_id']) {
if($post_od_cp_id) {
$sql = " select cp_id, cp_type, cp_price, cp_trunc, cp_minimum, cp_maximum
from {$g5['g5_shop_coupon_table']}
where cp_id = '{$_POST['od_cp_id']}'
where cp_id = '$post_od_cp_id'
and mb_id IN ( '{$member['mb_id']}', '전체회원' )
and cp_start <= '".G5_TIME_YMD."'
and cp_end >= '".G5_TIME_YMD."'
@@ -253,10 +255,10 @@ $send_cost = get_sendcost($tmp_cart_id);
$tot_sc_cp_price = 0;
if($is_member && $send_cost > 0) {
// 배송쿠폰
if(isset($_POST['sc_cp_id']) && $_POST['sc_cp_id']) {
if($post_sc_cp_id) {
$sql = " select cp_id, cp_type, cp_price, cp_trunc, cp_minimum, cp_maximum
from {$g5['g5_shop_coupon_table']}
where cp_id = '{$_POST['sc_cp_id']}'
where cp_id = '$post_sc_cp_id'
and mb_id IN ( '{$member['mb_id']}', '전체회원' )
and cp_start <= '".G5_TIME_YMD."'
and cp_end >= '".G5_TIME_YMD."'
@@ -800,7 +802,7 @@ $coupon_duplicate = false;
if($is_member) {
$it_cp_cnt = (isset($_POST['cp_id']) && is_array($_POST['cp_id'])) ? count($_POST['cp_id']) : 0;
for($i=0; $i<$it_cp_cnt; $i++) {
$cid = isset($_POST['cp_id'][$i]) ? clean_xss_tags($_POST['cp_id'][$i], 1, 1) : '';
$cid = isset($_POST['cp_id'][$i]) ? safe_replace_regex($_POST['cp_id'][$i], 'cp_id') : '';
$cp_it_id = isset($_POST['it_id'][$i]) ? safe_replace_regex($_POST['it_id'][$i], 'it_id') : '';
$cp_prc = isset($arr_it_cp_prc[$cp_it_id]) ? (int) $arr_it_cp_prc[$cp_it_id] : 0;
@@ -838,13 +840,13 @@ if($is_member) {
sql_query($sql);
}
if(!$coupon_duplicate && isset($_POST['od_cp_id']) && $_POST['od_cp_id']) {
if(!$coupon_duplicate && $post_od_cp_id) {
// 쿠폰 이중사용 방지: INSERT 직전 재확인
if(is_used_coupon($member['mb_id'], $_POST['od_cp_id'])) {
if(is_used_coupon($member['mb_id'], $post_od_cp_id)) {
$coupon_duplicate = true;
} else {
$sql = " insert into {$g5['g5_shop_coupon_log_table']}
set cp_id = '{$_POST['od_cp_id']}',
set cp_id = '$post_od_cp_id',
mb_id = '{$member['mb_id']}',
od_id = '$od_id',
cp_price = '$tot_od_cp_price',
@@ -857,13 +859,13 @@ if($is_member) {
}
}
if(!$coupon_duplicate && isset($_POST['sc_cp_id']) && $_POST['sc_cp_id']) {
if(!$coupon_duplicate && $post_sc_cp_id) {
// 쿠폰 이중사용 방지: INSERT 직전 재확인
if(is_used_coupon($member['mb_id'], $_POST['sc_cp_id'])) {
if(is_used_coupon($member['mb_id'], $post_sc_cp_id)) {
$coupon_duplicate = true;
} else {
$sql = " insert into {$g5['g5_shop_coupon_log_table']}
set cp_id = '{$_POST['sc_cp_id']}',
set cp_id = '$post_sc_cp_id',
mb_id = '{$member['mb_id']}',
od_id = '$od_id',
cp_price = '$tot_sc_cp_price',
@@ -1082,4 +1084,4 @@ if( $is_noti_pay ){
return;
}
goto_url(G5_SHOP_URL.'/orderinquiryview.php?od_id='.$od_id.'&amp;uid='.$uid);
goto_url(G5_SHOP_URL.'/orderinquiryview.php?od_id='.$od_id.'&amp;uid='.$uid);
+1 -1
View File
@@ -21,7 +21,7 @@ if( !class_exists('HTMLPurifier_Filter_Iframevideo') ){
*/
public function preFilter($html, $config, $context)
{
if (strstr($html, '<iframe')) {
if (strstr((string)$html, '<iframe')) {
$html = preg_replace_callback('/<iframe.*?src="https?:\/\/www\.youtube\.com\/embed\/([^"]*)[^>]*>(.*?)?\/iframe>/i', array($this, 'trust_url_match'), $html);
$html = preg_replace_callback('/<iframe.*?src="https?:\/\/player\.vimeo.com\/video\/([^"]*)[^>]*>(.*?)?\/iframe>/i', array($this, 'trust_url_match'), $html);
$html = preg_replace_callback('/<iframe.*?src="https?:\/\/www\.facebook.com\/plugins\/([^"]*)[^>]*>(.*?)?\/iframe>/i', array($this, 'trust_url_match'), $html);
+2 -5
View File
@@ -2,7 +2,7 @@
if (!defined('_GNUBOARD_')) exit;
if (version_compare(PHP_VERSION, '7.0.0', '<')) {
alert('KCP 휴대폰 본인확인 V2 모듈은 PHP 7.0 이상 환경에서만 동작합니다.\n관리자 > 기본환경설정에서 V1 모듈을 선택해 주세요.', G5_URL);
alert('KCP 휴대폰 본인확인 V2 모듈은 PHP 7.0 이상 환경에서만 동작합니다.', G5_URL);
}
if (!extension_loaded('openssl') || !function_exists('hash_pbkdf2') || !extension_loaded('curl')) {
alert('KCP 휴대폰 본인확인 V2 모듈에 필요한 PHP 확장(openssl/curl/hash_pbkdf2)이 활성화되어 있지 않습니다.', G5_URL);
@@ -11,10 +11,7 @@ if (!extension_loaded('openssl') || !function_exists('hash_pbkdf2') || !extensio
$web_siteid = '';
if ($config['cf_cert_use'] == 2) {
$site_cd = isset($config['cf_cert_kcp_cd']) ? trim($config['cf_cert_kcp_cd']) : '';
if (strlen($site_cd) === 3) {
$site_cd = 'SM'.$site_cd;
}
$site_cd = 'SM'.trim($config['cf_cert_kcp_cd']);
$kcp_enc_key = isset($config['cf_cert_kcp_enckey']) ? $config['cf_cert_kcp_enckey'] : '';
$cert_reg_url = 'https://cert.kcp.co.kr/api/reg/certDataReg.do';
$cert_dec_url = 'https://cert.kcp.co.kr/api/query/getCertData.do';
+10 -4
View File
@@ -81,16 +81,22 @@ set_session('ss_cert_adult', $adult);
set_session('ss_cert_birth', $birth_day);
set_session('ss_cert_sex', ($sex_code == '01' ? 'M' : 'F'));
set_session('ss_cert_dupinfo', $mb_dupinfo);
$js_replace = array('\\' => '\\\\', '"' => '\\"', "'" => '\\u0027', '/' => '\\/', "\r" => '\\r', "\n" => '\\n', "\t" => '\\t', '<' => '\\u003C', '>' => '\\u003E', '&' => '\\u0026', "\xE2\x80\xA8" => '\\u2028', "\xE2\x80\xA9" => '\\u2029');
$js_cert_type = function_exists('get_js_safe_string') ? get_js_safe_string($cert_type) : '"'.strtr((string)$cert_type, $js_replace).'"';
$js_user_name = function_exists('get_js_safe_string') ? get_js_safe_string($user_name) : '"'.strtr((string)$user_name, $js_replace).'"';
$js_phone_no = function_exists('get_js_safe_string') ? get_js_safe_string($phone_no) : '"'.strtr((string)$phone_no, $js_replace).'"';
$js_md5_cert_no = function_exists('get_js_safe_string') ? get_js_safe_string($md5_cert_no) : '"'.strtr((string)$md5_cert_no, $js_replace).'"';
?>
<script>
jQuery(function($) {
var $opener = window.opener;
if (!$opener) { window.close(); return; }
$opener.$("input[name=cert_type]").val(<?php echo get_js_safe_string($cert_type); ?>);
$opener.$("input[name=mb_name]").val(<?php echo get_js_safe_string($user_name); ?>).attr("readonly", true);
$opener.$("input[name=mb_hp]").val(<?php echo get_js_safe_string($phone_no); ?>).attr("readonly", true);
$opener.$("input[name=cert_no]").val(<?php echo get_js_safe_string($md5_cert_no); ?>);
$opener.$("input[name=cert_type]").val(<?php echo $js_cert_type; ?>);
$opener.$("input[name=mb_name]").val(<?php echo $js_user_name; ?>).attr("readonly", true);
$opener.$("input[name=mb_hp]").val(<?php echo $js_phone_no; ?>).attr("readonly", true);
$opener.$("input[name=cert_no]").val(<?php echo $js_md5_cert_no; ?>);
alert("본인의 휴대폰번호로 확인 되었습니다.");
+4 -2
View File
@@ -98,7 +98,9 @@ if ($retcode == "B000") {
echo ("<script>request();</script>");
} else {
//요청 실패 페이지로 리턴
echo ("<script>alert(\"$retcode\"); self.close();</script>");
$js_replace = array('\\' => '\\\\', '"' => '\\"', "'" => '\\u0027', '/' => '\\/', "\r" => '\\r', "\n" => '\\n', "\t" => '\\t', '<' => '\\u003C', '>' => '\\u003E', '&' => '\\u0026', "\xE2\x80\xA8" => '\\u2028', "\xE2\x80\xA9" => '\\u2029');
$js_retcode = function_exists('get_js_safe_string') ? get_js_safe_string($retcode) : '"'.strtr((string)$retcode, $js_replace).'"';
echo ("<script>alert(".$js_retcode."); self.close();</script>");
}
include_once(G5_PATH.'/tail.sub.php');
include_once(G5_PATH.'/tail.sub.php');
+1
View File
@@ -368,6 +368,7 @@ function social_escape_request($request){
function social_get_request_provider(){
$provider_name = isset($_REQUEST['provider']) ? ucfirst(social_escape_request($_REQUEST['provider'])) : '';
$provider_name = preg_replace('/[^a-z0-9_]/i', '', $provider_name); // 허용 문자만 유지
return $provider_name;
}
+3
View File
@@ -1,6 +1,9 @@
<?php
include_once('./_common.php');
// 요청 출처 검증
if (function_exists('check_request_origin')) check_request_origin(G5_SHOP_URL);
if(empty($_POST))
die('정보가 넘어오지 않았습니다.');
+3 -3
View File
@@ -35,13 +35,13 @@ $var_datas = array();
foreach($data as $key=>$value) {
if(is_array($value)) {
foreach($value as $k=>$v) {
$_POST[$key][$k] = $params[$key][$k] = clean_xss_tags(strip_tags($v));
$_POST[$key][$k] = $params[$key][$k] = addslashes(clean_xss_tags(strip_tags(stripslashes($v))));
}
} else {
if(in_array($key, array('od_memo'))){
$_POST[$key] = $params[$key] = clean_xss_tags(strip_tags($value), 0, 0, 0, 0);
$_POST[$key] = $params[$key] = addslashes(clean_xss_tags(strip_tags(stripslashes($value)), 0, 0, 0, 0));
} else {
$_POST[$key] = $params[$key] = clean_xss_tags(strip_tags($value));
$_POST[$key] = $params[$key] = addslashes(clean_xss_tags(strip_tags(stripslashes($value))));
}
}
}
+2 -1
View File
@@ -150,7 +150,8 @@ if (isset($ini_result['resultCode']) && $ini_result['resultCode'] == '00') {
$cash['ApplDate'] = $ini_result['authDate'];
$cash['ApplTime'] = $ini_result['authTime'];
$cash['CSHR_Type'] = $ini_result['authUseOpt'];
$cash_info = serialize($cash);
$cash_info = sql_real_escape_string(serialize($cash));
$cash_no = sql_real_escape_string($cash_no);
if($tx == 'personalpay') {
$sql = " update {$g5['g5_shop_personalpay_table']}
+2 -2
View File
@@ -42,10 +42,10 @@ $var_datas = array();
foreach($data as $key=>$value) {
if(is_array($value)) {
foreach($value as $k=>$v) {
$_POST[$key][$k] = $params[$key][$k] = clean_xss_tags(strip_tags($v));
$_POST[$key][$k] = $params[$key][$k] = addslashes(clean_xss_tags(strip_tags(stripslashes($v))));
}
} else {
$_POST[$key] = $params[$key] = clean_xss_tags(strip_tags($value));
$_POST[$key] = $params[$key] = addslashes(clean_xss_tags(strip_tags(stripslashes($value))));
}
}
+1 -1
View File
@@ -137,7 +137,7 @@ if($authResultCode === "0000"){
$bank_name = $bankname = nicepay_res('VbankBankName', $respArr);
$account = nicepay_res('VbankNum', $respArr);
$va_date = nicepay_res('VbankExpDate', $respArr).' '.nicepay_res('VbankExpTime', $respArr); // 가상계좌 입금마감시간
$app_no = nicepay_res('VbankNum', $respArr);
$od_app_no = $app_no = nicepay_res('VbankNum', $respArr); // 입금통보 매칭을 위해 가상계좌번호를 보관
if ($default['de_escrow_use'] == 1)
$escw_yn = 'Y';
+17 -15
View File
@@ -54,8 +54,10 @@ if(!isset($check_tmp['od_other_pay_type'])){
$od_other_pay_type = '';
$od_temp_point = isset($_POST['od_temp_point']) ? (int) $_POST['od_temp_point'] : 0;
$od_hope_date = isset($_POST['od_hope_date']) ? clean_xss_tags($_POST['od_hope_date'], 1, 1) : '';
$od_hope_date = isset($_POST['od_hope_date']) ? addslashes(clean_xss_tags(stripslashes($_POST['od_hope_date']), 1, 1)) : '';
$ad_default = ! empty($_POST['ad_default']) ? (int) $_POST['ad_default'] : 0;
$post_od_cp_id = isset($_POST['od_cp_id']) ? safe_replace_regex($_POST['od_cp_id'], 'cp_id') : '';
$post_sc_cp_id = isset($_POST['sc_cp_id']) ? safe_replace_regex($_POST['sc_cp_id'], 'cp_id') : '';
$error = "";
// 장바구니 상품 재고 검사
@@ -116,7 +118,7 @@ if($is_member) {
$it_cp_cnt = (isset($_POST['cp_id']) && is_array($_POST['cp_id'])) ? count($_POST['cp_id']) : 0;
$arr_it_cp_prc = array();
for($i=0; $i<$it_cp_cnt; $i++) {
$cid = isset($_POST['cp_id'][$i]) ? clean_xss_tags($_POST['cp_id'][$i], 1, 1) : '';
$cid = isset($_POST['cp_id'][$i]) ? safe_replace_regex($_POST['cp_id'][$i], 'cp_id') : '';
$it_id = isset($_POST['it_id'][$i]) ? safe_replace_regex($_POST['it_id'][$i], 'it_id') : '';
$sql = " select cp_id, cp_method, cp_target, cp_type, cp_price, cp_trunc, cp_minimum, cp_maximum
from {$g5['g5_shop_coupon_table']}
@@ -182,10 +184,10 @@ if($is_member) {
$tot_od_price -= $tot_it_cp_price;
// 주문쿠폰
if(isset($_POST['od_cp_id']) && $_POST['od_cp_id']) {
if($post_od_cp_id) {
$sql = " select cp_id, cp_type, cp_price, cp_trunc, cp_minimum, cp_maximum
from {$g5['g5_shop_coupon_table']}
where cp_id = '{$_POST['od_cp_id']}'
where cp_id = '$post_od_cp_id'
and mb_id IN ( '{$member['mb_id']}', '전체회원' )
and cp_start <= '".G5_TIME_YMD."'
and cp_end >= '".G5_TIME_YMD."'
@@ -228,10 +230,10 @@ $send_cost = get_sendcost($tmp_cart_id);
$tot_sc_cp_price = 0;
if($is_member && $send_cost > 0) {
// 배송쿠폰
if(isset($_POST['sc_cp_id']) && $_POST['sc_cp_id']) {
if($post_sc_cp_id) {
$sql = " select cp_id, cp_type, cp_price, cp_trunc, cp_minimum, cp_maximum
from {$g5['g5_shop_coupon_table']}
where cp_id = '{$_POST['sc_cp_id']}'
where cp_id = '$post_sc_cp_id'
and mb_id IN ( '{$member['mb_id']}', '전체회원' )
and cp_start <= '".G5_TIME_YMD."'
and cp_end >= '".G5_TIME_YMD."'
@@ -755,8 +757,8 @@ $coupon_duplicate = false;
if($is_member) {
$it_cp_cnt = (isset($_POST['cp_id']) && is_array($_POST['cp_id'])) ? count($_POST['cp_id']) : 0;
for($i=0; $i<$it_cp_cnt; $i++) {
$cid = isset($_POST['cp_id'][$i]) ? clean_xss_tags($_POST['cp_id'][$i], 1, 1) : '';
$cp_it_id = isset($_POST['it_id'][$i]) ? clean_xss_tags($_POST['it_id'][$i], 1, 1) : '';
$cid = isset($_POST['cp_id'][$i]) ? safe_replace_regex($_POST['cp_id'][$i], 'cp_id') : '';
$cp_it_id = isset($_POST['it_id'][$i]) ? safe_replace_regex($_POST['it_id'][$i], 'it_id') : '';
$cp_prc = isset($arr_it_cp_prc[$cp_it_id]) ? (int) $arr_it_cp_prc[$cp_it_id] : 0;
if(trim($cid)) {
@@ -793,13 +795,13 @@ if($is_member) {
sql_query($sql);
}
if(!$coupon_duplicate && isset($_POST['od_cp_id']) && $_POST['od_cp_id']) {
if(!$coupon_duplicate && $post_od_cp_id) {
// 쿠폰 이중사용 방지: INSERT 직전 재확인
if(is_used_coupon($member['mb_id'], $_POST['od_cp_id'])) {
if(is_used_coupon($member['mb_id'], $post_od_cp_id)) {
$coupon_duplicate = true;
} else {
$sql = " insert into {$g5['g5_shop_coupon_log_table']}
set cp_id = '{$_POST['od_cp_id']}',
set cp_id = '$post_od_cp_id',
mb_id = '{$member['mb_id']}',
od_id = '$od_id',
cp_price = '$tot_od_cp_price',
@@ -812,13 +814,13 @@ if($is_member) {
}
}
if(!$coupon_duplicate && isset($_POST['sc_cp_id']) && $_POST['sc_cp_id']) {
if(!$coupon_duplicate && $post_sc_cp_id) {
// 쿠폰 이중사용 방지: INSERT 직전 재확인
if(is_used_coupon($member['mb_id'], $_POST['sc_cp_id'])) {
if(is_used_coupon($member['mb_id'], $post_sc_cp_id)) {
$coupon_duplicate = true;
} else {
$sql = " insert into {$g5['g5_shop_coupon_log_table']}
set cp_id = '{$_POST['sc_cp_id']}',
set cp_id = '$post_sc_cp_id',
mb_id = '{$member['mb_id']}',
od_id = '$od_id',
cp_price = '$tot_sc_cp_price',
@@ -1052,4 +1054,4 @@ goto_url(G5_SHOP_URL.'/orderinquiryview.php?od_id='.$od_id.'&amp;uid='.$uid);
document.onkeydown = noRefresh ;
</script>
</head>
</html>
</html>
+8 -3
View File
@@ -27,7 +27,7 @@ $ct = sql_fetch($sql);
$uid = function_exists('get_shop_uid') ? get_shop_uid('order', $od['od_id'], $od['od_time'], $od['od_ip']) : md5($od['od_id'].$od['od_time'].$od['od_ip']);
if($od['od_cancel_price'] > 0 || $ct['od_count1'] != $ct['od_count2']) {
if($od['od_cancel_price'] > 0 || $od['od_status'] != '주문' || $ct['od_count1'] != $ct['od_count2']) {
alert("취소할 수 있는 주문이 아닙니다.", G5_SHOP_URL."/orderinquiryview.php?od_id=$od_id&amp;uid=$uid");
}
@@ -102,7 +102,12 @@ if($od['od_tno']) {
$tno = $od['od_tno'];
$cancelAmt = $od['od_receipt_price'];
$cancelAmt = (int)$od['od_receipt_price'];
if($od['od_settle_case'] == '가상계좌' && $od['od_status'] == '주문' && $cancelAmt == 0)
$cancelAmt = (int)$od['od_misu'];
if($cancelAmt <= 0)
alert('취소 요청금액이 없습니다.', G5_SHOP_URL."/orderinquiryview.php?od_id=$od_id&amp;uid=$uid");
// 0:전체 취소, 1:부분 취소(별도 계약 필요)
$partialCancelCode = 0;
@@ -182,4 +187,4 @@ if ($od['od_receipt_point'] > 0 && $affected) {
insert_point($member['mb_id'], $od['od_receipt_point'], "주문번호 $od_id 본인 취소", '@shop_order', $od_id, 'cancel');
}
goto_url(G5_SHOP_URL."/orderinquiryview.php?od_id=$od_id&amp;uid=$uid");
goto_url(G5_SHOP_URL."/orderinquiryview.php?od_id=$od_id&amp;uid=$uid");
+17 -17
View File
@@ -15,28 +15,28 @@ $pg_allow_ips = array(
// PG 사에서 보냈는지 IP로 체크
if (in_array($_SERVER['REMOTE_ADDR'], $pg_allow_ips)) {
$PayMethod = isset($_POST['PayMethod']) ? clean_xss_tags($_POST['PayMethod']) : ''; //지불수단
$M_ID = isset($_POST['MID']) ? clean_xss_tags($_POST['MID']) : ''; //상점ID
$MallUserID = isset($_POST['MallUserID']) ? clean_xss_tags($_POST['MallUserID']) : ''; //회원사 ID
$PayMethod = isset($_POST['PayMethod']) ? addslashes(clean_xss_tags(stripslashes($_POST['PayMethod']))) : ''; //지불수단
$M_ID = isset($_POST['MID']) ? addslashes(clean_xss_tags(stripslashes($_POST['MID']))) : ''; //상점ID
$MallUserID = isset($_POST['MallUserID']) ? addslashes(clean_xss_tags(stripslashes($_POST['MallUserID']))) : ''; //회원사 ID
$Amt = isset($_POST['Amt']) ? (int) $_POST['Amt'] : 0; //금액
$name = isset($_POST['name']) ? clean_xss_tags($_POST['name']) : ''; //구매자명
$GoodsName = isset($_POST['GoodsName']) ? clean_xss_tags($_POST['GoodsName']) : ''; //상품명
$TID = isset($_POST['TID']) ? clean_xss_tags($_POST['TID']) : ''; //거래번호
$name = isset($_POST['name']) ? addslashes(clean_xss_tags(stripslashes($_POST['name']))) : ''; //구매자명
$GoodsName = isset($_POST['GoodsName']) ? addslashes(clean_xss_tags(stripslashes($_POST['GoodsName']))) : ''; //상품명
$TID = isset($_POST['TID']) ? addslashes(clean_xss_tags(stripslashes($_POST['TID']))) : ''; //거래번호
$MOID = isset($_POST['MOID']) ? addslashes(clean_xss_tags(stripslashes($_POST['MOID']))) : ''; //주문번호
$AuthDate = isset($_POST['AuthDate']) ? clean_xss_tags($_POST['AuthDate']) : ''; //입금일시 (yyMMddHHmmss) 12 자리
$ResultCode = isset($_POST['ResultCode']) ? clean_xss_tags($_POST['ResultCode']) : ''; //결과코드 ('4110' 경우 입금통보)
$ResultMsg = isset($_POST['ResultMsg']) ? clean_xss_tags($_POST['ResultMsg']) : ''; //결과메시지
$AuthDate = isset($_POST['AuthDate']) ? addslashes(clean_xss_tags(stripslashes($_POST['AuthDate']))) : ''; //입금일시 (yyMMddHHmmss) 12 자리
$ResultCode = isset($_POST['ResultCode']) ? addslashes(clean_xss_tags(stripslashes($_POST['ResultCode']))) : ''; //결과코드 ('4110' 경우 입금통보)
$ResultMsg = isset($_POST['ResultMsg']) ? addslashes(clean_xss_tags(stripslashes($_POST['ResultMsg']))) : ''; //결과메시지
$VbankNum = isset($_POST['VbankNum']) ? addslashes(clean_xss_tags(stripslashes($_POST['VbankNum']))) : ''; //가상계좌번호
$FnCd = isset($_POST['FnCd']) ? clean_xss_tags($_POST['FnCd']) : ''; //가상계좌 은행코드
$VbankName = isset($_POST['VbankName']) ? clean_xss_tags($_POST['VbankName']) : ''; //가상계좌 은행명
$VbankInputName = isset($_POST['VbankInputName']) ? clean_xss_tags($_POST['VbankInputName']) : ''; //입금자 명
$CancelDate = isset($_POST['CancelDate']) ? clean_xss_tags($_POST['CancelDate']) : ''; //취소일시
$FnCd = isset($_POST['FnCd']) ? addslashes(clean_xss_tags(stripslashes($_POST['FnCd']))) : ''; //가상계좌 은행코드
$VbankName = isset($_POST['VbankName']) ? addslashes(clean_xss_tags(stripslashes($_POST['VbankName']))) : ''; //가상계좌 은행명
$VbankInputName = isset($_POST['VbankInputName']) ? addslashes(clean_xss_tags(stripslashes($_POST['VbankInputName']))) : ''; //입금자 명
$CancelDate = isset($_POST['CancelDate']) ? addslashes(clean_xss_tags(stripslashes($_POST['CancelDate']))) : ''; //취소일시
//가상계좌채번시 현금영수증 자동발급신청이 되었을경우 전달되며
//RcptTID 에 값이 있는경우만 발급처리 됨
$RcptTID = isset($_POST['RcptTID']) ? clean_xss_tags($_POST['RcptTID']) : ''; //현금영수증 거래번호
$RcptType = isset($_POST['RcptType']) ? clean_xss_tags($_POST['RcptType']) : ''; //현금 영수증 구분(0:미발행, 1:소득공제용, 2:지출증빙용)
$RcptAuthCode = isset($_POST['RcptAuthCode']) ? clean_xss_tags($_POST['RcptAuthCode']) : ''; //현금영수증 승인번호
$RcptTID = isset($_POST['RcptTID']) ? addslashes(clean_xss_tags(stripslashes($_POST['RcptTID']))) : ''; //현금영수증 거래번호
$RcptType = isset($_POST['RcptType']) ? addslashes(clean_xss_tags(stripslashes($_POST['RcptType']))) : ''; //현금 영수증 구분(0:미발행, 1:소득공제용, 2:지출증빙용)
$RcptAuthCode = isset($_POST['RcptAuthCode']) ? addslashes(clean_xss_tags(stripslashes($_POST['RcptAuthCode']))) : ''; //현금영수증 승인번호
// 입금통보 코드가 4110 성공이면
if ($ResultCode === '4110') {
@@ -170,4 +170,4 @@ if (in_array($_SERVER['REMOTE_ADDR'], $pg_allow_ips)) {
}
}
}
+20 -15
View File
@@ -127,7 +127,7 @@ if (!$orderResult || $order_info['secret'] !== $TOSS_SECRET) {
$paymentKey = isset($order_info["paymentKey"]) ? clean_xss_tags($order_info["paymentKey"]) : ''; // 결제 키
$customerName = isset($order_info["virtualAccount"]["customerName"]) ? clean_xss_tags($order_info["virtualAccount"]["customerName"]) : ''; // 주문자명 (가상계좌 발급 시 고객명)
$depositorName = isset($order_info["virtualAccount"]["depositorName"]) ? clean_xss_tags($order_info["virtualAccount"]["depositorName"]) : ''; // 입금자명 (실제 입금자 입력 이름)
$totalAmount = isset($order_info["totalAmount"]) ? clean_xss_tags($order_info["totalAmount"]) : ''; // 입금 금액 (결제 총액)
$totalAmount = isset($order_info["totalAmount"]) ? (int) $order_info["totalAmount"] : 0; // 입금 금액 (결제 총액)
$bankCode = isset($order_info["virtualAccount"]["bankCode"]) ? clean_xss_tags($order_info["virtualAccount"]["bankCode"]) : ''; // 은행코드 (가상계좌 발급 은행, 예: 11 → 농협)
$accountNumber = isset($order_info["virtualAccount"]["accountNumber"]) ? clean_xss_tags($order_info["virtualAccount"]["accountNumber"]) : ''; // 가상계좌 입금계좌번호
$approvedAt = isset($order_info['approvedAt']) ? clean_xss_tags($order_info['approvedAt']) : ''; //입금일시
@@ -143,6 +143,11 @@ $RcptAuthCode = isset($order_info['cashReceipt']['issueNumber']) ? clean_xss_tag
$RcptType = isset($order_info['cashReceipt']['type']) ? clean_xss_tags($order_info['cashReceipt']['type'] === '소득공제' ? '1' : ($order_info['cashReceipt']['type'] === '지출증빙' ? '2' : '0')) : '0';
$RcptReceiptUrl = isset($order_info['cashReceipt']['receiptUrl']) ? clean_xss_tags($order_info['cashReceipt']['receiptUrl']) : ''; // 현금영수증 URL
$paymentKey_sql = sql_real_escape_string($paymentKey);
$depositorName_sql = sql_real_escape_string($depositorName);
$RcptAuthCode_sql = sql_real_escape_string($RcptAuthCode);
$cash_info_sql = sql_real_escape_string(serialize(array('TID'=>$RcptTID, 'ApplNum'=>$RcptAuthCode, 'AuthDate'=>$approvedAt, 'receiptUrl'=>$RcptReceiptUrl)));
$result = false;
/**
@@ -151,7 +156,7 @@ $result = false;
if($TOSS_STATUS == "DONE"){
// 입금결과 처리
$sql = " select pp_id, od_id from {$g5['g5_shop_personalpay_table']} where pp_id = '{$TOSS_ORDERID}' and pp_tno = '{$paymentKey}'";
$sql = " select pp_id, od_id from {$g5['g5_shop_personalpay_table']} where pp_id = '{$TOSS_ORDERID}' and pp_tno = '{$paymentKey_sql}'";
$row = sql_fetch($sql);
if($row['pp_id']) {
@@ -162,15 +167,15 @@ if($TOSS_STATUS == "DONE"){
if ($RcptType) {
$add_update_sql = "
, pp_cash = '1',
pp_cash_no = '".$RcptAuthCode."',
pp_cash_info = '".serialize(array('TID'=>$RcptTID, 'ApplNum'=>$RcptAuthCode, 'AuthDate'=>$approvedAt, 'receiptUrl'=>$RcptReceiptUrl))."'
pp_cash_no = '".$RcptAuthCode_sql."',
pp_cash_info = '".$cash_info_sql."'
";
}
$sql = " update {$g5['g5_shop_personalpay_table']}
set pp_receipt_price = '$totalAmount',
pp_receipt_time = '$receipt_time',
pp_deposit_name = '$depositorName'
pp_deposit_name = '$depositorName_sql'
$add_update_sql
where pp_id = '$TOSS_ORDERID'";
$result = sql_query($sql, false);
@@ -180,14 +185,14 @@ if($TOSS_STATUS == "DONE"){
$sql = " update {$g5['g5_shop_order_table']}
set od_receipt_price = od_receipt_price + '$totalAmount',
od_receipt_time = '$receipt_time',
od_deposit_name = '$depositorName',
od_deposit_name = '$depositorName_sql',
od_shop_memo = concat(od_shop_memo, \"\\n개인결제 ".$row['pp_id']." 로 결제완료 - ".$receipt_time."\")
where od_id = '{$row['od_id']}' ";
$result = sql_query($sql, FALSE);
}
} else {
// 주문내역에 secret 검증 추가
$sql = " select od_id from {$g5['g5_shop_order_table']} where od_id = '$TOSS_ORDERID' and od_tno = '$paymentKey'";
$sql = " select od_id from {$g5['g5_shop_order_table']} where od_id = '$TOSS_ORDERID' and od_tno = '$paymentKey_sql'";
$row = sql_fetch($sql);
if(!$row['od_id']) {
write_toss_log("주문내역 조회 실패", $TOSS_ORDERID, $TOSS_STATUS);
@@ -199,9 +204,9 @@ if($TOSS_STATUS == "DONE"){
$sql = " update {$g5['g5_shop_order_table']}
set od_receipt_price = '$totalAmount',
od_receipt_time = '$receipt_time',
od_deposit_name = '$depositorName'
od_deposit_name = '$depositorName_sql'
where od_id = '$TOSS_ORDERID'
and od_tno = '$paymentKey'";
and od_tno = '$paymentKey_sql'";
$result = sql_query($sql, FALSE);
}
@@ -228,8 +233,8 @@ if($TOSS_STATUS == "DONE"){
if ($RcptType) {
$add_update_sql = "
, od_cash = '1',
od_cash_no = '".$RcptAuthCode."',
od_cash_info = '".serialize(array('TID'=>$RcptTID, 'ApplNum'=>$RcptAuthCode, 'AuthDate'=>$approvedAt, 'receiptUrl'=>$RcptReceiptUrl))."'
od_cash_no = '".$RcptAuthCode_sql."',
od_cash_info = '".$cash_info_sql."'
";
}
@@ -257,7 +262,7 @@ if($TOSS_STATUS == "DONE"){
elseif($TOSS_STATUS == "WAITING_FOR_DEPOSIT")
{
// 개인결제 정보 조회
$sql = " select pp_id, od_id, pp_name, pp_hp, pp_tel from {$g5['g5_shop_personalpay_table']} where pp_id = '{$TOSS_ORDERID}' and pp_tno = '{$paymentKey}'";
$sql = " select pp_id, od_id, pp_name, pp_hp, pp_tel from {$g5['g5_shop_personalpay_table']} where pp_id = '{$TOSS_ORDERID}' and pp_tno = '{$paymentKey_sql}'";
$row = sql_fetch($sql);
if($row['pp_id']) {
@@ -268,7 +273,7 @@ elseif($TOSS_STATUS == "WAITING_FOR_DEPOSIT")
pp_cash = 0,
pp_cash_no = '',
pp_cash_info = ''
where pp_id = '{$TOSS_ORDERID}' and pp_tno = '{$paymentKey}'";
where pp_id = '{$TOSS_ORDERID}' and pp_tno = '{$paymentKey_sql}'";
$result = sql_query($sql, FALSE);
if($row['od_id']) {
@@ -281,7 +286,7 @@ elseif($TOSS_STATUS == "WAITING_FOR_DEPOSIT")
}
} else {
// 일반 주문 롤백 전에 데이터 존재 확인
$sql = " select od_id, od_name, od_hp, od_tel from {$g5['g5_shop_order_table']} where od_id = '{$TOSS_ORDERID}' and od_tno = '{$paymentKey}'";
$sql = " select od_id, od_name, od_hp, od_tel from {$g5['g5_shop_order_table']} where od_id = '{$TOSS_ORDERID}' and od_tno = '{$paymentKey_sql}'";
$row = sql_fetch($sql);
if(empty($row['od_id'])) {
write_toss_log("주문 데이터가 존재하지 않음", $TOSS_ORDERID, $TOSS_STATUS);
@@ -298,7 +303,7 @@ elseif($TOSS_STATUS == "WAITING_FOR_DEPOSIT")
od_cash = 0,
od_cash_no = '',
od_cash_info = ''
where od_id = '{$TOSS_ORDERID}' and od_tno = '{$paymentKey}' ";
where od_id = '{$TOSS_ORDERID}' and od_tno = '{$paymentKey_sql}' ";
$result = sql_query($sql, FALSE);
}
+1 -1
View File
@@ -2,7 +2,7 @@
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
define('G5_VERSION', '그누보드5');
define('G5_GNUBOARD_VER', '5.6.28');
define('G5_GNUBOARD_VER', '5.6.31');
// 그누보드5.4.5.5 버전과 영카트5.4.5.5.1 버전을 합쳐서 그누보드5.4.6 버전에서 시작함 (kagla-210617)
// G5_YOUNGCART_VER 이 상수를 사용하는 곳이 있으므로 주석 처리 해제함
// 그누보드5.4.6 이상 버전 부터는 영카트를 그누보드에 포함하여 배포하므로 영카트5의 버전은 의미가 없습니다.