Compare commits

...
63 Commits
Author SHA1 Message Date
thisgun bb6ed59052 버전 5.6.35 수정 2026-08-25 01:25:04 +00:00
thisgun d4dddaca57 [KVE-2026-1927] 관리자 메뉴 코드 요청값 개입 차단 및 회원 내보내기 저장 경로 보완
관리자 페이지는 자신의 메뉴 코드를 변수에 지정한 뒤 공통 파일을 include
하는데, 공통 파일의 extract 처리로 그 값이 요청값으로 대체될 수 있었다.
extract 이전에 요청 배열에서 해당 키를 제거하여 각 페이지가 지정한 값이
유지되도록 한다. 해당 키를 요청값으로 참조하는 코드는 없으므로 동작에
영향이 없다.

변수 자체를 unset 하는 방식은 페이지가 지정한 값까지 사라져 관리권한을
위임받은 계정이 자신의 메뉴에도 접근하지 못하게 되므로 사용하지 않는다.

회원 내보내기 파일의 저장 폴더와 파일 이름이 생성 시각만으로 구성되어
경로를 추측할 여지가 있어, 임의 문자열을 덧붙인다. 다운로드 주소는 서버가
생성해 전달하므로 기존 흐름에는 영향이 없으며, 지난 폴더 정리 조건도 함께
맞춘다.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
(cherry picked from commit 7739b95be1fcbe764d888a9f0fba1522cc1ebacb)
2026-08-24 07:56:32 +00:00
thisgun 0080b199ea [KVE-2026-1823] 장바구니 배송비 구분값을 서버에서 결정하도록 수정
장바구니 담기에서 배송비 구분값을 요청값으로 받은 뒤 무료배송 상품과
착불 상품만 서버 값으로 다시 지정하고 있어, 일반 유료배송 상품은 요청값이
그대로 저장되고 배송비 산정 대상에서 빠졌다. 요청값 참조를 제거하고 상품
설정만으로 값을 결정하도록 하여 같은 기능의 AJAX 경로와 동작을 맞춘다.

네이버페이 주문에서도 장바구니에서 읽은 배송비 구분값을 요청 배열에 다시
담아 사용하던 것을 서버 전용 변수로 분리한다. 같은 키를 미리 채워 보내면
인덱스가 밀려 요청값이 사용될 수 있었다.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
(cherry picked from commit 3dbb9034f6f9d6e91916d6dcb78b4c06bc11d733)
2026-08-24 07:56:32 +00:00
thisgun ebd18b6001 [KVE-2026-1813] 미완료주문 확정 처리 필드 정제 및 결제수단 출력 인코딩
미완료주문을 주문으로 확정할 때 임시 데이터에서 복원한 결제수단, 접속 IP,
테스트 결제 여부를 정제 없이 사용하던 것을 이웃 필드와 동일한 방식으로
처리한다. 접속 IP는 표기 형식에 맞지 않으면 저장하지 않고, 테스트 결제
여부는 정수로만 저장하며, 세 값 모두 배열로 전달된 경우를 함께 걸러낸다.

임시주문 저장 시 접속 IP와 테스트 결제 여부를 서버에서 결정하는 처리가
일반 주문 분기 안에만 있어 개인결제 경로에서는 요청값이 그대로 저장되던
것을 분기 밖으로 옮겨 항상 서버 값을 사용하도록 한다.

결제수단 값이 그대로 출력되던 관리자 주문상세, 주문목록, 부분취소 화면과
구매자 주문조회 화면(웹/모바일/테마)에 get_text() 인코딩을 적용한다.
주문상세는 표시 문자열을 여러 곳에서 재사용하므로 생성 지점에서 처리한다.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
(cherry picked from commit 77069575096881a31b29fdf130c83226610bf8df)
2026-08-24 07:56:32 +00:00
thisgun 04a4de4923 스킨 목록 옵션 생성 시 디렉토리 열기 실패 처리 보강
get_list_skin_options()에서 존재하지 않는 스킨 경로가 지정된 경우
opendir() 반환값을 그대로 readdir()에 넘겨 PHP 8 이상에서 스크립트가
중단되던 문제를 수정한다. 아울러 결과 배열을 미리 초기화하여 패턴에
일치하는 스킨 파일이 하나도 없을 때 sort()에서 중단되던 경로도 함께
처리하고, readdir() 종료 조건을 명시적으로 비교하도록 변경한다.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
(cherry picked from commit 4010d29295001c43b6ccd7b4e6414d0adfcc7b2e)
2026-08-24 07:44:22 +00:00
thisgun 96df43480b 게시판·1:1문의·쇼핑몰분류 상단/하단 파일 경로 처리 보강
콘텐츠와 동일하게, 게시판(bo_include)·1:1문의(qa_include)·쇼핑몰 분류
(ca_include)의 상단/하단 파일 경로도 저장 전에 먼저 정규화한 뒤 확장자와
위치를 검증하도록 순서를 조정한다. 정규화 과정에서 확장자가 사라져 검증을
우회하던 경로를 차단하고, data 디렉터리로 귀결되는 경로를 거부한다.

실행 직전 board_head/board_tail, qahead/qatail, shop 목록·상품 페이지에서도
승인 확장자와 data 디렉터리 여부를 다시 확인하는 is_content_include_allowed()
를 적용한다. 이미 저장된 경로도 실행 시 재확인된다.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
(cherry picked from commit 0c6bca704725ebea2a584d4c06366282e9bc36d6)
2026-08-24 07:44:22 +00:00
thisgun 6571119db6 [KVE-2026-1806] 콘텐츠 include 경로 및 미완료주문 출력 처리 보강
콘텐츠 상단/하단 파일 경로를 저장 전에 먼저 정규화한 뒤 확장자와 위치를
검증하도록 순서를 조정한다. 정규화 과정에서 확장자가 사라져 검증을
우회하던 경로를 차단한다. 실행 직전 bbs/content.php 에서도 승인 확장자와
data 디렉터리 귀결 여부를 다시 확인하는 is_content_include_allowed() 를
적용하고, 콘텐츠 상단/하단 이미지 업로드는 이미지 파일만 허용하도록 검사한다.

미완료주문 상세의 결제방법 출력에 get_text() 인코딩을 적용하고, 임시주문
저장 시 정제한 결제수단 값을 원본에도 반영한다. 개인결제 주문 세션은
결제정보 검증을 통과한 뒤에만 설정한다.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
(cherry picked from commit 196255d76912531d7e13861821bd59ca15c967d1)
2026-08-24 07:44:22 +00:00
thisgun 35acbfa750 나이스페이 API 통신 시 서버 인증서 검증 적용
nicepay_reqPost() 가 원격 서버 인증서를 검증하지 않고 통신하던 것을
검증하도록 변경한다. 이니시스 연동부는 이미 동일하게 처리하고 있다.
API 호스트 4곳(webapi, pg-api, dc1-api, dc2-api) 인증서 검증 통과를
확인했다.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
(cherry picked from commit 6c888bd53d0a5949bb1e2fc96567c132622a6f8b)
2026-08-24 07:44:22 +00:00
thisgun d9c21ea018 나이스페이 에스크로 배송등록 및 현금영수증 처리 보정
에스크로 배송등록 실패 시 알림 대신 주문 관리자 메모에 결과를 기록하고
이후 처리를 중단한다. 현금영수증 발급 후 DB 반영에 실패한 경우 자동 취소
요청을 제거하고 관리자가 나이스페이에서 직접 확인하도록 안내를 변경한다.
가상계좌 취소 요청금액이 없을 때의 응답 코드를 명시한다.

patch_5631 의 '회귀 점검 후 결제 및 쿠폰존 보강'(4405ddc1c) 중
나이스페이 관련 변경만 적용했다.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
(cherry picked from commit 3f6d013f9466d11eacba29e81ad515a9a0ceeeef)
2026-08-24 07:44:22 +00:00
thisgun 68be1c1f86 나이스페이 부분취소 및 취소응답 검증 보강
(cherry picked from commit df0bfff88cdccc93dd6a8315c166e49a9bb03a5a)
2026-08-24 07:44:22 +00:00
thisgun ff1f6d723b 나이스페이 승인 취소 안정성 보강
(cherry picked from commit 7c26e621c66805b2d162ed0293e570e29a11b4e8)
2026-08-24 07:44:22 +00:00
thisgun bb4d345add 나이스페이 부분취소 처리 보강
(cherry picked from commit ef0da4a903983f46934d5c14ac10adb93a673398)
2026-08-24 07:44:22 +00:00
thisgun 3678b92b2f 나이스페이 가상계좌 취소 환불정보 입력 추가
(cherry picked from commit bb6381d7a58e4690e438dafb0b625a175be4c34b)
2026-08-24 07:44:22 +00:00
thisgun c8d51529d1 관리자 나이스페이 결제 조회 추가
(cherry picked from commit 104123872ada30e75c3e11e6322b6ab16d808efa)
2026-08-24 07:44:22 +00:00
thisgun 129d0ea766 모바일 나이스페이 결제금액 동기화 수정
(cherry picked from commit 671693d3adefd7b9e7a1447fee2d046d8ebdf600)
2026-08-24 07:44:22 +00:00
thisgun d80289ff28 나이스페이 결제 검증 보강
(cherry picked from commit 8c8099c63eb30c5cfd4678cecedbfd029471065e)
2026-08-24 07:44:22 +00:00
thisgun c4b54a6219 나이스페이 실패 응답 처리 보강
(cherry picked from commit 1caea3176ef8d3fd6057fc9a7e6646878cdf3e0c)
2026-08-24 07:44:22 +00:00
thisgun 8e7ec335c3 나이스페이 결제 검증과 영수증 처리 보강
(cherry picked from commit 8bcd1bcbea25371bd0a5b196b71d2c1b4308479a)
2026-08-24 07:44:22 +00:00
thisgun 5a36b2d85d 나이스페이 통지와 취소 응답 처리 보강
(cherry picked from commit e65d17d227028fc5eabe4d6a831485bf27685c01)
2026-08-24 07:44:22 +00:00
thisgun 2b21804111 나이스페이 입금통지 주문 조건 완화
(cherry picked from commit 9c363f4bc31cfd9361b7631977c7f892942aee0b)
2026-08-24 07:44:22 +00:00
thisgun a21f3103bb 나이스페이 결제 응답 검증 보강
(cherry picked from commit 50c2d6b6cfeaa10bbb65b2537a05c0525528cc63)
2026-08-24 07:44:22 +00:00
thisgun f7106379b8 나이스페이 결제 검증 및 취소 처리 보강
(cherry picked from commit 1e03160280e0a6b23e9d4b01a8bd726bddccf2cd)
2026-08-24 07:44:22 +00:00
thisgun f4d184979f 쿠폰존 폼 초기화 배열의 중복 항목 정리
cp_price 가 두 번 선언되어 있어 하나를 제거하고, 폼 본문에서 참조하는
cz_id 를 초기화 대상에 추가한다.

cz_id 참조 지점은 현재 앞쪽 조건의 단축 평가로 도달하지 않으나,
조건이 바뀔 경우를 대비해 초기화 목록을 참조 항목과 일치시킨다.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
(cherry picked from commit c03b311e789642f0af3fe898e040afea28733e7c)
2026-08-24 07:44:22 +00:00
thisgun f6ec58ca18 session_check() 의 잘못된 이동 함수명 수정
그누보드4에서 5로 전환할 때 상수와 전역변수만 변경되고 함수명이
그대로 남아, 정의되지 않은 gotourl() 을 호출하고 있었다.
세션이 없는 상태로 이 함수가 실행되면 치명적 오류가 발생한다.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
(cherry picked from commit f62b0559b4c757da693e7fe1b78a5d5ec2364504)
2026-08-24 07:44:22 +00:00
thisgun a0e86f2bc8 환경설정 캡챠 입력란을 확인 버튼 옆으로 이동
캡챠가 문서 최하단에 생성되어, 확인을 누르면 페이지 끝까지 강제로
스크롤된 뒤 입력해야 했다. 페이지가 길어 위치를 찾기 어렵다는 의견이
있어 상단 고정 영역의 확인 버튼 옆에 노출하도록 변경한다.

- 캡챠 영역을 확인 버튼과 같은 고정 영역으로 이동하고 패널 형태로 표시
- 고정 노출이므로 강제 스크롤을 제거하고 입력란 포커스로 대체
- 좁은 화면에서 관리자 메뉴에 가려지지 않도록 표시 순서 조정

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
(cherry picked from commit 39b7637bab609600a21118966968f46ab1fb6546)
2026-08-24 07:44:22 +00:00
thisgun 4ecacec171 게시판그룹 삭제 경고의 게시판목록 링크 검색대상 값 정정
board_list.php 의 검색대상 값은 a.gr_id 이나 링크가 gr_id 로 전달하여
그룹에 속한 게시판이 조회되지 않던 문제를 수정한다.

접두사가 없는 gr_id 는 최고관리자가 아닌 경우 그룹 테이블을 함께
조회하는 구조에서 컬럼 모호성 오류가 발생하므로 a.gr_id 로 맞춘다.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
(cherry picked from commit c6dd497a450bd5ba08d743efc26ba73fcdd9e626)
2026-08-24 07:44:22 +00:00
thisgun 913d1c66c7 쿠폰 다운로드 포인트 검사를 회원 단위로 직렬화
기존에는 쿠폰별로 잠금을 잡아, 같은 회원이 서로 다른 포인트 쿠폰을
동시에 요청하면 각 요청이 요청 시작 시점의 보유 포인트 값으로 검사를
통과하여 잔액보다 많은 쿠폰을 받을 수 있었다.

- 잠금 범위를 쿠폰별에서 회원별로 변경
- 보유 포인트를 잠금 획득 후 회원 테이블에서 다시 조회하여 검사

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
(cherry picked from commit fd04b432cf34dfba52e281fc74391f8e2d48fe6b)
2026-08-24 07:44:22 +00:00
thisgun 42859072eb 회원가입 쿠폰 발급 재시도 상한 동작하도록 수정
쿠폰번호 중복 시 재생성을 반복하는 구간에서 재시도 횟수가 증가하지
않아 상한 검사가 동작하지 않았다. 중복이 계속 발생하면 조회를 반복하며
루프를 빠져나가지 못하므로 횟수 증가를 추가한다.

- bbs/register_form_update.php
- plugin/social/register_member_update.php

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
(cherry picked from commit ad396a59d463df880739c1e9514e4aa61d883850)
2026-08-24 07:44:22 +00:00
thisgun 0ae67a652c [KVE-2026-1803] 쿠폰번호 생성에 안전한 난수원 적용
get_coupon_id() 가 microtime 기반 시드로 난수 생성기를 재시드하여
생성 가능한 쿠폰번호가 시드 공간 크기로 제한되던 문제를 수정한다.
기존 구현은 33^16 이 아닌 10^6 개의 값만 생성할 수 있어 전체 집합을
사전 계산할 수 있었다.

- get_random_token_string() 으로 난수 바이트를 얻어 쿠폰번호를 구성
- 문자 종류 수로 나누어 떨어지는 구간만 사용하여 문자 분포 편중 제거
- 헬퍼 미정의 환경을 위해 function_exists 가드 및 mt_rand 보완 경로 유지
- 쿠폰번호 형식(16자, 4자리 하이픈 구분)과 사용 문자는 기존과 동일

plugin/lgxpay/lgdacom/XPayClient.php 의 불필요한 재시드 호출 제거

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
(cherry picked from commit a6cf071f405c79904f7861d5e5efc118f29005dc)
2026-08-24 07:44:22 +00:00
thisgun 516eac386f [KVE-2026-1785] 관리자 목록 검색필드 화이트리스트 누락 보완
검색필드가 SQL 컬럼명 위치에 검증 없이 삽입되던 관리자 목록 9개
파일에 허용 컬럼 목록을 추가한다. 허용 컬럼은 각 화면의 검색 UI가
제공하는 항목 기준이며, 미허용 값은 빈 문자열이 아닌 유효 컬럼으로
대체하여 SQL 문법 오류를 방지한다.

- adm/auth_list.php
- adm/board_list.php
- adm/boardgroup_list.php
- adm/boardgroupmember_list.php
- adm/point_list.php
- adm/poll_list.php
- adm/popular_list.php
- adm/shop_admin/inorderlist.php
- adm/shop_admin/personalpaylist.php

adm/member_list.php 의 불필요한 주석 제거

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
(cherry picked from commit ff56beff8c6804013e830eb828779e02493cee52)
2026-08-24 07:44:22 +00:00
thisgun 188d0e30a0 KG이니시스 PRO 판정 조회 컬럼 통일
- 모니터 알림과 KG 대사 배치 쿼리에도 주문 환불금액을 포함해
  현황 목록·상세 화면과 동일한 기준으로 판정하도록 정리

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
(cherry picked from commit 1388bc323724128acf78b15a49767e39f9709491)
2026-08-24 07:44:22 +00:00
thisgun c450f8bbde 관리자 권한 문맥 오염 계열 접근권한 점검 및 보완
게시판/그룹 관리자 문맥(bo_table)으로 타 회원 콘텐츠에 접근·변조되지
않도록 $is_admin 판정을 최고관리자(super) 기준으로 통일.
- bbs/poll_etc_update.php : 설문 기타의견 삭제 소유권
- shop/itemqaformupdate.php : 상품문의 수정/삭제 소유권
- shop/itemuseformupdate.php : 사용후기 삭제 소유권
- bbs/current_connect.php : 게스트 IP 원본 표기
- shop/kakaopay/kakaopay_cancel.php : TID 기반 결제취소

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
(cherry picked from commit 46a005129464d1fbab518fcb70bf524b258e65fc)
2026-08-24 07:44:22 +00:00
thisgun b3aa81c74a [KVE-2026-1640] 1:1 문의 접근권한 우회 취약점 수정
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
(cherry picked from commit a719c6ea5f6d38350f9dcda682a04dad31f6a454)
2026-08-24 07:44:22 +00:00
thisgun 11a26c82af [KVE-2026-1639] 쇼핑몰 주문정보 접근권한 우회 취약점 수정
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
(cherry picked from commit d3e8ffc3d6a0af4e2abe9b798316ae1c504e7d37)
2026-08-24 07:44:21 +00:00
thisgun 43f626885e [KVE-2026-1638] 쇼핑몰 쿠폰 중복적용 취약점 수정
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
(cherry picked from commit 88bfddd0e83353c15c424549b594b8f36593220f)
2026-08-24 07:44:21 +00:00
thisgun 0b6f081f76 버전 5.6.34 수정 2026-07-24 07:14:18 +00:00
thisgunandClaude Fable 5 adbd9c3acc KG이니시스 PRO 현황 부분취소 전액환불 종결 판정 추가
- 부분취소 합계로 전액 환불되고 주문도 취소된 거래는 일치 상태로 판정
- 현황 목록 필터·KG 대사·관리자 알림에 동일 기준 적용

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-24 07:11:51 +00:00
thisgunandClaude Fable 5 8fcbd2a9b1 INIpay PRO 주문 전체취소 흐름 개선
- 부분취소 이력이 있는 주문은 잔여 금액을 부분취소로 처리해 전체취소 지원
- 부분취소로 전액 환불된 주문과 KG에서 이미 취소된 주문은 주문 취소만 진행
- PG 승인취소 미선택 시 차단하지 않고 주문만 취소하며 처리 내용을 이력에 기록
- 남은 품목 취소로 주문 전체가 취소되는 경우에도 PG 취소 여부 확인창 표시

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-24 07:11:51 +00:00
thisgunandClaude Fable 5 f8c06a26cb 관리자 부분취소 팝업 처리 오류 수정
- 팝업에서 admin.js와 토큰키를 로드해 처리 요청이 검증을 통과하도록 수정
- 금액 입력 유효성 검사의 필드명 오타 수정

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-24 07:11:51 +00:00
thisgunandClaude Fable 5 1fd5ec46ae KG이니시스 PRO 현황 안내 문구 정비
- 안내 문구의 로컬 표현을 영카트로 통일
- PG와 영카트 주문이 모두 취소 상태로 일치하면 조치 불필요 문구 출력

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-24 06:25:17 +00:00
thisgunandClaude Fable 5 cbd70fbe18 KG이니시스 상점관리자에서 먼저 취소한 INIpay PRO 주문의 전체취소 허용
- 전체취소 전에 KG 거래상태를 조회해 이미 취소된 거래이면 주문 취소만 진행
- 조회 결과와 처리 사유를 결제 현황 이력에 기록

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-24 06:25:17 +00:00
thisgunandClaude Fable 5 bc07b8383e KG이니시스 INIpay PRO 주문자 이메일 확인 후 전달
- 주문서/개인결제 결제 시작 시 이메일 형식을 확인해 잘못된 경우 안내 후 중단
- 결제창 요청에서는 확인된 이메일만 선택 항목으로 전달해 결제가 막히지 않게 처리

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-24 06:25:17 +00:00
thisgunandClaude Opus 4.8 23c60a8ba1 SMS 아이코드 신청 링크 최신 경로로 교체
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-24 05:28:15 +00:00
thisgunandClaude Opus 4.8 abb777016d 부가서비스 신청 링크 최신화 및 나이스페이먼츠 추가
- 전자결제/본인확인/SMS 신청 링크를 sir.kr 최신 경로로 교체
- 신용카드 전자결제에 나이스페이먼츠 추가(4개 1열 배치, 카드 폭 조정)
- 나이스페이먼츠 신청 버튼 이미지 추가

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-24 05:19:41 +00:00
thisgun e45bd1d9e1 버전 5.6.33 수정 2026-07-24 01:04:31 +00:00
thisgunandClaude Fable 5 acdbcfd8ba KG이니시스 INIpay PRO 결제 연동 및 결제 처리 현황 추가
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-23 08:03:16 +00:00
thisgun 1f48f6bd80 버전 5.6.32 수정 2026-07-14 02:35:52 +00:00
thisgun 87d86d317e 소셜 로그인 앱 등록 링크 최신화 2026-07-13 08:55:10 +00:00
thisgun 7fa554f396 XSS 취약점 수정 2026-07-13 07:38:27 +00:00
thisgunandClaude Opus 4.8 6bc322c9d6 회원 여분필드 저장 시 입력값 정제 보완
- register_form_update.php에서 mb_1~mb_10을 다른 회원필드(mb_name 등)와
  동일하게 clean_xss_tags 처리하여 저장하도록 보완

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-13 07:36:19 +00:00
thisgun 43fba4407d [KVE-2025-1533] 미결제내역 임시주문 데이터 출력 시 이스케이프 보완 2026-07-13 07:36:19 +00:00
thisgunandClaude Opus 4.8 3d7fa04569 관리자 상태변경 엔드포인트에 요청 출처 검증 추가
- 상품이벤트/개인결제복사/SMS 번호·그룹·폼·업로드/방문로그 삭제 등
  POST 기반 상태변경 처리에 check_request_origin() 적용 (스킨 수정 불필요)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-13 07:20:32 +00:00
thisgun 82ee3ef438 [KVE-1525] SMS 번호·이모티콘 이동 처리 권한 속성 보완 2026-07-13 07:20:32 +00:00
thisgun 4049c6c164 [KVE-1524] 주문 상태변경 관리자 엔드포인트에 메뉴 권한 검증 추가 2026-07-13 07:15:09 +00:00
thisgun f80ed3946f Fix monthly visit date range end date 2026-07-01 08:41:11 +00:00
thisgunandClaude Opus 4.8 d7d5f26524 [KVE-2026-1233]취약점- 게시글 조회 시 wr_id 정수 처리 보완
- get_write() 진입 시 wr_id를 정수로 캐스팅하여 SQL 조건에 비정상 값이 전달되지 않도록 보완

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-30 02:05:11 +00:00
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
161 changed files with 6610 additions and 778 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
+7
View File
@@ -3,6 +3,8 @@ if (!defined('G5_USE_SHOP') || !G5_USE_SHOP) {
return;
}
global $default;
$menu['menu400'] = array(
array('400000', '쇼핑몰관리', G5_ADMIN_URL . '/shop_admin/', 'shop_config'),
array('400010', '쇼핑몰현황', G5_ADMIN_URL . '/shop_admin/', 'shop_index'),
@@ -21,3 +23,8 @@ $menu['menu400'] = array(
array('400750', '추가배송비관리', G5_ADMIN_URL . '/shop_admin/sendcostlist.php', 'scf_sendcost', 1),
array('400410', '미완료주문', G5_ADMIN_URL . '/shop_admin/inorderlist.php', 'scf_inorder', 1),
);
// 결제방식이 KG이니시스이고 INIpay PRO를 사용할 때만 노출한다.
if (isset($default['de_pg_service']) && $default['de_pg_service'] === 'inicis' && !empty($default['de_inicis_pro_use'])) {
$menu['menu400'][] = array('400420', 'KG이니시스 PRO 현황', G5_ADMIN_URL . '/shop_admin/inicisloglist.php', 'scf_inicis_log');
}
+5
View File
@@ -8,6 +8,11 @@ if ($is_admin != 'super') {
$sql_common = " from {$g5['auth_table']} a left join {$g5['member_table']} b on (a.mb_id=b.mb_id) ";
$allowed_sfl = array('a.mb_id');
if (!in_array($sfl, $allowed_sfl)) {
$sfl = 'a.mb_id';
}
$sql_search = " where (1) ";
if ($stx) {
$sql_search .= " and ( ";
+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();
+14 -5
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는 반드시 선택하세요.');
@@ -62,6 +62,12 @@ if ($check_captcha) {
}
}
// 저장·검증 전에 경로를 먼저 정규화하여, 검증 이후 경로가 달라지지 않도록 한다.
if (function_exists('filter_input_include_path')) {
$bo_include_head = filter_input_include_path($bo_include_head);
$bo_include_tail = filter_input_include_path($bo_include_tail);
}
if ($file = $bo_include_head) {
$file_ext = pathinfo($file, PATHINFO_EXTENSION);
@@ -86,9 +92,12 @@ if (!is_include_path_check($bo_include_tail, 1)) {
alert('하단 파일 경로에 포함시킬수 없는 문자열이 있습니다.');
}
if (function_exists('filter_input_include_path')) {
$bo_include_head = filter_input_include_path($bo_include_head);
$bo_include_tail = filter_input_include_path($bo_include_tail);
if ($bo_include_head && function_exists('is_content_include_allowed') && !is_content_include_allowed($bo_include_head)) {
alert('상단 파일 경로로 사용할 수 없는 위치입니다.');
}
if ($bo_include_tail && function_exists('is_content_include_allowed') && !is_content_include_allowed($bo_include_tail)) {
alert('하단 파일 경로로 사용할 수 없는 위치입니다.');
}
$board_path = G5_DATA_PATH . '/file/' . $bo_table;
+5
View File
@@ -12,6 +12,11 @@ if ($is_admin != "super") {
$sql_search .= " and (a.gr_id = b.gr_id and b.gr_admin = '{$member['mb_id']}') ";
}
$allowed_sfl = array('bo_table', 'bo_subject', 'a.gr_id');
if (!in_array($sfl, $allowed_sfl)) {
$sfl = 'bo_table';
}
if ($stx) {
$sql_search .= " and ( ";
switch ($sfl) {
+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] : '';
}
+5
View File
@@ -20,6 +20,11 @@ if ($is_admin != 'super') {
$sql_search .= " and (gr_admin = '{$member['mb_id']}') ";
}
$allowed_sfl = array('gr_subject', 'gr_id', 'gr_admin');
if (!in_array($sfl, $allowed_sfl)) {
$sfl = 'gr_subject';
}
if ($stx) {
$sql_search .= " and ( ";
switch ($sfl) {
+3 -3
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,13 +36,13 @@ 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 == '선택삭제') {
$row = sql_fetch(" select count(*) as cnt from {$g5['board_table']} where gr_id = '$gr_id' ");
if ($row['cnt']) {
alert("이 그룹에 속한 게시판이 존재하여 게시판 그룹을 삭제할 수 없습니다.\\n\\n이 그룹에 속한 게시판을 먼저 삭제하여 주십시오.", './board_list.php?sfl=gr_id&amp;stx=' . $gr_id);
alert("이 그룹에 속한 게시판이 존재하여 게시판 그룹을 삭제할 수 없습니다.\\n\\n이 그룹에 속한 게시판을 먼저 삭제하여 주십시오.", './board_list.php?sfl=a.gr_id&amp;stx=' . $gr_id);
}
// 그룹 삭제
+5
View File
@@ -13,6 +13,11 @@ $sql_common = " from {$g5['group_member_table']} a
left outer join {$g5['member_table']} b on (a.mb_id = b.mb_id) ";
$sql_search = " where gr_id = '{$gr_id}' ";
$allowed_sfl = array('a.mb_id');
if (!in_array($sfl, $allowed_sfl)) {
$sfl = 'a.mb_id';
}
// 회원아이디로 검색되지 않던 오류를 수정
if (isset($stx) && $stx) {
$sql_search .= " and ( ";
+26 -17
View File
@@ -1409,7 +1409,7 @@ if ($config['cf_sms_use'] && $config['cf_icode_id'] && $config['cf_icode_pw']) {
<tr>
<th scope="row"><label for="cf_twitter_key">트위터 컨슈머 Key</label></th>
<td>
<input type="text" name="cf_twitter_key" value="<?php echo get_sanitize_input($config['cf_twitter_key']); ?>" id="cf_twitter_key" class="frm_input" size="40"> <a href="https://developer.twitter.com/en/apps" target="_blank" class="btn_frmline">앱 등록하기</a>
<input type="text" name="cf_twitter_key" value="<?php echo get_sanitize_input($config['cf_twitter_key']); ?>" id="cf_twitter_key" class="frm_input" size="40"> <a href="https://console.x.com/" target="_blank" class="btn_frmline">앱 등록하기</a>
</td>
<th scope="row"><label for="cf_twitter_secret">트위터 컨슈머 Secret</label></th>
<td>
@@ -1419,7 +1419,7 @@ if ($config['cf_sms_use'] && $config['cf_icode_id'] && $config['cf_icode_pw']) {
<tr>
<th scope="row"><label for="cf_google_clientid">구글 Client ID</label></th>
<td>
<input type="text" name="cf_google_clientid" value="<?php echo get_sanitize_input($config['cf_google_clientid']); ?>" id="cf_google_clientid" class="frm_input" size="40"> <a href="https://console.developers.google.com" target="_blank" class="btn_frmline">앱 등록하기</a>
<input type="text" name="cf_google_clientid" value="<?php echo get_sanitize_input($config['cf_google_clientid']); ?>" id="cf_google_clientid" class="frm_input" size="40"> <a href="https://console.cloud.google.com/auth/clients" target="_blank" class="btn_frmline">앱 등록하기</a>
</td>
<th scope="row"><label for="cf_google_secret">구글 Client Secret</label></th>
<td>
@@ -1435,7 +1435,7 @@ if ($config['cf_sms_use'] && $config['cf_icode_id'] && $config['cf_icode_pw']) {
<tr>
<th scope="row"><label for="cf_kakao_rest_key">카카오 REST API 키</label></th>
<td>
<input type="text" name="cf_kakao_rest_key" value="<?php echo get_sanitize_input($config['cf_kakao_rest_key']); ?>" id="cf_kakao_rest_key" class="frm_input" size="40"> <a href="https://developers.kakao.com/product/kakaoLogin" target="_blank" class="btn_frmline">앱 등록하기</a>
<input type="text" name="cf_kakao_rest_key" value="<?php echo get_sanitize_input($config['cf_kakao_rest_key']); ?>" id="cf_kakao_rest_key" class="frm_input" size="40"> <a href="https://developers.kakao.com/console/app" target="_blank" class="btn_frmline">앱 등록하기</a>
</td>
<th scope="row"><label for="cf_kakao_client_secret">카카오 Client Secret</label></th>
<td>
@@ -1451,7 +1451,7 @@ if ($config['cf_sms_use'] && $config['cf_icode_id'] && $config['cf_icode_pw']) {
<tr>
<th scope="row"><label for="cf_payco_clientid">페이코 Client ID</label></th>
<td>
<input type="text" name="cf_payco_clientid" value="<?php echo get_sanitize_input($config['cf_payco_clientid']); ?>" id="cf_payco_clientid" class="frm_input" size="40"> <a href="https://developers.payco.com/guide" target="_blank" class="btn_frmline">앱 등록하기</a>
<input type="text" name="cf_payco_clientid" value="<?php echo get_sanitize_input($config['cf_payco_clientid']); ?>" id="cf_payco_clientid" class="frm_input" size="40"> <a href="https://developers.payco.com/application/registView" target="_blank" class="btn_frmline">앱 등록하기</a>
</td>
<th scope="row"><label for="cf_payco_secret">페이코 Secret</label></th>
<td>
@@ -1616,17 +1616,24 @@ if ($config['cf_sms_use'] && $config['cf_icode_id'] && $config['cf_icode_pw']) {
</div>
</section>
<div id="config_captcha_wrap" style="display:none">
<h2>캡챠입력</h2>
<?php
require_once G5_CAPTCHA_PATH . '/captcha.lib.php';
$captcha_html = captcha_html();
$captcha_js = chk_captcha_js();
echo $captcha_html;
?>
</div>
<style>
.btn_fixed_top.btn_confirm {display:flex;align-items:flex-start;gap:8px;z-index:1001}
#config_captcha_wrap {max-width:calc(100vw - 40px);padding:10px 12px;border:1px solid #c5cbd5;border-radius:3px;background:#fff;box-shadow:0 2px 8px rgba(0,0,0,0.15);text-align:left}
#config_captcha_wrap h2 {margin:0 0 6px;padding:0;font-size:1em;line-height:1.2;color:#3a3a3a}
#config_captcha_wrap #mp_captcha_tooltip {margin:6px 0 0;color:#e8180c}
</style>
<div class="btn_fixed_top btn_confirm">
<div id="config_captcha_wrap" style="display:none">
<h2>캡챠입력</h2>
<?php
require_once G5_CAPTCHA_PATH . '/captcha.lib.php';
$captcha_html = captcha_html();
$captcha_js = chk_captcha_js();
echo $captcha_html;
?>
</div>
<input type="submit" value="확인" class="btn_submit btn" accesskey="s">
</div>
@@ -1731,7 +1738,6 @@ if ($config['cf_sms_use'] && $config['cf_icode_id'] && $config['cf_icode_pw']) {
if(isChanged){
$wrap.show();
if(! is_invisible_recaptcha) {
$wrap.css("margin-top","1em");
if(! $("#"+tooptipid).length){ $children.after($p_text) }
}
} else {
@@ -1747,8 +1753,11 @@ if ($config['cf_sms_use'] && $config['cf_icode_id'] && $config['cf_icode_pw']) {
var cf_intercept_ip_val = f.cf_intercept_ip.value;
if (check_config_captcha_open()){
jQuery("html, body").scrollTop(jQuery("#config_captcha_wrap").offset().top);
// 캡챠는 확인 버튼 옆에 고정 노출되므로 별도 이동 없이 입력란으로 포커스만 옮긴다.
if (jQuery("#captcha_key").is(":visible")) {
jQuery("#captcha_key").focus();
}
<?php echo $captcha_js; // 캡챠 사용시 자바스크립트에서 입력된 캡챠를 검사함 ?>
}
+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])))) : '';
}
}
}
+29 -6
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)) : '';
@@ -40,6 +40,12 @@ if ($is_admin !== 'super') {
$co_include_tail = '';
}
}
// 저장·검증 전에 경로를 먼저 정규화하여, 검증 이후 경로가 달라지지 않도록 한다.
if (function_exists('filter_input_include_path')) {
$co_include_head = filter_input_include_path($co_include_head);
$co_include_tail = filter_input_include_path($co_include_tail);
}
$co_tag_filter_use = isset($_POST['co_tag_filter_use']) ? (int) $_POST['co_tag_filter_use'] : 1;
$co_himg_del = (isset($_POST['co_himg_del']) && $_POST['co_himg_del']) ? 1 : 0;
$co_timg_del = (isset($_POST['co_timg_del']) && $_POST['co_timg_del']) ? 1 : 0;
@@ -86,6 +92,14 @@ if ($co_include_tail) {
}
}
if ($co_include_head && function_exists('is_content_include_allowed') && !is_content_include_allowed($co_include_head)) {
alert('상단 파일 경로로 사용할 수 없는 위치입니다.');
}
if ($co_include_tail && function_exists('is_content_include_allowed') && !is_content_include_allowed($co_include_tail)) {
alert('하단 파일 경로로 사용할 수 없는 위치입니다.');
}
if ($co_include_head && !is_include_path_check($co_include_head, 1)) {
$co_include_head = '';
$error_msg = '/data/file/ 또는 /data/editor/ 포함된 문자를 상단 파일 경로에 포함시킬수 없습니다.';
@@ -96,11 +110,6 @@ if ($co_include_tail && !is_include_path_check($co_include_tail, 1)) {
$error_msg = '/data/file/ 또는 /data/editor/ 포함된 문자를 하단 파일 경로에 포함시킬수 없습니다.';
}
if (function_exists('filter_input_include_path')) {
$co_include_head = filter_input_include_path($co_include_head);
$co_include_tail = filter_input_include_path($co_include_tail);
}
$co_seo_title = exist_seo_title_recursive('content', generate_seo_title($co_subject), $g5['content_table'], $co_id);
$sql_common = " co_include_head = '$co_include_head',
@@ -147,6 +156,20 @@ if (function_exists('get_admin_captcha_by')) {
g5_delete_cache_by_prefix('content-' . $co_id . '-');
if ($w == "" || $w == "u") {
foreach (array('co_himg', 'co_timg') as $content_img_field) {
if (empty($_FILES[$content_img_field]['name']) || empty($_FILES[$content_img_field]['tmp_name']))
continue;
// 상단/하단 이미지 슬롯에는 이미지만 허용하고, 실행 가능한 태그가 담긴 파일은 거부한다.
$tmp_file = $_FILES[$content_img_field]['tmp_name'];
$is_valid_image = @getimagesize($tmp_file);
$head_bytes = @file_get_contents($tmp_file, false, null, 0, 8192);
if ($is_valid_image === false || ($head_bytes !== false && preg_match('/<\?php|<\?=|<\?|<script/i', $head_bytes))) {
alert('상단/하단 이미지에는 이미지 파일만 등록할 수 있습니다.');
}
}
if ($_FILES['co_himg']['name']) {
$dest_path = G5_DATA_PATH . "/content/" . $co_id . "_h";
@move_uploaded_file($_FILES['co_himg']['tmp_name'], $dest_path);
+2 -2
View File
@@ -1083,8 +1083,8 @@ box-shadow: 2px 2px 3px 0px rgba(0,0,0,0.2);}
.sevice_1 h4{width:100%;padding:0; margin:0;border-top:1px solid #ebe8e8;}
.sevice_1 h4 a{display:inline-block;height:75px;padding:10px 0 0;width:100%}
.svc_card{background:url('../img/service_img1.jpg') no-repeat top center;margin-right:13px;}
.svc_card ul li{width:33%;}
.svc_card{background:url('../img/service_img1.jpg') no-repeat top center;margin-right:13px;width:520px;}
.svc_card ul li{width:25%;box-sizing:border-box;}
.svc_phone {background:url('../img/service_img2.jpg') no-repeat top center;margin-right:13px;}
.svc_phone ul li{width:50%;}
.svc_ipin {background:url('../img/service_img3.jpg') no-repeat top center;}
+258 -1
View File
@@ -374,6 +374,263 @@ if (!sql_query(" DESC `{$g5['member_auto_login_table']}` ", false)) {
$is_check = true;
}
// KG이니시스 결제 처리 현황 및 단계별 이력 테이블
if (defined('G5_USE_SHOP') && G5_USE_SHOP) {
$inicis_pro_config_columns = array(
'de_inicis_pro_alert_use' => "ADD COLUMN `de_inicis_pro_alert_use` tinyint(4) NOT NULL DEFAULT '1'",
'de_inicis_pro_reconcile_use' => "ADD COLUMN `de_inicis_pro_reconcile_use` tinyint(4) NOT NULL DEFAULT '0'",
'de_inicis_pro_log_days' => "ADD COLUMN `de_inicis_pro_log_days` int(11) NOT NULL DEFAULT '365'",
'de_inicis_pro_summary_days' => "ADD COLUMN `de_inicis_pro_summary_days` int(11) NOT NULL DEFAULT '1825'",
'de_inicis_pro_monitor_at' => "ADD COLUMN `de_inicis_pro_monitor_at` datetime DEFAULT NULL",
'de_inicis_pro_monitor_message' => "ADD COLUMN `de_inicis_pro_monitor_message` varchar(255) NOT NULL DEFAULT ''"
);
$inicis_pro_config_alter = array();
foreach ($inicis_pro_config_columns as $column => $alter) {
$column_result = sql_query(" SHOW COLUMNS FROM `{$g5['g5_shop_default_table']}` LIKE '$column' ", false);
if (!$column_result || sql_num_rows($column_result) === 0)
$inicis_pro_config_alter[] = $alter;
}
if (count($inicis_pro_config_alter)) {
sql_query(" ALTER TABLE `{$g5['g5_shop_default_table']}` ".implode(', ', $inicis_pro_config_alter), true);
$is_check = true;
}
if (!isset($g5['g5_shop_inicis_pay_table']))
$g5['g5_shop_inicis_pay_table'] = G5_SHOP_TABLE_PREFIX.'inicis_pay';
if (!isset($g5['g5_shop_inicis_pay_event_table']))
$g5['g5_shop_inicis_pay_event_table'] = G5_SHOP_TABLE_PREFIX.'inicis_pay_event';
if (!sql_query(" DESC `{$g5['g5_shop_inicis_pay_table']}` ", false)) {
sql_query(" CREATE TABLE IF NOT EXISTS `{$g5['g5_shop_inicis_pay_table']}` (
`ip_id` int(11) NOT NULL AUTO_INCREMENT,
`ip_oid` varchar(64) NOT NULL DEFAULT '',
`ip_tid` varchar(80) NOT NULL DEFAULT '',
`ip_auth_tid` varchar(80) NOT NULL DEFAULT '',
`ip_mid` varchar(80) NOT NULL DEFAULT '',
`ip_environment` varchar(10) NOT NULL DEFAULT '',
`mb_id` varchar(20) NOT NULL DEFAULT '',
`ip_amount` int(11) NOT NULL DEFAULT '0',
`ip_pay_type` varchar(20) NOT NULL DEFAULT '',
`ip_easy_pay` varchar(20) NOT NULL DEFAULT '',
`ip_device` varchar(10) NOT NULL DEFAULT '',
`ip_order_type` varchar(10) NOT NULL DEFAULT '',
`ip_status` varchar(30) NOT NULL DEFAULT '',
`ip_result_code` varchar(30) NOT NULL DEFAULT '',
`ip_result_message` varchar(255) NOT NULL DEFAULT '',
`ip_noti_status` varchar(30) NOT NULL DEFAULT '',
`ip_noti_code` varchar(30) NOT NULL DEFAULT '',
`ip_noti_message` varchar(255) NOT NULL DEFAULT '',
`ip_noti_failed_count` int(11) NOT NULL DEFAULT '0',
`ip_noti_at` datetime DEFAULT NULL,
`ip_cancel_status` varchar(30) NOT NULL DEFAULT '',
`ip_cancel_code` varchar(30) NOT NULL DEFAULT '',
`ip_cancel_message` varchar(255) NOT NULL DEFAULT '',
`ip_cancel_checked_at` datetime DEFAULT NULL,
`ip_refund_required` tinyint(4) NOT NULL DEFAULT '0',
`ip_vbank_due_at` datetime DEFAULT NULL,
`ip_expired_at` datetime DEFAULT NULL,
`ip_order_exists` tinyint(4) NOT NULL DEFAULT '0',
`ip_approved_at` datetime DEFAULT NULL,
`ip_ordered_at` datetime DEFAULT NULL,
`ip_notified_at` datetime DEFAULT NULL,
`ip_canceled_at` datetime DEFAULT NULL,
`ip_created_at` datetime DEFAULT NULL,
`ip_updated_at` datetime DEFAULT NULL,
`ip_ip` varchar(45) NOT NULL DEFAULT '',
`ip_event_count` int(11) NOT NULL DEFAULT '0',
`ip_audit_error` tinyint(4) NOT NULL DEFAULT '0',
`ip_alerted_at` datetime DEFAULT NULL,
`ip_alert_key` varchar(64) NOT NULL DEFAULT '',
`ip_pg_status` varchar(30) NOT NULL DEFAULT '',
`ip_pg_amount` int(11) NOT NULL DEFAULT '0',
`ip_pg_tid` varchar(80) NOT NULL DEFAULT '',
`ip_pg_result_code` varchar(30) NOT NULL DEFAULT '',
`ip_pg_message` varchar(255) NOT NULL DEFAULT '',
`ip_pg_checked_at` datetime DEFAULT NULL,
PRIMARY KEY (`ip_id`),
UNIQUE KEY `ip_oid` (`ip_oid`),
KEY `ip_tid` (`ip_tid`),
KEY `ip_auth_tid` (`ip_auth_tid`),
KEY `ip_status` (`ip_status`),
KEY `ip_noti_status` (`ip_noti_status`),
KEY `ip_cancel_status` (`ip_cancel_status`),
KEY `ip_refund_required` (`ip_refund_required`),
KEY `ip_updated_at` (`ip_updated_at`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ", true);
$is_check = true;
}
if (sql_query(" DESC `{$g5['g5_shop_inicis_pay_table']}` ", false)) {
$inicis_pay_columns = array(
'ip_environment' => "ADD COLUMN `ip_environment` varchar(10) NOT NULL DEFAULT '' AFTER `ip_mid`",
'ip_easy_pay' => "ADD COLUMN `ip_easy_pay` varchar(20) NOT NULL DEFAULT '' AFTER `ip_pay_type`",
'ip_noti_status' => "ADD COLUMN `ip_noti_status` varchar(30) NOT NULL DEFAULT '' AFTER `ip_result_message`",
'ip_noti_code' => "ADD COLUMN `ip_noti_code` varchar(30) NOT NULL DEFAULT '' AFTER `ip_noti_status`",
'ip_noti_message' => "ADD COLUMN `ip_noti_message` varchar(255) NOT NULL DEFAULT '' AFTER `ip_noti_code`",
'ip_noti_failed_count' => "ADD COLUMN `ip_noti_failed_count` int(11) NOT NULL DEFAULT '0' AFTER `ip_noti_message`",
'ip_noti_at' => "ADD COLUMN `ip_noti_at` datetime DEFAULT NULL AFTER `ip_noti_failed_count`",
'ip_cancel_status' => "ADD COLUMN `ip_cancel_status` varchar(30) NOT NULL DEFAULT '' AFTER `ip_noti_at`",
'ip_cancel_code' => "ADD COLUMN `ip_cancel_code` varchar(30) NOT NULL DEFAULT '' AFTER `ip_cancel_status`",
'ip_cancel_message' => "ADD COLUMN `ip_cancel_message` varchar(255) NOT NULL DEFAULT '' AFTER `ip_cancel_code`",
'ip_cancel_checked_at' => "ADD COLUMN `ip_cancel_checked_at` datetime DEFAULT NULL AFTER `ip_cancel_message`",
'ip_refund_required' => "ADD COLUMN `ip_refund_required` tinyint(4) NOT NULL DEFAULT '0' AFTER `ip_cancel_checked_at`",
'ip_vbank_due_at' => "ADD COLUMN `ip_vbank_due_at` datetime DEFAULT NULL AFTER `ip_refund_required`",
'ip_expired_at' => "ADD COLUMN `ip_expired_at` datetime DEFAULT NULL AFTER `ip_vbank_due_at`",
'ip_audit_error' => "ADD COLUMN `ip_audit_error` tinyint(4) NOT NULL DEFAULT '0'",
'ip_alerted_at' => "ADD COLUMN `ip_alerted_at` datetime DEFAULT NULL",
'ip_alert_key' => "ADD COLUMN `ip_alert_key` varchar(64) NOT NULL DEFAULT ''",
'ip_pg_status' => "ADD COLUMN `ip_pg_status` varchar(30) NOT NULL DEFAULT ''",
'ip_pg_amount' => "ADD COLUMN `ip_pg_amount` int(11) NOT NULL DEFAULT '0'",
'ip_pg_tid' => "ADD COLUMN `ip_pg_tid` varchar(80) NOT NULL DEFAULT ''",
'ip_pg_result_code' => "ADD COLUMN `ip_pg_result_code` varchar(30) NOT NULL DEFAULT ''",
'ip_pg_message' => "ADD COLUMN `ip_pg_message` varchar(255) NOT NULL DEFAULT ''",
'ip_pg_checked_at' => "ADD COLUMN `ip_pg_checked_at` datetime DEFAULT NULL"
);
$inicis_pay_alter = array();
foreach ($inicis_pay_columns as $column => $alter) {
$column_result = sql_query(" SHOW COLUMNS FROM `{$g5['g5_shop_inicis_pay_table']}` LIKE '$column' ", false);
if (!$column_result || sql_num_rows($column_result) === 0)
$inicis_pay_alter[] = $alter;
}
if (count($inicis_pay_alter)) {
sql_query(" ALTER TABLE `{$g5['g5_shop_inicis_pay_table']}` ".implode(', ', $inicis_pay_alter), true);
$is_check = true;
}
if (count($inicis_pay_alter)) {
$environment = !empty($default['de_card_test']) ? 'test' : 'live';
sql_query(" insert ignore into `{$g5['g5_shop_inicis_pay_table']}`
(ip_oid, ip_environment, ip_status, ip_noti_status, ip_noti_code, ip_noti_message,
ip_noti_failed_count, ip_noti_at, ip_created_at, ip_updated_at, ip_event_count)
select e.ip_oid, '$environment', e.pe_status, e.pe_status, e.pe_code, e.pe_message,
sum(if(e.pe_status = 'notification_failed', 1, 0)), max(e.pe_created_at),
min(e.pe_created_at), max(e.pe_created_at), count(*)
from `{$g5['g5_shop_inicis_pay_event_table']}` e
left join `{$g5['g5_shop_inicis_pay_table']}` p on p.ip_oid = e.ip_oid
where p.ip_id is null
and e.pe_stage = 'notification'
group by e.ip_oid ", false);
sql_query(" update `{$g5['g5_shop_inicis_pay_table']}`
set ip_environment = case
when lower(ip_mid) in ('inipaytest','iniescrow0') then 'test'
when ip_mid <> '' then 'live'
else '$environment'
end
where ip_environment = '' ", false);
sql_query(" update `{$g5['g5_shop_inicis_pay_table']}` p
inner join (
select ip_oid, max(pe_id) as pe_id,
sum(if(pe_status = 'notification_failed', 1, 0)) as fail_count
from `{$g5['g5_shop_inicis_pay_event_table']}`
where pe_stage = 'notification'
group by ip_oid
) x on x.ip_oid = p.ip_oid
inner join `{$g5['g5_shop_inicis_pay_event_table']}` e on e.pe_id = x.pe_id
set p.ip_noti_status = e.pe_status,
p.ip_noti_code = e.pe_code,
p.ip_noti_message = e.pe_message,
p.ip_noti_failed_count = x.fail_count,
p.ip_noti_at = e.pe_created_at ", false);
sql_query(" update `{$g5['g5_shop_inicis_pay_table']}` p
inner join (
select ip_oid, max(pe_id) as pe_id
from `{$g5['g5_shop_inicis_pay_event_table']}`
where pe_stage = 'cancel'
group by ip_oid
) x on x.ip_oid = p.ip_oid
inner join `{$g5['g5_shop_inicis_pay_event_table']}` e on e.pe_id = x.pe_id
set p.ip_cancel_status = e.pe_status,
p.ip_cancel_code = e.pe_code,
p.ip_cancel_message = e.pe_message,
p.ip_cancel_checked_at = e.pe_created_at ", false);
sql_query(" update `{$g5['g5_shop_inicis_pay_table']}` p
inner join `{$g5['g5_shop_inicis_pay_event_table']}` e on e.ip_oid = p.ip_oid and e.pe_stage = 'request'
set p.ip_easy_pay = case
when e.pe_message like '삼성페이%' then 'SAMSUNGPAY'
when e.pe_message like 'lpay%' then 'LPAY'
when e.pe_message like 'inicis_kakaopay%' then 'KAKAOPAY'
when e.pe_message like '간편결제%' then 'EASYPAY'
else p.ip_easy_pay
end
where p.ip_easy_pay = '' ", false);
sql_query(" update `{$g5['g5_shop_inicis_pay_table']}`
set ip_noti_status = case
when ip_status = 'paid' then 'paid'
when ip_status = 'vbank_issued' then 'vbank_issued'
when ip_status = 'notification_received' then 'notification_received'
else ip_noti_status
end,
ip_cancel_status = case
when ip_status in ('canceled','cancel_failed','partial_canceled','partial_cancel_failed') then ip_status
else ip_cancel_status
end ", false);
sql_query(" update `{$g5['g5_shop_inicis_pay_table']}` p
inner join {$g5['g5_shop_order_table']} o on o.od_id = p.ip_oid
set p.ip_status = 'paid_after_cancel',
p.ip_refund_required = '1',
p.ip_noti_status = 'paid_after_cancel',
p.ip_noti_message = '취소 주문에 가상계좌 입금 확인'
where p.ip_pay_type = 'VBANK'
and p.ip_status = 'paid'
and o.od_status = '취소'
and o.od_receipt_price > 0 ", false);
$inicis_pro_migrated_at = G5_TIME_YMDHIS;
$inicis_pro_migrated_message = '기존 결제·주문 이력 대조에서 취소 후 입금 확인';
sql_query(" insert into `{$g5['g5_shop_inicis_pay_event_table']}`
(ip_oid, ip_tid, pe_stage, pe_status, pe_code, pe_message, pe_source, pe_ip, pe_created_at)
select p.ip_oid, p.ip_tid, 'reconcile', 'paid_after_cancel', '',
'".sql_escape_string($inicis_pro_migrated_message)."', 'system', '', '$inicis_pro_migrated_at'
from `{$g5['g5_shop_inicis_pay_table']}` p
left join `{$g5['g5_shop_inicis_pay_event_table']}` e
on e.ip_oid = p.ip_oid and e.pe_status = 'paid_after_cancel'
where p.ip_status = 'paid_after_cancel'
and p.ip_refund_required = '1'
and e.pe_id is null ", false);
sql_query(" update `{$g5['g5_shop_inicis_pay_table']}` p
inner join `{$g5['g5_shop_inicis_pay_event_table']}` e
on e.ip_oid = p.ip_oid
and e.pe_status = 'paid_after_cancel'
and e.pe_message = '".sql_escape_string($inicis_pro_migrated_message)."'
and e.pe_created_at = '$inicis_pro_migrated_at'
set p.ip_event_count = p.ip_event_count + 1 ", false);
}
$inicis_pay_indexes = array(
'ip_noti_status' => "ADD KEY `ip_noti_status` (`ip_noti_status`)",
'ip_cancel_status' => "ADD KEY `ip_cancel_status` (`ip_cancel_status`)",
'ip_refund_required' => "ADD KEY `ip_refund_required` (`ip_refund_required`)"
);
foreach ($inicis_pay_indexes as $index_name => $index_sql) {
$index_result = sql_query(" SHOW INDEX FROM `{$g5['g5_shop_inicis_pay_table']}` WHERE Key_name = '$index_name' ", false);
if (!$index_result || sql_num_rows($index_result) === 0) {
sql_query(" ALTER TABLE `{$g5['g5_shop_inicis_pay_table']}` $index_sql ", true);
$is_check = true;
}
}
}
if (!sql_query(" DESC `{$g5['g5_shop_inicis_pay_event_table']}` ", false)) {
sql_query(" CREATE TABLE IF NOT EXISTS `{$g5['g5_shop_inicis_pay_event_table']}` (
`pe_id` int(11) NOT NULL AUTO_INCREMENT,
`ip_oid` varchar(64) NOT NULL DEFAULT '',
`ip_tid` varchar(80) NOT NULL DEFAULT '',
`pe_stage` varchar(30) NOT NULL DEFAULT '',
`pe_status` varchar(30) NOT NULL DEFAULT '',
`pe_code` varchar(30) NOT NULL DEFAULT '',
`pe_message` varchar(255) NOT NULL DEFAULT '',
`pe_source` varchar(10) NOT NULL DEFAULT '',
`pe_ip` varchar(45) NOT NULL DEFAULT '',
`pe_created_at` datetime DEFAULT NULL,
PRIMARY KEY (`pe_id`),
KEY `ip_oid` (`ip_oid`),
KEY `ip_tid` (`ip_tid`),
KEY `pe_status` (`pe_status`),
KEY `pe_created_at` (`pe_created_at`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ", true);
$is_check = true;
}
}
$is_check = run_replace('admin_dbupgrade', $is_check);
$db_upgrade_msg = $is_check ? 'DB 업그레이드가 완료되었습니다.' : '더 이상 업그레이드 할 내용이 없습니다.<br>현재 DB 업그레이드가 완료된 상태입니다.';
@@ -386,4 +643,4 @@ $db_upgrade_msg = $is_check ? 'DB 업그레이드가 완료되었습니다.' : '
</div>
<?php
include_once ('./admin.tail.php');
include_once ('./admin.tail.php');
+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'] : '';
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

+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 == '') {
+1 -1
View File
@@ -625,7 +625,7 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
<?php for ($i = 1; $i <= 10; $i++) { ?>
<tr>
<th scope="row"><label for="mb_<?php echo $i ?>">여분 필드 <?php echo $i ?></label></th>
<td colspan="3"><input type="text" name="mb_<?php echo $i ?>" value="<?php echo $mb['mb_' . $i] ?>" id="mb_<?php echo $i ?>" class="frm_input" size="30" maxlength="255"></td>
<td colspan="3"><input type="text" name="mb_<?php echo $i ?>" value="<?php echo get_sanitize_input($mb['mb_' . $i]); ?>" id="mb_<?php echo $i ?>" class="frm_input" size="30" maxlength="255"></td>
</tr>
<?php } ?>
+4 -1
View File
@@ -6,7 +6,6 @@ auth_check_menu($auth, $sub_menu, 'r');
$sql_common = " from {$g5['member_table']} ";
// $sfl 화이트리스트 검증 (KVE-2026-0340)
$allowed_sfl = array('mb_id', 'mb_nick', 'mb_name', 'mb_level', 'mb_email', 'mb_tel', 'mb_hp', 'mb_point', 'mb_datetime', 'mb_ip', 'mb_recommend');
if (!in_array($sfl, $allowed_sfl)) {
$sfl = 'mb_id';
@@ -42,6 +41,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} ";
+5 -3
View File
@@ -7,7 +7,9 @@
define('MEMBER_EXPORT_PAGE_SIZE', 10000); // 파일당 처리할 회원 수
define('MEMBER_EXPORT_MAX_SIZE', 300000); // 최대 처리할 회원 수
define('MEMBER_BASE_DIR', "member_list"); // 엑셀 베이스 폴더
define('MEMBER_BASE_DATE', date('YmdHis')); // 폴더/파일명용 날짜
// 폴더/파일명용 날짜 - 저장 경로가 추측되지 않도록 임의 문자열을 덧붙인다.
define('MEMBER_BASE_SALT', function_exists('get_random_token_string') ? get_random_token_string(8) : substr(md5(uniqid(mt_rand(), true)), 0, 8));
define('MEMBER_BASE_DATE', date('YmdHis') . '_' . MEMBER_BASE_SALT);
define('MEMBER_EXPORT_DIR', G5_DATA_PATH . "/" . MEMBER_BASE_DIR . "/" . MEMBER_BASE_DATE); // 엑셀 파일 저장 경로
define('MEMBER_LOG_DIR', G5_DATA_PATH . "/" . MEMBER_BASE_DIR . "/" . "log"); // 로그 파일 저장 경로
@@ -247,8 +249,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
@@ -413,7 +413,7 @@ function member_export_delete($fileList = array())
$name = basename($file);
// log 폴더와 오늘 날짜로 시작하는 폴더는 제외
if ($name === 'log' || preg_match('/^' . date('Ymd') . '\d{6}$/', $name)) continue;
if ($name === 'log' || preg_match('/^' . date('Ymd') . '\d{6}(_[A-Za-z0-9]+)?$/', $name)) continue;
if (is_file($file) && pathinfo($file, PATHINFO_EXTENSION) !== 'log' && @unlink($file)) {
$cnt++;
+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;
}
+5
View File
@@ -6,6 +6,11 @@ auth_check_menu($auth, $sub_menu, 'r');
$sql_common = " from {$g5['point_table']} po";
$allowed_sfl = array('mb_id', 'po_content');
if (!in_array($sfl, $allowed_sfl)) {
$sfl = 'mb_id';
}
$sql_search = " where (1) ";
if ($stx) {
+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']}
+5
View File
@@ -6,6 +6,11 @@ auth_check_menu($auth, $sub_menu, 'r');
$sql_common = " from {$g5['poll_table']} ";
$allowed_sfl = array('po_subject');
if (!in_array($sfl, $allowed_sfl)) {
$sfl = 'po_subject';
}
$sql_search = " where (1) ";
if ($stx) {
$sql_search .= " and ( ";
+5
View File
@@ -16,6 +16,11 @@ if (isset($_POST['chk']) && is_array($_POST['chk'])) {
}
$sql_common = " from {$g5['popular_table']} a ";
$allowed_sfl = array('pp_word', 'pp_date');
if (!in_array($sfl, $allowed_sfl)) {
$sfl = 'pp_word';
}
$sql_search = " where (1) ";
if ($stx) {
+13 -4
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)) : '';
@@ -36,6 +36,12 @@ if ($board && ($qaconfig['qa_include_head'] !== $qa_include_head || $qaconfig['q
}
}
// 저장·검증 전에 경로를 먼저 정규화하여, 검증 이후 경로가 달라지지 않도록 한다.
if (function_exists('filter_input_include_path')) {
$qa_include_head = filter_input_include_path($qa_include_head);
$qa_include_tail = filter_input_include_path($qa_include_tail);
}
if ($qa_include_head) {
$file_ext = pathinfo($qa_include_head, PATHINFO_EXTENSION);
@@ -62,9 +68,12 @@ if ($qa_include_tail && !is_include_path_check($qa_include_tail, 1)) {
$error_msg = '/data/file/ 또는 /data/editor/ 포함된 문자를 하단 파일 경로에 포함시킬수 없습니다.';
}
if (function_exists('filter_input_include_path')) {
$qa_include_head = filter_input_include_path($qa_include_head);
$qa_include_tail = filter_input_include_path($qa_include_tail);
if ($qa_include_head && function_exists('is_content_include_allowed') && !is_content_include_allowed($qa_include_head)) {
alert('상단 파일 경로로 사용할 수 없는 위치입니다.');
}
if ($qa_include_tail && function_exists('is_content_include_allowed') && !is_content_include_allowed($qa_include_tail)) {
alert('하단 파일 경로로 사용할 수 없는 위치입니다.');
}
// 분류에 & 나 = 는 사용이 불가하므로 2바이트로 바꾼다.
+7 -6
View File
@@ -17,9 +17,10 @@ include_once('./admin.head.php');
<h3>신용카드 전자결제 서비스<br><span>(계좌이체, 가상계좌 결제 포함)</span></h3>
<ul>
<li><a href="http://sir.kr/main/service/p_pg.php" target="_blank"><img src="<?php echo G5_ADMIN_URL ?>/img/svc_btn_01.jpg" alt="KCP 신용카드 전자결제 신청하기"></a></li>
<li><a href="http://sir.kr/main/service/lg_pg.php" target="_blank"><img src="<?php echo G5_ADMIN_URL ?>/img/svc_btn_02.jpg?v2" alt="토스페이먼츠 전자결제 신청하기"></a></li>
<li class="last"><a href="http://sir.kr/main/service/inicis_pg.php" target="_blank"><img src="<?php echo G5_ADMIN_URL ?>/img/svc_btn_06.jpg" alt="KG 이니시스 전자결제 신청하기"></a></li>
<li><a href="https://sir.kr/services/pg/kcp" target="_blank"><img src="<?php echo G5_ADMIN_URL ?>/img/svc_btn_01.jpg" alt="NHN KCP 신용카드 전자결제 신청하기"></a></li>
<li><a href="https://sir.kr/services/pg/toss" target="_blank"><img src="<?php echo G5_ADMIN_URL ?>/img/svc_btn_02.jpg?v2" alt="토스페이먼츠 전자결제 신청하기"></a></li>
<li><a href="https://sir.kr/services/pg/inicis" target="_blank"><img src="<?php echo G5_ADMIN_URL ?>/img/svc_btn_06.jpg" alt="KG 이니시스 전자결제 신청하기"></a></li>
<li class="last"><a href="https://sir.kr/services/pg/nice" target="_blank"><img src="<?php echo G5_ADMIN_URL ?>/img/svc_btn_07.jpg" alt="나이스페이먼츠 전자결제 신청하기"></a></li>
</ul>
</div>
@@ -27,8 +28,8 @@ include_once('./admin.head.php');
<h3>본인확인 서비스</h3>
<ul>
<li><a href="http://sir.kr/main/service/p_cert.php" target="_blank"><img src="<?php echo G5_ADMIN_URL ?>/img/svc_btn_01.jpg" alt="KCP 신청하기"></a></li>
<li><a href="http://sir.kr/main/service/inicis_cert.php" target="_blank"><img src="<?php echo G5_ADMIN_URL ?>/img/svc_btn_06.jpg" alt="KG이니시스 신청하기"></a></li>
<li><a href="https://sir.kr/services/auth/kcp" target="_blank"><img src="<?php echo G5_ADMIN_URL ?>/img/svc_btn_01.jpg" alt="NHN KCP 휴대폰 본인확인 신청하기"></a></li>
<li><a href="https://sir.kr/services/auth/inicis" target="_blank"><img src="<?php echo G5_ADMIN_URL ?>/img/svc_btn_06.jpg" alt="KG이니시스 본인확인 신청하기"></a></li>
</ul>
</div>
@@ -38,7 +39,7 @@ include_once('./admin.head.php');
<h3>SMS 문자 서비스</h3>
<p>주문이나 배송시에 상점운영자 또는 고객에게 휴대폰으로 단문메세지 (최대 한글 40자, 영문 80자)를 발송합니다.</p>
</div>
<div class="svc_btn2"><a href="http://icodekorea.com/res/join_company_fix_a.php?sellid=sir2" target="_blank"><img src="<?php echo G5_ADMIN_URL ?>/img/svc_btn_05.jpg" alt="아이코드 SMS 서비스 신청하기"></a></div>
<div class="svc_btn2"><a href="https://sir.kr/services/message/icode" target="_blank"><img src="<?php echo G5_ADMIN_URL ?>/img/svc_btn_05.jpg" alt="아이코드 SMS 서비스 신청하기"></a></div>
</div>
</div>
+238 -4
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)
{
@@ -161,6 +200,7 @@ function pg_setting_check($is_print=false){
}
function is_cancel_shop_pg_order($od){
global $default;
$is_od_pg_cancel = false;
@@ -168,7 +208,7 @@ function is_cancel_shop_pg_order($od){
$is_od_pg_cancel = true;
}
if ($od['od_pg'] === 'nicepay' && in_array($od['od_settle_case'], array('계좌이체', '휴대폰'))) {
if ($od['od_pg'] === 'nicepay' && in_array($od['od_settle_case'], array('계좌이체', '휴대폰', '가상계좌'))) {
$is_od_pg_cancel = true;
}
@@ -176,9 +216,201 @@ function is_cancel_shop_pg_order($od){
$is_od_pg_cancel = true;
}
if ($od['od_pg'] === 'inicis' && !empty($default['de_inicis_pro_use']) && !empty($od['od_tno'])
&& in_array($od['od_settle_case'], array('신용카드', '간편결제', '가상계좌', '계좌이체', '휴대폰', '삼성페이', 'lpay', 'inicis_kakaopay'))) {
$is_od_pg_cancel = true;
}
return $is_od_pg_cancel;
}
function check_order_inicis_pro_payments($run_external = true){
include_once(G5_SHOP_PATH.'/inicis/pro/inicis_pro.lib.php');
// 사이트 이용 흐름에서 실행되는 경량 감시는 잠금 대기 없이 즉시 시도하고,
// 획득하지 못하면 다른 요청이 이미 처리 중이므로 그대로 넘어간다.
$monitor_lock = inicis_pro_lock('monitor_process', $run_external ? 10 : 0);
if ($monitor_lock === '')
return false;
check_order_inicis_pro_payments_run($run_external);
inicis_pro_unlock($monitor_lock);
return true;
}
// 서버 스케줄러 없이 사이트 접속 흐름에서 실행되는 경량 감시.
// 방문자 응답을 먼저 종료해 페이지 지연 없이 뒤에서 처리한다.
function check_order_inicis_pro_payments_inline(){
global $default;
if (empty($default['de_pg_service']) || $default['de_pg_service'] !== 'inicis' || empty($default['de_inicis_pro_use']))
return;
if (function_exists('fastcgi_finish_request'))
@fastcgi_finish_request();
@ignore_user_abort(true);
check_order_inicis_pro_payments(false);
}
function check_order_inicis_pro_payments_run($run_external = true){
global $g5, $config, $default;
include_once(G5_SHOP_PATH.'/inicis/pro/inicis_pro.lib.php');
include_once(G5_ADMIN_PATH.'/shop_admin/inicislog.lib.php');
if (!inicis_pro_audit_schema_ready()) {
// 스키마가 준비되지 않았어도 감시 시각을 전진시켜, 사이트 접속 흐름의
// 인라인 감시가 매 요청마다 재등록·재실행되는 것을 막는다.
if (array_key_exists('de_inicis_pro_monitor_at', $default))
sql_query(" update {$g5['g5_shop_default_table']}
set de_inicis_pro_monitor_at = '".G5_TIME_YMDHIS."' ", false);
return;
}
$log_days = isset($default['de_inicis_pro_log_days']) ? (int) $default['de_inicis_pro_log_days'] : 365;
if ($log_days >= 30) {
inicis_pro_purge_events($log_days, 500);
inicis_pro_purge_payloads($log_days, 200);
}
$summary_days = isset($default['de_inicis_pro_summary_days']) ? (int) $default['de_inicis_pro_summary_days'] : 1825;
if ($summary_days >= 365)
inicis_pro_purge_summaries($summary_days, 50);
$tables = inicis_pro_audit_tables();
$expired_count = 0;
$expired_result = sql_query(" select ip_oid from `{$tables['summary']}`
where ip_status = 'request_ready'
and ip_updated_at < date_sub(now(), interval 30 minute)
order by ip_updated_at asc
limit 50 ", false);
if ($expired_result) {
while ($expired = sql_fetch_array($expired_result)) {
if (inicis_pro_audit_write($expired['ip_oid'], 'request', 'request_expired', array(
'source' => 'system',
'message' => '결제창 요청 후 인증결과가 없어 미진행으로 정리'
)))
$expired_count++;
}
}
$order_amount_sql = "(o.od_cart_price + o.od_send_cost + o.od_send_cost2 - o.od_cart_coupon - o.od_coupon - o.od_send_coupon - o.od_receipt_point)";
$anomaly_sql = inicis_admin_anomaly_sql();
$sql_from = " from `{$tables['summary']}` p
left join {$g5['g5_shop_order_table']} o on p.ip_order_type <> 'personal' and o.od_id = p.ip_oid
left join {$g5['g5_shop_personalpay_table']} pp on p.ip_order_type = 'personal' and pp.pp_id = p.ip_oid ";
$sql_fields = " select p.*,
o.od_id as order_oid, o.od_tno as order_tid, o.od_status as order_status,
o.od_receipt_price as order_receipt_price, o.od_misu as order_misu, o.od_cancel_price as order_cancel_price,
o.od_refund_price as order_refund_price, o.od_settle_case as order_settle_case, $order_amount_sql as order_amount,
pp.pp_id as personal_oid, pp.pp_tno as personal_tid, pp.pp_price as personal_amount, pp.pp_receipt_price as personal_receipt_price ";
$recover_result = sql_query(" select ip_oid from `{$tables['summary']}`
where ip_tid = ''
and ip_status in ('authentication_received','approval_started','validation_failed','order_saving')
and ip_updated_at < date_sub(now(), interval 3 minute)
order by ip_updated_at asc
limit 5 ", false);
if ($recover_result) {
while ($recover_row = sql_fetch_array($recover_result))
inicis_pro_recover_approved_tid($recover_row['ip_oid'], 'system');
}
$reconcile_count = 0;
$reconcile_failed_count = 0;
if ($run_external && empty($default['de_card_test']) && !empty($default['de_inicis_pro_reconcile_use']) && inicis_pro_get_iniapi_key() !== '') {
$result = sql_query(" $sql_fields $sql_from
where p.ip_tid <> ''
and p.ip_updated_at < date_sub(now(), interval 3 minute)
and (p.ip_pg_checked_at is null or p.ip_pg_checked_at < date_sub(now(), interval 1 hour))
and (p.ip_refund_required = '1'
or $anomaly_sql
or (p.ip_updated_at > date_sub(now(), interval 7 day)
and (p.ip_status in ('order_saved','paid','paid_after_cancel','vbank_issued','canceled','refund_completed')
or p.ip_cancel_status <> '')))
order by p.ip_refund_required desc, p.ip_updated_at asc
limit 10 ", false);
if ($result) {
while ($row = sql_fetch_array($result)) {
$inquiry = inicis_pro_inquiry($row['ip_tid'], $row['ip_oid'], $row);
if (inicis_pro_save_inquiry($row['ip_oid'], $inquiry, 'system') && !empty($inquiry['success']))
$reconcile_count++;
else
$reconcile_failed_count++;
}
}
}
$anomaly_count_row = sql_fetch(" select count(*) as cnt $sql_from where $anomaly_sql ");
$anomaly_count = isset($anomaly_count_row['cnt']) ? (int) $anomaly_count_row['cnt'] : 0;
if ($run_external)
$monitor_message = '미진행 '.$expired_count.'건 정리 / KG 대사 성공 '.$reconcile_count.'건, 실패 '.$reconcile_failed_count.'건 / 확인 필요 '.$anomaly_count.'건';
else
$monitor_message = '미진행 '.$expired_count.'건 정리 / 확인 필요 '.$anomaly_count.'건';
if (array_key_exists('de_inicis_pro_monitor_at', $default)) {
$monitor_set = "de_inicis_pro_monitor_at = '".G5_TIME_YMDHIS."'";
if (isset($default['de_inicis_pro_monitor_message']))
$monitor_set .= ", de_inicis_pro_monitor_message = '".sql_escape_string($monitor_message)."'";
sql_query(" update {$g5['g5_shop_default_table']} set $monitor_set ", false);
}
// 테스트 거래는 상세 화면에서 직접 조회하며 운영 메일에는 포함하지 않는다.
if (!empty($default['de_card_test']))
return;
if (empty($default['de_inicis_pro_alert_use']) || empty($config['cf_email_use']) || empty($config['cf_admin_email']))
return;
$result = sql_query(" $sql_fields $sql_from
where $anomaly_sql
order by p.ip_updated_at asc
limit 20 ", false);
if (!$result)
return;
$alert_rows = array();
$mail_msg = '';
while ($row = sql_fetch_array($result)) {
if (!inicis_admin_is_anomaly($row))
continue;
$alert_key = inicis_admin_alert_key($row);
if (!empty($row['ip_alert_key']) && $row['ip_alert_key'] === $alert_key)
continue;
$pg_state = !empty($row['ip_pg_checked_at'])
? ($row['ip_pg_result_code'] === '00' ? inicis_admin_pg_status_label($row['ip_pg_status']) : '거래조회 실패')
: '미조회';
$mail_msg .= '<tr>'
.'<td style="padding:6px;border:1px solid #ddd"><a href="'.G5_ADMIN_URL.'/shop_admin/inicislogview.php?oid='.urlencode($row['ip_oid']).'">'.get_text($row['ip_oid']).'</a></td>'
.'<td style="padding:6px;border:1px solid #ddd">'.get_text(inicis_admin_status_label(inicis_admin_primary_status($row))).'</td>'
.'<td style="padding:6px;border:1px solid #ddd">'.get_text($pg_state).'</td>'
.'<td style="padding:6px;border:1px solid #ddd;text-align:right">'.number_format((int) $row['ip_amount']).'원</td>'
.'</tr>';
$alert_rows[] = array('oid' => $row['ip_oid'], 'key' => $alert_key);
}
if (!count($alert_rows))
return;
include_once(G5_LIB_PATH.'/mailer.lib.php');
$content = '<p>KG이니시스 결제와 영카트 주문을 대조해야 하는 거래가 확인됐습니다.</p>'
.'<p>자동으로 주문을 생성하거나 결제를 취소하지 않았습니다. KG이니시스 거래조회 결과와 상점관리자 거래내역을 확인한 후 조치해 주십시오.</p>'
.'<table style="border-collapse:collapse"><thead><tr><th style="padding:6px;border:1px solid #ddd">주문번호</th><th style="padding:6px;border:1px solid #ddd">로컬 상태</th><th style="padding:6px;border:1px solid #ddd">KG 상태</th><th style="padding:6px;border:1px solid #ddd">금액</th></tr></thead><tbody>'
.$mail_msg.'</tbody></table>';
$sent = mailer($config['cf_admin_email_name'], $config['cf_admin_email'], $config['cf_admin_email'], '['.$config['cf_title'].'] KG이니시스 결제 확인 필요', $content, 1);
if (!$sent)
return;
foreach ($alert_rows as $alert_row) {
sql_query(" update `{$tables['summary']}`
set ip_alerted_at = '".G5_TIME_YMDHIS."',
ip_alert_key = '".sql_escape_string($alert_row['key'])."'
where ip_oid = '".sql_escape_string($alert_row['oid'])."' ", false);
}
}
function check_order_inicis_tmps(){
global $g5, $config, $default, $member;
@@ -186,7 +418,9 @@ function check_order_inicis_tmps(){
if( ! $admin_cookie_time ){
if( $default['de_pg_service'] === 'inicis' && empty($default['de_card_test']) ){
if ($default['de_pg_service'] === 'inicis' && !empty($default['de_inicis_pro_use'])) {
check_order_inicis_pro_payments();
} elseif( $default['de_pg_service'] === 'inicis' && empty($default['de_card_test']) ){
$sql = " select * from {$g5['g5_shop_inicis_log_table']} where P_TID <> '' and P_TYPE in ('CARD', 'ISP', 'BANK') and P_MID <> '' and P_STATUS = '00' and is_mail_send = 0 and substr(P_AUTH_DT, 1, 14) < '".date('YmdHis', strtotime('-3 minutes', G5_SERVER_TIME))."' ";
$result = sql_query($sql, false);
@@ -201,7 +435,7 @@ function check_order_inicis_tmps(){
$oid = $row['oid'];
$p_tid = $row['P_TID'];
$p_mid = strtolower($tmps['P_MID']);
$p_mid = strtolower($row['P_MID']);
if( in_array($p_mid, array('iniescrow0', 'inipaytest')) ) continue;
@@ -241,4 +475,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");
}
}
+14 -6
View File
@@ -6,6 +6,11 @@ auth_check_menu($auth, $sub_menu, "w");
$ca_include_head = isset($_POST['ca_include_head']) ? trim($_POST['ca_include_head']) : '';
$ca_include_tail = isset($_POST['ca_include_tail']) ? trim($_POST['ca_include_tail']) : '';
// 저장·검증 전에 경로를 먼저 정규화하여, 검증 이후 경로가 달라지지 않도록 한다.
if( function_exists('filter_input_include_path') ){
$ca_include_head = filter_input_include_path($ca_include_head);
$ca_include_tail = filter_input_include_path($ca_include_tail);
}
$ca_id = isset($_REQUEST['ca_id']) ? preg_replace('/[^0-9a-z]/i', '', $_REQUEST['ca_id']) : '';
if( ! $ca_id ){
@@ -75,7 +80,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;
}
@@ -93,6 +98,14 @@ if(!is_include_path_check($ca_include_tail, 1)) {
alert('하단 파일 경로에 포함시킬수 없는 문자열이 있습니다.');
}
if($ca_include_head && function_exists('is_content_include_allowed') && !is_content_include_allowed($ca_include_head)) {
alert('상단 파일 경로로 사용할 수 없는 위치입니다.');
}
if($ca_include_tail && function_exists('is_content_include_allowed') && !is_content_include_allowed($ca_include_tail)) {
alert('하단 파일 경로로 사용할 수 없는 위치입니다.');
}
$check_keys = array('ca_skin_dir', 'ca_mobile_skin_dir', 'ca_skin', 'ca_mobile_skin');
foreach( $check_keys as $key ){
@@ -101,11 +114,6 @@ foreach( $check_keys as $key ){
}
}
if( function_exists('filter_input_include_path') ){
$ca_include_head = filter_input_include_path($ca_include_head);
$ca_include_tail = filter_input_include_path($ca_include_tail);
}
if ($w == "u" || $w == "d")
check_demo();
+1 -1
View File
@@ -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();
+127 -7
View File
@@ -207,6 +207,44 @@ if( ! isset($default['de_inicis_iniapi_key']) ){
sql_query($sql, false);
}
// KG이니시스 INIpay PRO 설정 추가
if (!isset($default['de_inicis_pro_use'])) {
$sql = "ALTER TABLE `{$g5['g5_shop_default_table']}`
ADD COLUMN `de_inicis_pro_use` TINYINT(4) NOT NULL DEFAULT '0' AFTER `de_inicis_sign_key`,
ADD COLUMN `de_inicis_hash_key` VARCHAR(255) NOT NULL DEFAULT '' AFTER `de_inicis_pro_use`; ";
sql_query($sql, false);
}
if (!isset($default['de_inicis_pro_alert_use'])) {
sql_query("ALTER TABLE `{$g5['g5_shop_default_table']}` ADD COLUMN `de_inicis_pro_alert_use` TINYINT(4) NOT NULL DEFAULT '1'", false);
$default['de_inicis_pro_alert_use'] = 1;
}
if (!isset($default['de_inicis_pro_reconcile_use'])) {
sql_query("ALTER TABLE `{$g5['g5_shop_default_table']}` ADD COLUMN `de_inicis_pro_reconcile_use` TINYINT(4) NOT NULL DEFAULT '0'", false);
$default['de_inicis_pro_reconcile_use'] = 0;
}
if (!isset($default['de_inicis_pro_log_days'])) {
sql_query("ALTER TABLE `{$g5['g5_shop_default_table']}` ADD COLUMN `de_inicis_pro_log_days` INT(11) NOT NULL DEFAULT '365'", false);
$default['de_inicis_pro_log_days'] = 365;
}
if (!isset($default['de_inicis_pro_summary_days'])) {
sql_query("ALTER TABLE `{$g5['g5_shop_default_table']}` ADD COLUMN `de_inicis_pro_summary_days` INT(11) NOT NULL DEFAULT '1825'", false);
$default['de_inicis_pro_summary_days'] = 1825;
}
if (!array_key_exists('de_inicis_pro_monitor_at', $default)) {
sql_query("ALTER TABLE `{$g5['g5_shop_default_table']}` ADD COLUMN `de_inicis_pro_monitor_at` DATETIME DEFAULT NULL", false);
$default['de_inicis_pro_monitor_at'] = '';
}
if (!isset($default['de_inicis_pro_monitor_message'])) {
sql_query("ALTER TABLE `{$g5['g5_shop_default_table']}` ADD COLUMN `de_inicis_pro_monitor_message` VARCHAR(255) NOT NULL DEFAULT ''", false);
$default['de_inicis_pro_monitor_message'] = '';
}
// KG이니시스 INIpay PRO 결제 감사 테이블이 없으면 생성한다.
include_once(G5_SHOP_PATH.'/inicis/pro/inicis_pro.lib.php');
if (function_exists('inicis_pro_audit_ensure_tables'))
inicis_pro_audit_ensure_tables();
// NICEPAY mid, key 추가
if (! isset($default['de_nicepay_mid'])) {
$sql = "ALTER TABLE `{$g5['g5_shop_default_table']}`
@@ -879,34 +917,73 @@ if(!$default['de_kakaopay_cancelpwd']){
<span class="sitecode">SIR</span> <input type="text" name="de_inicis_mid" value="<?php echo $default['de_inicis_mid']; ?>" id="de_inicis_mid" class="frm_input code_input" size="10" maxlength="10"> 영문소문자(숫자포함 가능)
</td>
</tr>
<tr class="pg_info_fld inicis_info_fld">
<th scope="row"><label for="de_inicis_pro_use">KG이니시스 INIpay PRO</label></th>
<td>
<?php echo help("체크시 PC와 모바일에서 가장 최신 결제모듈인 KG이니시스 INIpay PRO 통합 결제창을 사용합니다. 실결제시 반드시 필수로 KG이니시스 모바일 금액위변조 Hash Key 를 입력해야 합니다."); ?>
<input type="checkbox" name="de_inicis_pro_use" value="1" id="de_inicis_pro_use"<?php echo !empty($default['de_inicis_pro_use']) ? ' checked' : ''; ?>> <label for="de_inicis_pro_use">사용</label>
</td>
</tr>
<tr class="pg_info_fld inicis_info_fld">
<th scope="row"><label for="de_inicis_sign_key">KG이니시스 웹결제 사인키</label></th>
<td>
<?php echo help("KG이니시스에서 발급받은 웹결제 사인키를 입력합니다.\n<a href='https://iniweb.inicis.com/' target='_blank'>KG이니시스 가맹점관리자</a> > 상점정보 > 계약정보 > 부가정보의 웹결제 signkey생성 조회 버튼 클릭, 팝업창에서 생성 버튼 클릭 후 해당 값을 입력합니다."); ?>
<?php echo help("KG이니시스에서 발급받은 웹결제 사인키를 입력합니다.\n<a href='https://iniweb.inicis.com/' target='_blank'>KG이니시스 가맹점관리자</a> > 상점정보 > 계약정보 > KEY 정보의 웹결제 signkey생성 조회 버튼 클릭, 팝업창에서 생성 버튼 클릭 후 해당 값을 입력합니다."); ?>
<input type="text" name="de_inicis_sign_key" value="<?php echo get_sanitize_input($default['de_inicis_sign_key']); ?>" id="de_inicis_sign_key" class="frm_input" size="40" maxlength="50">
</td>
</tr>
<tr class="pg_info_fld inicis_info_fld">
<th scope="row"><label for="de_inicis_hash_key">KG이니시스 모바일 금액위변조 Hash Key</label></th>
<td>
<?php echo help("<a href='https://iniweb.inicis.com/' target='_blank'>KG이니시스 가맹점관리자</a> > 상점정보 > 계약정보 > KEY 정보의 모바일 금액위변조 HashKey를 입력합니다."); ?>
<input type="text" name="de_inicis_hash_key" value="<?php echo isset($default['de_inicis_hash_key']) ? get_sanitize_input($default['de_inicis_hash_key']) : ''; ?>" id="de_inicis_hash_key" class="frm_input" size="40" maxlength="255" autocomplete="off">
</td>
</tr>
<tr class="pg_info_fld inicis_info_fld">
<th scope="row"><label for="de_inicis_iniapi_key">KG이니시스 INIAPI KEY</label></th>
<td>
<?php echo help("<a href='https://iniweb.inicis.com/' target='_blank'>KG이니시스 가맹점관리자</a> > 상점정보 > 계약정보 > 부가정보 > INIAPI key 생성 조회 하여 KEY를 여기에 입력합니다.\n이 항목은 영카트 주문에서 kg이니시스 PG 결제 취소, 부분취소, 에스크로 배송등록, 현금영수증 발급에 필요합니다."); ?>
<?php echo help("<a href='https://iniweb.inicis.com/' target='_blank'>KG이니시스 가맹점관리자</a> > 상점정보 > 계약정보 > KEY 정보 > INIAPI key 생성 조회 하여 KEY를 여기에 입력합니다.\n이 항목은 영카트 주문에서 kg이니시스 PG 결제 취소, 부분취소, 에스크로 배송등록, 현금영수증 발급에 필요합니다."); ?>
<input type="text" name="de_inicis_iniapi_key" value="<?php echo get_sanitize_input($default['de_inicis_iniapi_key']); ?>" id="de_inicis_iniapi_key" class="frm_input" size="30" maxlength="30">
</td>
</tr>
<tr class="pg_info_fld inicis_info_fld">
<th scope="row"><label for="de_inicis_iniapi_iv">KG이니시스 INIAPI IV</label></th>
<td>
<?php echo help("<a href='https://iniweb.inicis.com/' target='_blank'>KG이니시스 가맹점관리자</a> > 상점정보 > 계약정보 > 부가정보 > INIAPI IV 생성 조회 하여 KEY를 여기에 입력합니다.\n이 항목은 영카트 주문에서 kg이니시스 현금영수증 발급에 필요합니다."); ?>
<?php echo help("<a href='https://iniweb.inicis.com/' target='_blank'>KG이니시스 가맹점관리자</a> > 상점정보 > 계약정보 > KEY 정보 > INIAPI IV 생성 조회 하여 KEY를 여기에 입력합니다.\n이 항목은 영카트 주문에서 kg이니시스 현금영수증 발급에 필요합니다."); ?>
<input type="text" name="de_inicis_iniapi_iv" value="<?php echo get_sanitize_input($default['de_inicis_iniapi_iv']); ?>" id="de_inicis_iniapi_iv" class="frm_input" size="30" maxlength="30">
</td>
</tr>
<tr class="pg_info_fld inicis_info_fld">
<th scope="row">KG이니시스 PRO 운영 감시</th>
<td>
<?php echo help("결제 이상 알림과 미진행 거래 정리는 서버 작업 스케줄러 없이 사이트 접속 흐름에서 자동 실행됩니다. KG이니시스 INIAPI 거래대사는 관리자 접속 시 함께 실행됩니다.\n관리자 접속이 드물거나 독립 실행이 필요하면 서버 작업 스케줄러에서 5~10분 간격으로 다음 명령을 추가로 실행할 수 있습니다(선택).\nphp ".G5_SHOP_PATH."/inicis/pro/monitor.php --host=".preg_replace('/[^A-Za-z0-9.:-]/', '', isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : 'localhost').((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? ' --https' : '')." --client-ip=".preg_replace('/[^0-9.]/', '', isset($_SERVER['SERVER_ADDR']) ? $_SERVER['SERVER_ADDR'] : '')."\n거래대사는 최근 완료 거래와 확인 필요 거래를 KG이니시스 INIAPI로 조회하며 주문 생성이나 결제 취소를 자동 실행하지 않습니다."); ?>
<input type="checkbox" name="de_inicis_pro_alert_use" value="1" id="de_inicis_pro_alert_use"<?php echo !empty($default['de_inicis_pro_alert_use']) ? ' checked' : ''; ?>> <label for="de_inicis_pro_alert_use">이상 거래 메일 알림</label>
&nbsp;
<input type="checkbox" name="de_inicis_pro_reconcile_use" value="1" id="de_inicis_pro_reconcile_use"<?php echo !empty($default['de_inicis_pro_reconcile_use']) ? ' checked' : ''; ?>> <label for="de_inicis_pro_reconcile_use">최근 완료·확인 필요 거래 자동 대사</label>
<br>최근 감시: <?php echo !empty($default['de_inicis_pro_monitor_at']) ? get_text($default['de_inicis_pro_monitor_at']) : '실행 기록 없음'; ?>
<?php if (!empty($default['de_inicis_pro_monitor_message'])) { ?> / <?php echo get_text($default['de_inicis_pro_monitor_message']); ?><?php } ?>
</td>
</tr>
<tr class="pg_info_fld inicis_info_fld">
<th scope="row"><label for="de_inicis_pro_log_days">PRO 상세 이력 보존기간</label></th>
<td>
<?php echo help("단계별 상세 이력과 기존 이니시스 로그의 결제 응답 payload를 설정 기간 이후 순차 삭제합니다. 결제 요약은 아래의 별도 보존기간을 적용합니다. 0은 자동 정리 안 함이며, 보존하는 경우 30~3650일로 설정하십시오."); ?>
<input type="text" name="de_inicis_pro_log_days" value="<?php echo isset($default['de_inicis_pro_log_days']) ? (int) $default['de_inicis_pro_log_days'] : 365; ?>" id="de_inicis_pro_log_days" class="frm_input" size="6" maxlength="4"> 일
</td>
</tr>
<tr class="pg_info_fld inicis_info_fld">
<th scope="row"><label for="de_inicis_pro_summary_days">PRO 결제 요약 보존기간</label></th>
<td>
<?php echo help("주문이 이미 삭제됐고 확인 또는 환불이 필요하지 않은 최종 결제 요약을 설정 기간 이후 순차 삭제합니다. 실제 주문이 남아 있거나 환불 확인이 필요한 거래는 삭제하지 않습니다. 0은 자동 정리 안 함이며, 보존하는 경우 365~3650일로 설정하십시오."); ?>
<input type="text" name="de_inicis_pro_summary_days" value="<?php echo isset($default['de_inicis_pro_summary_days']) ? (int) $default['de_inicis_pro_summary_days'] : 1825; ?>" id="de_inicis_pro_summary_days" class="frm_input" size="6" maxlength="4"> 일
</td>
</tr>
<tr class="pg_info_fld inicis_info_fld">
<th scope="row">
<label for="de_samsung_pay_use">KG이니시스 삼성페이 사용</label>
<a href="http://sir.kr/main/service/samsungpay.php" target="_blank" class="kg_btn">삼성페이 서비스신청하기</a>
</th>
<td>
<?php echo help("KG이니시스와 별도로 <strong>삼성페이 사용 계약을 하신 경우</strong>에만 체크해주세요. (모바일 주문서 결제수단에 삼성페이가 노출됩니다.) <br >실결제시 반드시 결제대행사 KG이니시스 항목에 상점 아이디와 웹결제 사인키를 입력해 주세요.", 50); ?>
<?php echo help("KG이니시스와 별도로 <strong>삼성페이 사용 계약을 하신 경우</strong>에만 체크해주세요. INIpay PRO 사용 시 PC와 모바일 주문서에 삼성페이가 노출되며 삼성페이 결제창을 직접 호출합니다. 구버전 결제에서는 모바일 주문서에만 노출됩니다.<br>실결제 시 상점 아이디와 사용 중인 결제모듈의 인증키(PRO: HashKey, 구버전: 웹결제 사인키)를 입력해 주세요.", 50); ?>
<input type="checkbox" name="de_samsung_pay_use" value="1" id="de_samsung_pay_use"<?php echo $default['de_samsung_pay_use']?' checked':''; ?>> <label for="de_samsung_pay_use">사용</label>
</td>
</tr>
@@ -915,7 +992,7 @@ if(!$default['de_kakaopay_cancelpwd']){
<label for="de_inicis_lpay_use">KG이니시스 L.pay 사용</label>
</th>
<td>
<?php echo help("체크시 KG이니시스 L.pay를 사용합니다. <br >실결제시 반드시 결제대행사 KG이니시스 항목의 상점 정보( 아이디, 웹결제 사인키 )를 입력해 주세요.", 50); ?>
<?php echo help("체크 시 KG이니시스 L.pay를 사용합니다. INIpay PRO에서는 주문서에서 L.pay 선택 시 L.pay 결제창을 직접 호출합니다.<br>실결제 시 상점 아이디와 사용 중인 결제모듈의 인증키(PRO: HashKey, 구버전: 웹결제 사인키)를 입력해 주세요.", 50); ?>
<input type="checkbox" name="de_inicis_lpay_use" value="1" id="de_inicis_lpay_use"<?php echo $default['de_inicis_lpay_use']?' checked':''; ?>> <label for="de_inicis_lpay_use">사용</label>
</td>
</tr>
@@ -924,7 +1001,7 @@ if(!$default['de_kakaopay_cancelpwd']){
<label for="de_inicis_kakaopay_use">KG이니시스 카카오페이 사용</label>
</th>
<td>
<?php echo help("체크시 KG이니시스 결제의 카카오페이를 사용합니다. 주문서 결제수단에 카카오페이가 노출됩니다. <br>실결제시 반드시 결제대행사 KG이니시스 항목의 상점 정보( 아이디, 웹결제 사인키 )를 입력해 주세요.", 50); ?>
<?php echo help("체크 시 KG이니시스 결제의 카카오페이를 사용합니다. INIpay PRO에서는 주문서에서 카카오페이 선택 시 카카오페이 결제창을 직접 호출합니다.<br>실결제 시 상점 아이디와 사용 중인 결제모듈의 인증키(PRO: HashKey, 구버전: 웹결제 사인키)를 입력해 주세요.", 50); ?>
<input type="checkbox" name="de_inicis_kakaopay_use" value="1" id="de_inicis_kakaopay_use"<?php echo $default['de_inicis_kakaopay_use']?' checked':''; ?>> <label for="de_inicis_kakaopay_use">사용</label>
</td>
</tr>
@@ -933,7 +1010,7 @@ if(!$default['de_kakaopay_cancelpwd']){
<label for="de_inicis_cartpoint_use">KG이니시스 신용카드 포인트 결제</label>
</th>
<td>
<?php echo help("신용카드 포인트 결제에 대해 이니시스와 계약을 맺은 상점에서만 적용하는 옵션입니다.<br>체크시 pc 결제에서는 신용카드 포인트 사용 여부에 대한 팝업창에 사용 버튼과 사용안함 버튼이 표기되어 결제하는 고객의 선택여부에 따라 신용카드 포인트 결제가 가능합니다.<br >모바일에서는 신용카드 포인트 사용이 가능합니다.", 50); ?>
<?php echo help("신용카드 포인트 결제에 대해 이니시스와 계약을 맺은 상점에서만 적용하는 구버전 결제 옵션입니다.<br>체크 시 PC 결제에서는 신용카드 포인트 사용 여부를 선택할 수 있고 모바일에서도 카드 포인트를 사용할 수 있습니다.<br>INIpay PRO에는 이 설정을 전달하지 않습니다. PRO 카드 포인트 사용은 KG이니시스에서 해당 MID의 지원 여부와 요청 규격을 확인한 후 적용해야 합니다.", 50); ?>
<input type="checkbox" name="de_inicis_cartpoint_use" value="1" id="de_inicis_cartpoint_use"<?php echo $default['de_inicis_cartpoint_use']?' checked':''; ?>> <label for="de_inicis_cartpoint_use">사용</label>
</td>
</tr>
@@ -1789,6 +1866,26 @@ function byte_check(el_cont, el_byte)
</form>
<script>
function inicis_pro_retention_check(id, min, label)
{
var el = document.getElementById(id);
if (!el) return true;
var raw = el.value.replace(/^\s+|\s+$/g, "");
if (raw === "") return true;
if (!/^[0-9]+$/.test(raw)) {
alert("INIpay PRO " + label + " 보존기간은 숫자로 입력해 주십시오.");
el.focus();
return false;
}
var days = parseInt(raw, 10);
if (days !== 0 && (days < min || days > 3650)) {
alert("INIpay PRO " + label + " 보존기간은 0 또는 " + min + "~3650일로 설정해 주십시오.");
el.focus();
return false;
}
return true;
}
function fconfig_check(f)
{
<?php echo get_editor_js('de_baesong_content'); ?>
@@ -1798,6 +1895,29 @@ function fconfig_check(f)
var msg = "",
pg_msg = "";
if (!inicis_pro_retention_check("de_inicis_pro_log_days", 30, "상세 이력")) return false;
if (!inicis_pro_retention_check("de_inicis_pro_summary_days", 365, "결제 요약")) return false;
if (f.de_pg_service.value == "inicis") {
var pro_use_el = document.getElementById("de_inicis_pro_use");
var inicis_test = parseInt(f.de_card_test.value, 10) > 0;
if (pro_use_el && pro_use_el.checked && !inicis_test) {
var hash_el = document.getElementById("de_inicis_hash_key");
if (hash_el && hash_el.value.replace(/[^A-Za-z0-9+\/=_-]/g, "") === "") {
alert("INIpay PRO를 사용하려면 HashKey를 입력해 주십시오.");
hash_el.focus();
return false;
}
var reconcile_el = document.getElementById("de_inicis_pro_reconcile_use");
var iniapi_el = document.getElementById("de_inicis_iniapi_key");
if (reconcile_el && reconcile_el.checked && iniapi_el && iniapi_el.value.replace(/^\s+|\s+$/g, "") === "") {
alert("INIpay PRO 자동 거래대사를 사용하려면 INIAPI KEY를 입력해 주십시오.");
iniapi_el.focus();
return false;
}
}
}
if( f.de_pg_service.value == "kcp" ){
if( f.de_kcp_mid.value && f.de_kcp_site_key.value && parseInt(f.de_card_test.value) > 0 ){
pg_msg = "NHN KCP";
+38 -3
View File
@@ -167,6 +167,12 @@ $check_sanitize_keys = array(
'de_inicis_iniapi_key', //KG이니시스 INIAPI KEY
'de_inicis_iniapi_iv', //KG이니시스 INIAPI IV
'de_inicis_sign_key', //KG이니시스 웹결제 사인키
'de_inicis_pro_use', //KG이니시스 INIpay PRO 사용
'de_inicis_hash_key', //KG이니시스 INIpay PRO HashKey
'de_inicis_pro_alert_use', //KG이니시스 INIpay PRO 이상 거래 알림
'de_inicis_pro_reconcile_use', //KG이니시스 INIpay PRO 자동 거래대사
'de_inicis_pro_log_days', //KG이니시스 INIpay PRO 상세 이력 보존기간
'de_inicis_pro_summary_days', //KG이니시스 INIpay PRO 결제 요약 보존기간
'de_samsung_pay_use', //KG이니시스 삼성페이 사용
'de_inicis_lpay_use', //KG이니시스 Lpay 사용
'de_inicis_kakaopay_use', //KG이니시스 카카오페이 사용
@@ -247,12 +253,35 @@ $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)) : '';
}
}
$de_inicis_pro_use = !empty($de_inicis_pro_use) ? 1 : 0;
$de_inicis_hash_key = preg_replace('/[^A-Za-z0-9+\/=_-]/', '', $de_inicis_hash_key);
$de_inicis_pro_alert_use = !empty($de_inicis_pro_alert_use) ? 1 : 0;
$de_inicis_pro_reconcile_use = !empty($de_inicis_pro_reconcile_use) ? 1 : 0;
$de_inicis_pro_log_days = (int) $de_inicis_pro_log_days;
if ($de_inicis_pro_log_days !== 0 && ($de_inicis_pro_log_days < 30 || $de_inicis_pro_log_days > 3650))
alert('INIpay PRO 상세 이력 보존기간은 0 또는 30~3650일로 설정해 주십시오.');
$de_inicis_pro_summary_days = (int) $de_inicis_pro_summary_days;
if ($de_inicis_pro_summary_days !== 0 && ($de_inicis_pro_summary_days < 365 || $de_inicis_pro_summary_days > 3650))
alert('INIpay PRO 결제 요약 보존기간은 0 또는 365~3650일로 설정해 주십시오.');
if ($de_pg_service === 'inicis' && $de_inicis_pro_use) {
if (empty($de_card_test) && $de_inicis_hash_key === '')
alert('INIpay PRO를 사용하려면 HashKey를 입력해 주십시오.');
if (!function_exists('curl_init'))
alert('INIpay PRO를 사용하려면 PHP cURL 모듈이 필요합니다.');
if (!function_exists('hash') || !in_array('sha512', hash_algos()))
alert('INIpay PRO를 사용하려면 SHA-512 해시 지원이 필요합니다.');
if ($de_inicis_pro_reconcile_use && empty($de_card_test) && trim($de_inicis_iniapi_key) === '')
alert('INIpay PRO 자동 거래대사를 사용하려면 INIAPI KEY를 입력해 주십시오.');
}
$warning_msg = '';
// kcp 전자결제를 사용할 때 site key 입력체크
@@ -411,6 +440,12 @@ $sql = " update {$g5['g5_shop_default_table']}
de_inicis_iniapi_key = '{$de_inicis_iniapi_key}',
de_inicis_iniapi_iv = '{$de_inicis_iniapi_iv}',
de_inicis_sign_key = '{$de_inicis_sign_key}',
de_inicis_pro_use = '{$de_inicis_pro_use}',
de_inicis_hash_key = '{$de_inicis_hash_key}',
de_inicis_pro_alert_use = '{$de_inicis_pro_alert_use}',
de_inicis_pro_reconcile_use = '{$de_inicis_pro_reconcile_use}',
de_inicis_pro_log_days = '{$de_inicis_pro_log_days}',
de_inicis_pro_summary_days = '{$de_inicis_pro_summary_days}',
de_iche_use = '{$de_iche_use}',
de_sms_cont1 = '{$_POST['de_sms_cont1']}',
de_sms_cont2 = '{$_POST['de_sms_cont2']}',
@@ -480,4 +515,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');
+1 -1
View File
@@ -4,6 +4,7 @@ include_once('./_common.php');
$cz_id = isset($_REQUEST['cz_id']) ? (int) $_REQUEST['cz_id'] : 0;
$cp = array(
'cz_id'=>'',
'cp_method'=>'',
'cz_subject'=>'',
'cp_target'=>'',
@@ -13,7 +14,6 @@ $cp = array(
'mb_id'=>'',
'cz_type'=>'',
'cz_point'=>'',
'cp_price'=>'',
'cz_file'=>'',
'cp_minimum'=>'',
'cp_maximum'=>'',
+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
+425
View File
@@ -0,0 +1,425 @@
<?php
if (!defined('_GNUBOARD_')) exit;
if (!function_exists('inicis_admin_status_label')) {
function inicis_admin_status_label($status)
{
$labels = array(
'request_ready' => '결제창 요청 준비',
'request_expired' => '결제창 종료·미진행',
'authentication_received' => '인증결과 수신',
'authentication_failed' => '인증 실패',
'validation_failed' => '주문 검증 실패',
'approval_started' => '승인 요청 중',
'communication_failed' => '승인 통신 실패',
'approval_failed' => '승인 실패',
'approved' => '승인 성공',
'order_saving' => '주문 저장 중',
'order_saved' => '주문 저장 완료',
'notification_received' => '서버 통보 수신',
'notification_failed' => '서버 통보 검증 실패',
'notification_acknowledged' => '처리 완료 통보 확인',
'vbank_issued' => '가상계좌 발급',
'paid' => '입금 통보 처리 완료',
'paid_after_cancel' => '취소 후 입금·환불 필요',
'refund_required' => '환불 필요',
'refund_completed' => '환불 확인 완료',
'cancel_requested' => '취소 요청 중',
'canceled' => '취소 완료',
'cancel_failed' => '취소 확인 필요',
'partial_canceled' => '부분취소 완료',
'partial_cancel_failed' => '부분취소 확인 필요',
'inquiry_success' => 'KG 거래조회 완료',
'inquiry_failed' => 'KG 거래조회 실패',
'approval_reference_recovered' => '승인 TID 복구'
);
return isset($labels[$status]) ? $labels[$status] : $status;
}
}
if (!function_exists('inicis_admin_pay_type_label')) {
function inicis_admin_pay_type_label($pay_type, $easy_pay)
{
$easy_labels = array(
'SAMSUNGPAY' => '삼성페이',
'LPAY' => 'L.pay',
'KAKAOPAY' => '카카오페이',
'EASYPAY' => '간편결제'
);
$easy_pay = strtoupper((string) $easy_pay);
if (isset($easy_labels[$easy_pay]))
return $easy_labels[$easy_pay].' (CARD)';
$pay_labels = array('CARD' => '신용카드', 'BANK' => '계좌이체', 'VBANK' => '가상계좌', 'HPP' => '휴대폰');
$pay_type = strtoupper((string) $pay_type);
return isset($pay_labels[$pay_type]) ? $pay_labels[$pay_type] : $pay_type;
}
}
if (!function_exists('inicis_admin_stage_label')) {
function inicis_admin_stage_label($stage)
{
$labels = array(
'request' => '결제 요청',
'authentication' => '결제 인증',
'validation' => '주문 검증',
'approval' => '결제 승인',
'order' => '주문 저장',
'notification' => '서버 통보',
'cancel' => '결제 취소',
'reconcile' => 'KG 거래대사'
);
return isset($labels[$stage]) ? $labels[$stage] : $stage;
}
}
if (!function_exists('inicis_admin_pg_status_label')) {
function inicis_admin_pg_status_label($status)
{
$status = strtoupper((string) $status);
$labels = array(
'0' => '승인',
'1' => '취소',
'9' => '거래 없음',
'N' => '가상계좌 입금대기',
'Y' => '가상계좌 입금완료',
'C' => '가상계좌 입금 전 취소',
'APPROVAL' => '승인',
'CANCEL' => '전체취소',
'PART_CANCEL' => '부분취소',
'DEPOSIT_COMPLETED' => '가상계좌 입금완료',
'NON_DEPOSIT' => '가상계좌 입금대기',
'DEPOSIT_CANCELED' => '가상계좌 입금취소',
'WAITING_FOR_REFUND' => '가상계좌 환불대기',
'REFUND_COMPLETED' => '가상계좌 환불완료'
);
return isset($labels[$status]) ? $labels[$status] : $status;
}
}
if (!function_exists('inicis_admin_source_label')) {
function inicis_admin_source_label($source)
{
$labels = array(
'web' => 'PC 브라우저',
'mobile' => '모바일 브라우저',
'server' => '이니시스 통보',
'system' => '시스템',
'admin' => '관리자'
);
return isset($labels[$source]) ? $labels[$source] : $source;
}
}
if (!function_exists('inicis_admin_primary_status')) {
function inicis_admin_primary_status($row)
{
if (!empty($row['ip_refund_required']))
return 'refund_required';
if (!empty($row['ip_noti_status']) && $row['ip_noti_status'] === 'notification_failed')
return 'notification_failed';
if (!empty($row['ip_cancel_status']) && in_array($row['ip_cancel_status'], array('cancel_failed', 'partial_cancel_failed')))
return $row['ip_cancel_status'];
if (!empty($row['ip_cancel_status']) && $row['ip_cancel_status'] === 'cancel_requested')
return 'cancel_requested';
if (!empty($row['ip_noti_status']) && $row['ip_noti_status'] === 'notification_received')
return 'notification_received';
// 서버 통보가 이후 정상 확인·처리 상태로 넘어갔는데도 이전 통보 검증 실패가
// 원본 상태에 남아 있으면, 최신 통보 상태를 대표 상태로 사용한다.
if (isset($row['ip_status']) && $row['ip_status'] === 'notification_failed'
&& !empty($row['ip_noti_status']) && $row['ip_noti_status'] !== 'notification_failed')
return $row['ip_noti_status'];
return isset($row['ip_status']) ? $row['ip_status'] : '';
}
}
if (!function_exists('inicis_admin_has_order')) {
function inicis_admin_has_order($row)
{
if (isset($row['ip_order_type']) && $row['ip_order_type'] === 'personal')
return !empty($row['personal_oid']);
return !empty($row['order_oid']);
}
}
if (!function_exists('inicis_admin_order_tid')) {
function inicis_admin_order_tid($row)
{
if (isset($row['ip_order_type']) && $row['ip_order_type'] === 'personal')
return isset($row['personal_tid']) ? $row['personal_tid'] : '';
return isset($row['order_tid']) ? $row['order_tid'] : '';
}
}
if (!function_exists('inicis_admin_order_amount')) {
function inicis_admin_order_amount($row)
{
if (isset($row['ip_order_type']) && $row['ip_order_type'] === 'personal')
return isset($row['personal_amount']) ? (int) $row['personal_amount'] : 0;
return isset($row['order_amount']) ? (int) $row['order_amount'] : 0;
}
}
if (!function_exists('inicis_admin_is_anomaly')) {
function inicis_admin_is_anomaly($row)
{
if (!empty($row['ip_audit_error']))
return true;
$status = isset($row['ip_status']) ? $row['ip_status'] : '';
$noti_status = isset($row['ip_noti_status']) ? $row['ip_noti_status'] : '';
$cancel_status = isset($row['ip_cancel_status']) ? $row['ip_cancel_status'] : '';
if (!empty($row['ip_refund_required']) || in_array($status, array('paid_after_cancel', 'refund_required')))
return true;
if ($noti_status === 'notification_failed')
return true;
if (in_array($cancel_status, array('cancel_failed', 'partial_cancel_failed')))
return true;
if ($status === 'partial_cancel_failed')
return true;
$has_order = inicis_admin_has_order($row);
$saved_tid = $has_order ? inicis_admin_order_tid($row) : '';
$amount_mismatch = $has_order && (int) $row['ip_amount'] > 0
&& inicis_admin_order_amount($row) !== (int) $row['ip_amount'];
$tid_mismatch = $has_order && !empty($row['ip_tid']) && $saved_tid !== $row['ip_tid'];
$mismatch = $amount_mismatch || $tid_mismatch;
$is_personal = isset($row['ip_order_type']) && $row['ip_order_type'] === 'personal';
$order_canceled = $has_order && !$is_personal
&& isset($row['order_status']) && $row['order_status'] === '취소';
$order_receipt = $is_personal
? (isset($row['personal_receipt_price']) ? (int) $row['personal_receipt_price'] : 0)
: (isset($row['order_receipt_price']) ? (int) $row['order_receipt_price'] : 0);
$order_misu = !$is_personal && isset($row['order_misu']) ? (int) $row['order_misu'] : 0;
$vbank_paid = isset($row['ip_pay_type']) && $row['ip_pay_type'] === 'VBANK'
&& ($status === 'paid' || in_array($noti_status, array('paid', 'paid_after_cancel')));
if ($status !== 'refund_completed' && $vbank_paid
&& ($order_canceled || !$has_order || $order_receipt !== (int) $row['ip_amount'] || $order_misu !== 0))
return true;
if (isset($row['ip_pay_type']) && $row['ip_pay_type'] === 'VBANK'
&& ($status === 'vbank_issued' || $noti_status === 'vbank_issued') && $order_canceled
&& $status !== 'canceled' && $cancel_status !== 'canceled')
return true;
$local_order_active = false;
if ($has_order) {
if (isset($row['ip_order_type']) && $row['ip_order_type'] === 'personal')
$local_order_active = isset($row['personal_receipt_price']) && (int) $row['personal_receipt_price'] > 0;
else
$local_order_active = isset($row['order_status']) && $row['order_status'] !== '취소';
}
$pg_status = !empty($row['ip_pg_result_code']) && $row['ip_pg_result_code'] === '00'
? strtoupper((string) $row['ip_pg_status']) : '';
$pg_mismatch = $pg_status !== ''
&& ((!empty($row['ip_pg_tid']) && !empty($row['ip_tid']) && $row['ip_pg_tid'] !== $row['ip_tid'])
|| ((int) $row['ip_pg_amount'] > 0 && (int) $row['ip_amount'] > 0 && (int) $row['ip_pg_amount'] !== (int) $row['ip_amount']));
$pg_paid = in_array($pg_status, array('0', 'Y', 'APPROVAL', 'PART_CANCEL', 'DEPOSIT_COMPLETED'));
$pg_pending = in_array($pg_status, array('N', 'NON_DEPOSIT'));
$pg_attention = $pg_status === 'WAITING_FOR_REFUND';
$pg_canceled = in_array($pg_status, array('1', '9', 'C', 'CANCEL', 'DEPOSIT_CANCELED', 'REFUND_COMPLETED'));
if ($pg_attention)
return true;
// 부분취소 합계로 전액 환불된 주문이 취소 상태이면 PG의 부분취소 표시와 일치하는 종결 상태로 본다.
$part_cancel_settled = $pg_status === 'PART_CANCEL' && !$local_order_active && !$is_personal
&& isset($row['order_refund_price'], $row['order_receipt_price'])
&& (int) $row['order_receipt_price'] > 0
&& (int) $row['order_refund_price'] >= (int) $row['order_receipt_price'];
if ($pg_paid)
return $pg_mismatch || (!$part_cancel_settled && (!$local_order_active || $mismatch));
$updated = isset($row['ip_updated_at']) ? strtotime($row['ip_updated_at']) : false;
if ($pg_pending)
return $pg_mismatch || $status === 'canceled' || $status === 'cancel_failed' || $mismatch
|| (!$has_order && $updated !== false && $updated < G5_SERVER_TIME - 180);
if ($pg_canceled)
return $pg_mismatch || $local_order_active;
if (in_array($status, array('authentication_received', 'approval_started', 'cancel_requested'))
|| $noti_status === 'notification_received' || $cancel_status === 'cancel_requested')
return $updated !== false && $updated < G5_SERVER_TIME - 180;
if ($status === 'communication_failed')
return true;
if ($status === 'validation_failed' && !empty($row['ip_tid']))
return true;
if ($status === 'cancel_failed' || $cancel_status === 'cancel_failed')
return true;
if ($status === 'canceled') {
return $local_order_active;
}
if ($status === 'notification_received')
return $updated !== false && $updated < G5_SERVER_TIME - 180;
if ($has_order)
return $mismatch;
$approved_states = array('approved', 'order_saving', 'order_saved', 'notification_received', 'vbank_issued', 'paid');
if (!in_array($status, $approved_states))
return false;
return $updated !== false && $updated < G5_SERVER_TIME - 180;
}
}
if (!function_exists('inicis_admin_anomaly_sql')) {
function inicis_admin_anomaly_sql()
{
$order_amount = "(o.od_cart_price + o.od_send_cost + o.od_send_cost2 - o.od_cart_coupon - o.od_coupon - o.od_send_coupon - o.od_receipt_point)";
$has_order = "((p.ip_order_type = 'personal' and pp.pp_id is not null) or (p.ip_order_type <> 'personal' and o.od_id is not null))";
$saved_tid = "if(p.ip_order_type = 'personal', ifnull(pp.pp_tno, ''), ifnull(o.od_tno, ''))";
$saved_amount = "if(p.ip_order_type = 'personal', ifnull(pp.pp_price, 0), ifnull($order_amount, 0))";
$mismatch = "($has_order and ((p.ip_tid <> '' and p.ip_tid <> $saved_tid) or (p.ip_amount > 0 and p.ip_amount <> $saved_amount)))";
$local_active = "((p.ip_order_type = 'personal' and pp.pp_id is not null and pp.pp_receipt_price > 0) or (p.ip_order_type <> 'personal' and o.od_id is not null and o.od_status <> '취소'))";
$local_canceled = "(p.ip_order_type <> 'personal' and o.od_id is not null and o.od_status = '취소')";
$vbank_paid_mismatch = "(p.ip_status <> 'refund_completed' and p.ip_pay_type = 'VBANK'
and (p.ip_status = 'paid' or p.ip_noti_status in ('paid','paid_after_cancel'))
and ((p.ip_order_type = 'personal' and (pp.pp_id is null or pp.pp_receipt_price <> p.ip_amount))
or (p.ip_order_type <> 'personal' and (o.od_id is null or o.od_status = '취소' or o.od_receipt_price <> p.ip_amount or o.od_misu <> 0))))";
$vbank_canceled_before_payment = "(p.ip_pay_type = 'VBANK' and (p.ip_status = 'vbank_issued' or p.ip_noti_status = 'vbank_issued')
and p.ip_status <> 'canceled' and p.ip_cancel_status <> 'canceled' and $local_canceled)";
$stale = "p.ip_updated_at < date_sub(now(), interval 3 minute)";
$pg_paid = "(p.ip_pg_result_code = '00' and p.ip_pg_status in ('0','Y','APPROVAL','PART_CANCEL','DEPOSIT_COMPLETED'))";
$pg_pending = "(p.ip_pg_result_code = '00' and p.ip_pg_status in ('N','NON_DEPOSIT'))";
$pg_attention = "(p.ip_pg_result_code = '00' and p.ip_pg_status = 'WAITING_FOR_REFUND')";
$pg_canceled = "(p.ip_pg_result_code = '00' and p.ip_pg_status in ('1','9','C','CANCEL','DEPOSIT_CANCELED','REFUND_COMPLETED'))";
$pg_known = "($pg_paid or $pg_pending or $pg_attention or $pg_canceled)";
$part_cancel_settled = "(p.ip_pg_result_code = '00' and p.ip_pg_status = 'PART_CANCEL'
and $local_canceled and o.od_receipt_price > 0 and o.od_refund_price >= o.od_receipt_price)";
$pg_mismatch = "(p.ip_pg_result_code = '00' and ((p.ip_pg_tid <> '' and p.ip_tid <> '' and p.ip_pg_tid <> p.ip_tid) or (p.ip_pg_amount > 0 and p.ip_amount > 0 and p.ip_pg_amount <> p.ip_amount)))";
$approved_states = "'approved','order_saving','order_saved','notification_received','vbank_issued','paid'";
$local_anomaly = "(p.ip_status = 'cancel_failed'
or p.ip_status = 'communication_failed'
or (p.ip_status = 'validation_failed' and p.ip_tid <> '')
or (p.ip_status in ('authentication_received','approval_started','cancel_requested') and $stale)
or (p.ip_noti_status = 'notification_received' and $stale)
or (p.ip_cancel_status = 'cancel_requested' and $stale)
or (p.ip_status = 'canceled' and $local_active)
or (p.ip_status = 'notification_received' and $stale)
or $mismatch
or (not $has_order and p.ip_status in ($approved_states) and $stale))";
return "(p.ip_audit_error = '1'
or p.ip_refund_required = '1'
or p.ip_status in ('paid_after_cancel','refund_required')
or p.ip_noti_status = 'notification_failed'
or p.ip_cancel_status in ('cancel_failed','partial_cancel_failed')
or p.ip_status = 'partial_cancel_failed'
or $vbank_paid_mismatch
or $vbank_canceled_before_payment
or $pg_mismatch
or $pg_attention
or ($pg_paid and not $part_cancel_settled and (not $local_active or $mismatch))
or ($pg_pending and (p.ip_status in ('canceled','cancel_failed') or $mismatch or (not $has_order and $stale)))
or ($pg_canceled and $local_active)
or (not $pg_known and $local_anomaly))";
}
}
if (!function_exists('inicis_admin_alert_key')) {
function inicis_admin_alert_key($row)
{
return md5(
(isset($row['ip_status']) ? $row['ip_status'] : '').'|'.
(isset($row['ip_tid']) ? $row['ip_tid'] : '').'|'.
(isset($row['ip_amount']) ? $row['ip_amount'] : '').'|'.
(isset($row['ip_pg_result_code']) ? $row['ip_pg_result_code'] : '').'|'.
(isset($row['ip_pg_status']) ? $row['ip_pg_status'] : '').'|'.
(isset($row['ip_pg_tid']) ? $row['ip_pg_tid'] : '').'|'.
(isset($row['ip_pg_amount']) ? $row['ip_pg_amount'] : '').'|'.
(isset($row['ip_noti_status']) ? $row['ip_noti_status'] : '').'|'.
(isset($row['ip_noti_code']) ? $row['ip_noti_code'] : '').'|'.
(isset($row['ip_cancel_status']) ? $row['ip_cancel_status'] : '').'|'.
(!empty($row['ip_refund_required']) ? '1' : '0').'|'.
(inicis_admin_has_order($row) ? '1' : '0').'|'.
inicis_admin_order_tid($row).'|'.inicis_admin_order_amount($row).'|'.
(isset($row['order_status']) ? $row['order_status'] : '').'|'.
(isset($row['order_receipt_price']) ? $row['order_receipt_price'] : '').'|'.
(isset($row['order_misu']) ? $row['order_misu'] : '').'|'.
(isset($row['personal_receipt_price']) ? $row['personal_receipt_price'] : '').'|'.
(!empty($row['ip_audit_error']) ? '1' : '0')
);
}
}
if (!function_exists('inicis_admin_recommendation')) {
function inicis_admin_recommendation($row)
{
if (!empty($row['ip_audit_error']))
return '감사 상세 이력 기록이 일부 누락됐습니다. 서버 오류 로그를 확인하고 KG이니시스 상점관리자 거래내역을 기준으로 상태를 확정하십시오.';
if (!empty($row['ip_refund_required']) || in_array($row['ip_status'], array('paid_after_cancel', 'refund_required')))
return '취소된 주문에 가상계좌 입금이 확인됐습니다. 상품을 발송하지 말고 KG이니시스 상점관리자에서 입금 TID를 확인한 뒤 고객 환불을 처리하고 KG 거래조회를 다시 실행하십시오.';
if (!empty($row['ip_noti_status']) && $row['ip_noti_status'] === 'notification_failed')
return '최근 KG 서버 통보를 검증하거나 저장하지 못했습니다. 통보 실패 코드와 서버 오류 로그를 확인하고 상점관리자에서 입금통보 결과를 재전송하십시오.';
if (!empty($row['ip_cancel_status']) && $row['ip_cancel_status'] === 'cancel_failed')
return 'PG 전체취소 결과를 확정하지 못했습니다. 영카트 주문상태를 변경하지 말고 KG이니시스 상점관리자의 원거래를 직접 확인하십시오.';
if (!empty($row['ip_cancel_status']) && $row['ip_cancel_status'] === 'partial_cancel_failed')
return '부분취소 결과를 확정하지 못했습니다. KG이니시스 상점관리자의 원거래와 부분취소 거래내역을 직접 대조하십시오.';
if (!empty($row['ip_noti_status']) && $row['ip_noti_status'] === 'notification_received')
return '가상계좌 입금 통보 수신 후 주문 반영 완료 기록이 없습니다. 주문 입금액과 미수금을 확인하고, 불일치하면 KG이니시스 상점관리자에서 입금 통보를 재전송하십시오.';
if (!empty($row['ip_cancel_status']) && $row['ip_cancel_status'] === 'cancel_requested')
return 'PG 취소 요청 후 결과가 확정되지 않았습니다. 영카트 주문을 추가로 변경하지 말고 KG이니시스 상점관리자에서 원거래 취소 여부를 먼저 확인하십시오.';
if (!empty($row['ip_pg_checked_at']) && $row['ip_pg_result_code'] !== '00')
return 'KG 거래조회가 실패했습니다. 해당 MID의 거래조회 계약, INIAPI KEY와 서버 IPv4를 확인한 후 다시 조회하거나 KG이니시스 상점관리자에서 직접 조회하십시오.';
$has_order = inicis_admin_has_order($row);
$pg_status = !empty($row['ip_pg_result_code']) && $row['ip_pg_result_code'] === '00' ? strtoupper((string) $row['ip_pg_status']) : '';
$pg_paid = in_array($pg_status, array('0', 'Y', 'APPROVAL', 'PART_CANCEL', 'DEPOSIT_COMPLETED'));
$pg_pending = in_array($pg_status, array('N', 'NON_DEPOSIT'));
$pg_attention = $pg_status === 'WAITING_FOR_REFUND';
$pg_canceled = in_array($pg_status, array('1', '9', 'C', 'CANCEL', 'DEPOSIT_CANCELED', 'REFUND_COMPLETED'));
if ($pg_status !== '' && ((!empty($row['ip_pg_tid']) && !empty($row['ip_tid']) && $row['ip_pg_tid'] !== $row['ip_tid'])
|| ((int) $row['ip_pg_amount'] > 0 && (int) $row['ip_amount'] > 0 && (int) $row['ip_pg_amount'] !== (int) $row['ip_amount'])))
return 'KG 거래조회 결과와 영카트 결제 이력의 TID 또는 금액이 다릅니다. 자동 조치하지 말고 KG이니시스 상점관리자 원거래 내역을 직접 확인하십시오.';
if ($pg_attention)
return '가상계좌 입금 후 환불 대기 상태입니다. 환불이 완료될 때까지 KG이니시스 상점관리자에서 상태를 계속 확인하십시오.';
if ($pg_paid && !$has_order)
return 'KG이니시스에는 승인 또는 입금이 있으나 영카트 주문이 없습니다. 원 주문 데이터와 재고·포인트 반영 여부를 확인한 뒤 안전한 복원이 불가능하면 상점관리자에서 승인 취소하십시오.';
if ($pg_pending && !$has_order)
return '가상계좌가 발급됐지만 영카트 주문이 없습니다. 고객 입금 전에 주문 복원 가능 여부를 확인하고, 복원이 불가능하면 해당 가상계좌 거래를 정리하십시오.';
$recommend_is_personal = isset($row['ip_order_type']) && $row['ip_order_type'] === 'personal';
$order_canceled_match = $has_order && ($recommend_is_personal
? !(isset($row['personal_receipt_price']) && (int) $row['personal_receipt_price'] > 0)
: (isset($row['order_status']) && $row['order_status'] === '취소'));
if ($pg_canceled && $order_canceled_match)
return 'KG이니시스 거래와 영카트 주문이 모두 취소 상태로 일치합니다. 별도 조치가 필요하지 않습니다.';
if ($pg_canceled && $has_order)
return 'KG이니시스 거래는 취소 또는 거래 없음 상태입니다. 영카트 주문의 결제금액·상태를 확인하고 PG 상태와 일치하도록 관리자 처리하십시오.';
if ($pg_status === 'PART_CANCEL' && $order_canceled_match && !$recommend_is_personal
&& isset($row['order_refund_price'], $row['order_receipt_price'])
&& (int) $row['order_receipt_price'] > 0
&& (int) $row['order_refund_price'] >= (int) $row['order_receipt_price'])
return 'KG이니시스 거래가 부분취소 합계로 전액 환불되었고 영카트 주문도 취소 상태입니다. 별도 조치가 필요하지 않습니다.';
if (isset($row['ip_status']) && in_array($row['ip_status'], array('authentication_received', 'approval_started', 'communication_failed')) && empty($row['ip_tid']))
return '최종 승인 TID가 영카트에 저장되기 전에 처리가 중단됐을 수 있습니다. 같은 주문을 다시 결제시키기 전에 KG이니시스 상점관리자에서 주문번호 OID로 승인 여부를 확인하십시오.';
if (isset($row['ip_status']) && $row['ip_status'] === 'validation_failed' && !empty($row['ip_tid']))
return '승인 TID가 생성된 뒤 주문 검증이 중단됐습니다. KG 거래조회 결과를 확인하고 주문이 없다면 승인 취소 여부를 결정하십시오.';
if ($has_order && ((!empty($row['ip_tid']) && inicis_admin_order_tid($row) !== $row['ip_tid'])
|| ((int) $row['ip_amount'] > 0 && inicis_admin_order_amount($row) !== (int) $row['ip_amount'])))
return '결제 이력과 주문 DB의 TID 또는 금액이 다릅니다. 주문 상태를 변경하기 전에 KG이니시스 원거래 TID와 승인금액을 직접 대조하십시오.';
if (isset($row['ip_status']) && $row['ip_status'] === 'cancel_failed')
return '자동 취소 결과를 확정하지 못했습니다. KG 거래조회를 다시 실행하고 승인 상태라면 상점관리자에서 취소 여부를 결정하십시오.';
if (isset($row['ip_status']) && $row['ip_status'] === 'partial_cancel_failed')
return '부분취소 결과를 확정하지 못했습니다. KG이니시스 상점관리자의 원거래와 부분취소 거래내역을 직접 대조하십시오.';
return inicis_admin_is_anomaly($row)
? 'KG이니시스 상점관리자에서 승인 TID와 금액을 확인한 뒤 영카트 주문 상태와 맞추십시오.'
: '현재 별도 조치가 필요하지 않습니다. KG 거래상태와 영카트 주문의 TID 및 금액이 일치합니다.';
}
}
+77
View File
@@ -0,0 +1,77 @@
<?php
$sub_menu = '400420';
include_once('./_common.php');
check_demo();
auth_check_menu($auth, $sub_menu, 'w');
check_admin_token();
include_once(G5_SHOP_PATH.'/inicis/pro/inicis_pro.lib.php');
include_once('./inicislog.lib.php');
if (!inicis_pro_audit_schema_ready())
alert('결제 현황 DB 업그레이드를 먼저 실행해 주십시오.', G5_ADMIN_URL.'/dbupgrade.php');
if (inicis_pro_get_iniapi_key() === '')
alert('KG이니시스 INIAPI KEY를 먼저 설정해 주십시오.', './configform.php');
$tables = inicis_pro_audit_tables();
$mode = isset($_POST['mode']) && !is_array($_POST['mode']) ? $_POST['mode'] : '';
$targets = array();
if ($mode === 'batch') {
$order_amount_sql = "(o.od_cart_price + o.od_send_cost + o.od_send_cost2 - o.od_cart_coupon - o.od_coupon - o.od_send_coupon - o.od_receipt_point)";
$anomaly_sql = inicis_admin_anomaly_sql();
$result = sql_query(" select p.*,
o.od_id as order_oid, o.od_tno as order_tid, o.od_status as order_status,
o.od_receipt_price as order_receipt_price, o.od_misu as order_misu, o.od_cancel_price as order_cancel_price,
o.od_refund_price as order_refund_price, o.od_settle_case as order_settle_case, $order_amount_sql as order_amount,
pp.pp_id as personal_oid, pp.pp_tno as personal_tid, pp.pp_price as personal_amount, pp.pp_receipt_price as personal_receipt_price
from `{$tables['summary']}` p
left join {$g5['g5_shop_order_table']} o on p.ip_order_type <> 'personal' and o.od_id = p.ip_oid
left join {$g5['g5_shop_personalpay_table']} pp on p.ip_order_type = 'personal' and pp.pp_id = p.ip_oid
left join {$g5['g5_shop_inicis_log_table']} il on il.oid = p.ip_oid
where (p.ip_tid <> '' or (il.P_TID <> '' and il.P_STATUS = '00'))
and $anomaly_sql
order by p.ip_updated_at asc
limit 5 ");
while ($row = sql_fetch_array($result))
$targets[] = $row;
} else {
$oid_raw = isset($_POST['oid']) && !is_array($_POST['oid']) ? trim($_POST['oid']) : '';
$oid = inicis_pro_clean_oid($oid_raw);
if ($oid === '' || $oid !== $oid_raw)
alert('결제 주문번호가 올바르지 않습니다.', './inicisloglist.php');
$row = sql_fetch(" select * from `{$tables['summary']}` where ip_oid = '".sql_escape_string($oid)."' ");
if (empty($row['ip_id']))
alert('결제 처리 이력을 찾을 수 없습니다.', './inicisloglist.php');
$targets[] = $row;
}
if (!count($targets))
alert('KG이니시스에서 조회할 확인 필요 거래가 없습니다.', './inicisloglist.php');
$success_count = 0;
$failed_count = 0;
$last_oid = '';
foreach ($targets as $target) {
$last_oid = $target['ip_oid'];
$target_tid = !empty($target['ip_tid']) ? $target['ip_tid'] : inicis_pro_recover_approved_tid($target['ip_oid'], 'admin');
if ($target_tid === '') {
if ($mode !== 'batch')
alert('승인 TID가 없어 KG이니시스 거래조회를 실행할 수 없습니다. 인증 전 미완료 결제이거나 승인 TID가 복구되지 않은 거래입니다.', './inicislogview.php?oid='.urlencode($target['ip_oid']));
$failed_count++;
continue;
}
$inquiry = inicis_pro_inquiry($target_tid, $target['ip_oid'], $target);
if (inicis_pro_save_inquiry($target['ip_oid'], $inquiry, 'admin') && !empty($inquiry['success']))
$success_count++;
else
$failed_count++;
}
$message = 'KG이니시스 거래조회가 완료되었습니다. 성공 '.$success_count.'건, 실패 '.$failed_count.'건';
if ($mode !== 'batch' && $last_oid !== '')
alert($message, './inicislogview.php?oid='.urlencode($last_oid));
alert($message, './inicisloglist.php?risk=anomaly');
+265
View File
@@ -0,0 +1,265 @@
<?php
$sub_menu = '400420';
include_once('./_common.php');
auth_check_menu($auth, $sub_menu, 'r');
include_once(G5_SHOP_PATH.'/inicis/pro/inicis_pro.lib.php');
include_once('./inicislog.lib.php');
$g5['title'] = 'KG이니시스 INIpay PRO 결제 처리 현황';
$tables = inicis_pro_audit_tables();
$tables_ready = inicis_pro_audit_tables_ready();
$schema_ready = inicis_pro_audit_schema_ready();
$status = isset($_GET['status']) && !is_array($_GET['status']) ? preg_replace('/[^a-z_]/', '', strtolower($_GET['status'])) : '';
$allowed_status = array('', 'request_ready', 'request_expired', 'authentication_received', 'authentication_failed', 'validation_failed', 'approval_started', 'communication_failed', 'approval_failed', 'approved', 'order_saving', 'order_saved', 'notification_received', 'notification_failed', 'vbank_issued', 'paid', 'paid_after_cancel', 'refund_required', 'refund_completed', 'cancel_requested', 'canceled', 'cancel_failed', 'partial_canceled', 'partial_cancel_failed');
if (!in_array($status, $allowed_status))
$status = '';
$risk = isset($_GET['risk']) && !is_array($_GET['risk']) ? preg_replace('/[^a-z_]/', '', strtolower($_GET['risk'])) : '';
if (!in_array($risk, array('', 'anomaly', 'failed', 'processing', 'complete', 'canceled', 'abandoned')))
$risk = '';
$sfl = isset($_GET['sfl']) && !is_array($_GET['sfl']) ? $_GET['sfl'] : 'ip_oid';
if (!in_array($sfl, array('ip_oid', 'ip_tid', 'ip_auth_tid', 'mb_id')))
$sfl = 'ip_oid';
$stx = isset($_GET['stx']) && !is_array($_GET['stx']) ? get_search_string($_GET['stx']) : '';
$fr_date = isset($_GET['fr_date']) && !is_array($_GET['fr_date']) && preg_match('/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/', $_GET['fr_date']) ? $_GET['fr_date'] : '';
$to_date = isset($_GET['to_date']) && !is_array($_GET['to_date']) && preg_match('/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/', $_GET['to_date']) ? $_GET['to_date'] : '';
include_once(G5_ADMIN_PATH.'/admin.head.php');
if (!$tables_ready) {
?>
<div class="local_desc02 local_desc">
<p>결제 현황 테이블이 아직 설치되지 않았습니다. 최고관리자로 <a href="<?php echo G5_ADMIN_URL; ?>/dbupgrade.php"><strong>DB 업그레이드</strong></a>를 실행한 후 이용해 주십시오.</p>
</div>
<?php
include_once(G5_ADMIN_PATH.'/admin.tail.php');
exit;
}
if (!$schema_ready) {
?>
<div class="local_desc02 local_desc">
<p>결제 현황 테이블의 운영 감시 필드가 설치되지 않았습니다. 최고관리자로 <a href="<?php echo G5_ADMIN_URL; ?>/dbupgrade.php"><strong>DB 업그레이드</strong></a>를 실행한 후 이용해 주십시오.</p>
</div>
<?php
include_once(G5_ADMIN_PATH.'/admin.tail.php');
exit;
}
include_once(G5_PLUGIN_PATH.'/jquery-ui/datepicker.php');
$order_amount_sql = "(o.od_cart_price + o.od_send_cost + o.od_send_cost2 - o.od_cart_coupon - o.od_coupon - o.od_send_coupon - o.od_receipt_point)";
$has_order_sql = "((p.ip_order_type = 'personal' and pp.pp_id is not null) or (p.ip_order_type <> 'personal' and o.od_id is not null))";
$anomaly_sql = inicis_admin_anomaly_sql();
$where = array();
if ($status === 'refund_required')
$where[] = "p.ip_refund_required = '1'";
elseif ($status !== '')
$where[] = "(p.ip_status = '".sql_escape_string($status)."' or p.ip_noti_status = '".sql_escape_string($status)."' or p.ip_cancel_status = '".sql_escape_string($status)."')";
if ($stx !== '')
$where[] = "p.$sfl like '%".sql_escape_string($stx)."%'";
if ($fr_date !== '')
$where[] = "p.ip_created_at >= '".sql_escape_string($fr_date)." 00:00:00'";
if ($to_date !== '')
$where[] = "p.ip_created_at <= '".sql_escape_string($to_date)." 23:59:59'";
if ($risk === 'anomaly')
$where[] = $anomaly_sql;
elseif ($risk === 'failed')
$where[] = "(p.ip_status in ('authentication_failed','validation_failed','communication_failed','approval_failed') or p.ip_noti_status = 'notification_failed' or p.ip_cancel_status in ('cancel_failed','partial_cancel_failed'))";
elseif ($risk === 'processing')
$where[] = "(p.ip_status in ('request_ready','authentication_received','approval_started','order_saving','cancel_requested') or p.ip_cancel_status = 'cancel_requested')";
elseif ($risk === 'complete')
$where[] = "$has_order_sql and p.ip_status in ('order_saved','paid','refund_completed') and not ($anomaly_sql)";
elseif ($risk === 'canceled')
$where[] = "(p.ip_status = 'canceled' or p.ip_cancel_status in ('canceled','partial_canceled'))";
elseif ($risk === 'abandoned')
$where[] = "p.ip_status = 'request_expired'";
$sql_from = " from `{$tables['summary']}` p
left join {$g5['g5_shop_order_table']} o on p.ip_order_type <> 'personal' and o.od_id = p.ip_oid
left join {$g5['g5_shop_personalpay_table']} pp on p.ip_order_type = 'personal' and pp.pp_id = p.ip_oid ";
$sql_where = count($where) ? ' where '.implode(' and ', $where) : '';
$count = sql_fetch(" select count(*) as cnt $sql_from $sql_where ");
$total_count = isset($count['cnt']) ? (int) $count['cnt'] : 0;
$all_count = sql_fetch(" select count(*) as cnt from `{$tables['summary']}` ");
$anomaly_count = sql_fetch(" select count(*) as cnt $sql_from where $anomaly_sql ");
$failed_count = sql_fetch(" select count(*) as cnt from `{$tables['summary']}` where ip_status in ('authentication_failed','validation_failed','communication_failed','approval_failed') or ip_noti_status = 'notification_failed' or ip_cancel_status in ('cancel_failed','partial_cancel_failed') ");
$audit_error_count = sql_fetch(" select count(*) as cnt from `{$tables['summary']}` where ip_audit_error = '1' ");
$rows = (int) $config['cf_page_rows'];
if ($rows < 1)
$rows = 20;
$total_page = ceil($total_count / $rows);
if ($page < 1)
$page = 1;
if ($total_page > 0 && $page > $total_page)
$page = (int) $total_page;
$from_record = ($page - 1) * $rows;
$sql = " select p.*,
o.od_id as order_oid, o.od_tno as order_tid, o.od_status as order_status, o.od_receipt_price as order_receipt_price,
o.od_misu as order_misu, o.od_cancel_price as order_cancel_price, o.od_refund_price as order_refund_price, o.od_settle_case as order_settle_case, $order_amount_sql as order_amount,
pp.pp_id as personal_oid, pp.pp_tno as personal_tid, pp.pp_price as personal_amount, pp.pp_receipt_price as personal_receipt_price
$sql_from
$sql_where
order by p.ip_id desc
limit $from_record, $rows ";
$result = sql_query($sql);
$query = array(
'status' => $status,
'risk' => $risk,
'sfl' => $sfl,
'stx' => $stx,
'fr_date' => $fr_date,
'to_date' => $to_date
);
$query_string = http_build_query($query, '', '&amp;');
// 상세보기 링크는 목록으로 돌아올 때 현재 페이지까지 유지하도록 page를 포함한다.
$view_query_string = $query_string.'&amp;page='.$page;
?>
<div class="local_ov01 local_ov">
<a href="./inicisloglist.php" class="ov_listall">전체목록</a>
<span class="btn_ov01"><span class="ov_txt">전체</span><span class="ov_num"><?php echo number_format((int) $all_count['cnt']); ?>건</span></span>
<a href="?risk=anomaly" class="btn_ov01"><span class="ov_txt">확인 필요</span><span class="ov_num"><?php echo number_format((int) $anomaly_count['cnt']); ?>건</span></a>
<a href="?risk=failed" class="btn_ov01"><span class="ov_txt">실패</span><span class="ov_num"><?php echo number_format((int) $failed_count['cnt']); ?>건</span></a>
</div>
<div class="local_desc01 local_desc">
<p>이 화면은 INIpay PRO의 결제 요청, 인증, 승인, 주문 저장, 서버 통보 및 취소 이력을 표시합니다. KG 거래조회 결과가 있으면 실제 PG 상태와 주문 DB를 함께 비교합니다. 거래조회 실패 또는 조회 전 거래는 KG이니시스 상점관리자에서 TID와 금액을 다시 확인하십시오.</p>
<p>최근 자동 감시: <?php echo !empty($default['de_inicis_pro_monitor_at']) ? get_text($default['de_inicis_pro_monitor_at']) : '실행 기록 없음'; ?><?php if (!empty($default['de_inicis_pro_monitor_message'])) { ?> / <?php echo get_text($default['de_inicis_pro_monitor_message']); ?><?php } ?></p>
<p>감사 이력 기록 오류: <strong<?php echo !empty($audit_error_count['cnt']) ? ' style="color:#d00"' : ''; ?>><?php echo number_format((int) $audit_error_count['cnt']); ?>건</strong> / 통보 허용 IP: <?php echo get_text(implode(', ', inicis_pro_noti_allowed_ips())); ?></p>
</div>
<form method="post" action="./inicislogcheck.php" style="margin-bottom:10px">
<input type="hidden" name="token" value="">
<input type="hidden" name="mode" value="batch">
<button type="submit" class="btn btn_02" onclick="return confirm('확인 필요 거래 중 조회 가능한 최근 5건을 KG이니시스에서 조회하시겠습니까? 주문 생성이나 결제 취소는 실행하지 않습니다.');">확인 필요 거래 KG 대사</button>
</form>
<form class="local_sch03 local_sch" method="get">
<div>
<strong>처리 구분</strong>
<select name="risk">
<option value=""<?php echo get_selected($risk, ''); ?>>전체</option>
<option value="anomaly"<?php echo get_selected($risk, 'anomaly'); ?>>확인 필요</option>
<option value="failed"<?php echo get_selected($risk, 'failed'); ?>>실패</option>
<option value="processing"<?php echo get_selected($risk, 'processing'); ?>>처리 중</option>
<option value="complete"<?php echo get_selected($risk, 'complete'); ?>>정상 완료</option>
<option value="canceled"<?php echo get_selected($risk, 'canceled'); ?>>취소 완료</option>
<option value="abandoned"<?php echo get_selected($risk, 'abandoned'); ?>>결제창 종료·미진행</option>
</select>
<strong>현재 상태</strong>
<select name="status">
<option value="">전체</option>
<?php foreach ($allowed_status as $status_value) { if ($status_value === '') continue; ?>
<option value="<?php echo $status_value; ?>"<?php echo get_selected($status, $status_value); ?>><?php echo get_text(inicis_admin_status_label($status_value)); ?></option>
<?php } ?>
</select>
<strong>기간</strong>
<input type="text" id="fr_date" name="fr_date" value="<?php echo get_text($fr_date); ?>" class="frm_input" size="10" maxlength="10" placeholder="YYYY-MM-DD">
~
<input type="text" id="to_date" name="to_date" value="<?php echo get_text($to_date); ?>" class="frm_input" size="10" maxlength="10" placeholder="YYYY-MM-DD">
</div>
<div>
<select name="sfl">
<option value="ip_oid"<?php echo get_selected($sfl, 'ip_oid'); ?>>주문번호 OID</option>
<option value="ip_tid"<?php echo get_selected($sfl, 'ip_tid'); ?>>승인 TID</option>
<option value="ip_auth_tid"<?php echo get_selected($sfl, 'ip_auth_tid'); ?>>인증 TID</option>
<option value="mb_id"<?php echo get_selected($sfl, 'mb_id'); ?>>회원 ID</option>
</select>
<input type="text" name="stx" value="<?php echo get_text($stx); ?>" class="frm_input" size="30">
<input type="submit" value="검색" class="btn_submit">
</div>
</form>
<div class="tbl_head01 tbl_wrap">
<table>
<caption>KG이니시스 INIpay PRO 결제 처리 현황 목록</caption>
<thead>
<tr>
<th scope="col">최근 처리일시</th>
<th scope="col">주문번호</th>
<th scope="col">승인 TID</th>
<th scope="col">회원</th>
<th scope="col">구분</th>
<th scope="col">결제수단</th>
<th scope="col">금액</th>
<th scope="col">현재 상태</th>
<th scope="col">KG 거래상태</th>
<th scope="col">주문 확인</th>
<th scope="col">이력</th>
<th scope="col">관리</th>
</tr>
</thead>
<tbody>
<?php for ($i = 0; $row = sql_fetch_array($result); $i++) {
$has_order = inicis_admin_has_order($row);
$is_anomaly = inicis_admin_is_anomaly($row);
$order_type_label = $row['ip_order_type'] === 'personal' ? '개인결제' : '주문';
$device_label = $row['ip_device'] === 'MOBILE' ? '모바일' : ($row['ip_device'] === 'WEB' ? 'PC' : $row['ip_device']);
$bg = 'bg'.($i % 2);
?>
<tr class="<?php echo $bg; ?>">
<td class="td_time"><?php echo get_text($row['ip_updated_at']); ?></td>
<td class="td_odrnum2"><a href="./inicislogview.php?oid=<?php echo urlencode($row['ip_oid']); ?>&amp;<?php echo $view_query_string; ?>"><?php echo get_text($row['ip_oid']); ?></a></td>
<td class="td_left"><?php echo $row['ip_tid'] !== '' ? get_text($row['ip_tid']) : '-'; ?></td>
<td class="td_name"><?php echo $row['mb_id'] !== '' ? get_text($row['mb_id']) : '비회원'; ?></td>
<td class="td_center"><?php echo get_text($order_type_label.' / '.$device_label); ?><br><?php
if ($row['ip_environment'] === 'test') echo '<strong style="color:#d00">테스트</strong>';
elseif ($row['ip_environment'] === 'live') echo '<span style="font-size:11px">실결제</span>';
else echo '<span style="font-size:11px;color:#d00">확인 필요</span>';
?></td>
<td class="td_center"><?php echo get_text(inicis_admin_pay_type_label($row['ip_pay_type'], $row['ip_easy_pay'])); ?></td>
<td class="td_price"><?php echo number_format((int) $row['ip_amount']); ?></td>
<td class="td_center"><?php echo get_text(inicis_admin_status_label(inicis_admin_primary_status($row))); ?></td>
<td class="td_center">
<?php if (!empty($row['ip_pg_checked_at'])) { ?>
<?php echo $row['ip_pg_result_code'] === '00' ? get_text(inicis_admin_pg_status_label($row['ip_pg_status'])) : '<strong style="color:#d00">조회 실패</strong>'; ?><br>
<span style="font-size:11px"><?php echo get_text($row['ip_pg_checked_at']); ?></span>
<?php } else { ?>미조회<?php } ?>
</td>
<td class="td_center">
<?php if ($is_anomaly) { ?><strong style="color:#d00">확인 필요</strong>
<?php } elseif ($has_order) { ?><span style="color:#168b3f">정상 연결</span>
<?php } elseif ($row['ip_status'] === 'canceled') { ?>취소됨
<?php } else { ?>미생성<?php } ?>
</td>
<td class="td_num"><?php echo number_format((int) $row['ip_event_count']); ?></td>
<td class="td_mng td_mng_s">
<a href="./inicislogview.php?oid=<?php echo urlencode($row['ip_oid']); ?>&amp;<?php echo $view_query_string; ?>" class="btn btn_03">상세</a>
<?php if ($has_order && $row['ip_order_type'] === 'personal') { ?>
<a href="./personalpayform.php?w=u&amp;pp_id=<?php echo urlencode($row['ip_oid']); ?>" class="btn btn_02">개인</a>
<?php } elseif ($has_order) { ?>
<a href="./orderform.php?od_id=<?php echo urlencode($row['ip_oid']); ?>" class="btn btn_02">주문</a>
<?php } ?>
</td>
</tr>
<?php }
if ($i === 0)
echo '<tr><td colspan="12" class="empty_table">자료가 없습니다.</td></tr>';
?>
</tbody>
</table>
</div>
<?php
$paging_url = './inicisloglist.php?'.$query_string.'&amp;page=';
echo get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, $paging_url);
?>
<script>
$(function(){
$("#fr_date, #to_date").datepicker({ changeMonth: true, changeYear: true, dateFormat: "yy-mm-dd", showButtonPanel: true, yearRange: "c-99:c+99", maxDate: "+0d" });
});
</script>
<?php
include_once(G5_ADMIN_PATH.'/admin.tail.php');
+148
View File
@@ -0,0 +1,148 @@
<?php
$sub_menu = '400420';
include_once('./_common.php');
auth_check_menu($auth, $sub_menu, 'r');
include_once(G5_SHOP_PATH.'/inicis/pro/inicis_pro.lib.php');
include_once('./inicislog.lib.php');
$oid = isset($_GET['oid']) && !is_array($_GET['oid']) ? inicis_pro_clean_oid($_GET['oid']) : '';
if ($oid === '' || !isset($_GET['oid']) || $oid !== $_GET['oid'])
alert('결제 주문번호가 올바르지 않습니다.', './inicisloglist.php');
$tables = inicis_pro_audit_tables();
if (!inicis_pro_audit_schema_ready())
alert('결제 현황 테이블이 설치되지 않았습니다. DB 업그레이드를 실행해 주십시오.', G5_ADMIN_URL.'/dbupgrade.php');
// 목록으로 돌아갈 때 넘어온 검색 조건과 페이지를 그대로 유지한다.
$list_query = array();
foreach (array('status', 'risk', 'sfl', 'stx', 'fr_date', 'to_date', 'page') as $list_key) {
if (isset($_GET[$list_key]) && !is_array($_GET[$list_key]) && $_GET[$list_key] !== '')
$list_query[$list_key] = (string) $_GET[$list_key];
}
$list_url = './inicisloglist.php'.(count($list_query) ? '?'.http_build_query($list_query, '', '&amp;') : '');
$oid_sql = sql_escape_string($oid);
$order_amount_sql = "(o.od_cart_price + o.od_send_cost + o.od_send_cost2 - o.od_cart_coupon - o.od_coupon - o.od_send_coupon - o.od_receipt_point)";
$sql = " select p.*,
o.od_id as order_oid, o.od_tno as order_tid, o.od_status as order_status, o.od_time as order_time,
o.od_receipt_price as order_receipt_price, o.od_misu as order_misu, o.od_cancel_price as order_cancel_price, o.od_refund_price as order_refund_price,
o.od_settle_case as order_settle_case, $order_amount_sql as order_amount,
pp.pp_id as personal_oid, pp.pp_tno as personal_tid, pp.pp_price as personal_amount, pp.pp_receipt_price as personal_receipt_price, pp.pp_time as personal_time
from `{$tables['summary']}` p
left join {$g5['g5_shop_order_table']} o on p.ip_order_type <> 'personal' and o.od_id = p.ip_oid
left join {$g5['g5_shop_personalpay_table']} pp on p.ip_order_type = 'personal' and pp.pp_id = p.ip_oid
where p.ip_oid = '$oid_sql' ";
$row = sql_fetch($sql);
if (empty($row['ip_id']))
alert('결제 처리 이력을 찾을 수 없습니다.', './inicisloglist.php');
$events = sql_query(" select * from `{$tables['event']}` where ip_oid = '$oid_sql' order by pe_id asc ");
$has_order = inicis_admin_has_order($row);
$is_anomaly = inicis_admin_is_anomaly($row);
$saved_tid = inicis_admin_order_tid($row);
$saved_amount = inicis_admin_order_amount($row);
$legacy_pro_log = empty($row['ip_tid']) ? inicis_pro_get_log($oid) : array();
$legacy_pro_data = isset($legacy_pro_log['pro_data']) && is_array($legacy_pro_log['pro_data']) ? $legacy_pro_log['pro_data'] : array();
// 승인 TID가 있거나 승인 로그에서 복구할 수 있을 때만 조회한다.
// TID를 참조할 수 없는 미완료(인증 전) 거래는 KG에 조회할 대상이 없다.
$can_inquiry = !empty($row['ip_tid'])
|| (!empty($legacy_pro_data['__pro']) && $legacy_pro_data['__pro'] === '1'
&& isset($legacy_pro_log['P_STATUS']) && $legacy_pro_log['P_STATUS'] === '00' && !empty($legacy_pro_data['P_APPL_TID']));
$g5['title'] = 'KG이니시스 INIpay PRO 결제 처리 상세';
include_once(G5_ADMIN_PATH.'/admin.head.php');
?>
<div class="local_desc01 local_desc">
<p>이 기록은 영카트 서버가 처리한 단계의 감사 이력입니다. 최종 결제·취소 여부는 KG이니시스 상점관리자의 TID 거래내역과 대조하여 확정하십시오.</p>
<p>설정된 보존기간이 지난 단계별 상세 이력은 순차 삭제될 수 있으며, 아래 누적 이력 수에는 삭제 전 기록도 포함됩니다.</p>
<?php if (!empty($row['ip_audit_error'])) { ?><p><strong style="color:#d00">이 거래에서 감사 상세 이력 기록 오류가 감지됐습니다. 서버 오류 로그와 KG이니시스 거래내역을 함께 확인하십시오.</strong></p><?php } ?>
<?php if (!empty($row['ip_refund_required'])) { ?><p><strong style="color:#d00">취소 주문에 입금이 확인되어 환불이 필요합니다. 상품을 발송하지 말고 KG이니시스 상점관리자에서 입금 및 환불 상태를 확인하십시오.</strong></p><?php } ?>
</div>
<div class="local_desc02 local_desc">
<p><strong><?php echo $is_anomaly ? '권장 조치' : '확인 결과'; ?>:</strong> <?php echo get_text(inicis_admin_recommendation($row)); ?></p>
</div>
<div class="tbl_frm01 tbl_wrap">
<table>
<caption>결제 처리 요약</caption>
<tbody>
<tr><th scope="row">주문번호 OID</th><td><?php echo get_text($row['ip_oid']); ?></td><th scope="row">처리 판정</th><td><?php echo $is_anomaly ? '<strong style="color:#d00">확인 필요</strong>' : ($has_order ? '<span style="color:#168b3f">주문 정상 연결</span>' : get_text(inicis_admin_status_label(inicis_admin_primary_status($row)))); ?></td></tr>
<tr><th scope="row">인증 TID</th><td><?php echo $row['ip_auth_tid'] !== '' ? get_text($row['ip_auth_tid']) : '-'; ?></td><th scope="row">승인 TID</th><td><?php echo $row['ip_tid'] !== '' ? get_text($row['ip_tid']) : '-'; ?></td></tr>
<tr><th scope="row">회원 ID</th><td><?php echo $row['mb_id'] !== '' ? get_text($row['mb_id']) : '비회원'; ?></td><th scope="row">MID</th><td><?php echo get_text($row['ip_mid']); ?></td></tr>
<tr><th scope="row">결제금액</th><td><?php echo number_format((int) $row['ip_amount']); ?>원</td><th scope="row">결제수단</th><td><?php echo get_text(inicis_admin_pay_type_label($row['ip_pay_type'], $row['ip_easy_pay'])); ?></td></tr>
<tr><th scope="row">결제환경</th><td><?php echo $row['ip_environment'] === 'test' ? '<strong style="color:#d00">테스트</strong>' : ($row['ip_environment'] === 'live' ? '실결제' : '<strong style="color:#d00">확인 필요</strong>'); ?></td><th scope="row">환불 확인 필요</th><td><?php echo !empty($row['ip_refund_required']) ? '<strong style="color:#d00">예</strong>' : '아니오'; ?></td></tr>
<tr><th scope="row">접속 구분</th><td><?php echo get_text($row['ip_device']); ?></td><th scope="row">결제 구분</th><td><?php echo $row['ip_order_type'] === 'personal' ? '개인결제' : '일반주문'; ?></td></tr>
<tr><th scope="row">현재 상태</th><td><?php echo get_text(inicis_admin_status_label(inicis_admin_primary_status($row))); ?></td><th scope="row">결과 코드</th><td><?php echo $row['ip_result_code'] !== '' ? get_text($row['ip_result_code']) : '-'; ?></td></tr>
<tr><th scope="row">최근 서버 통보</th><td><?php echo $row['ip_noti_status'] !== '' ? get_text(inicis_admin_status_label($row['ip_noti_status'])).($row['ip_noti_code'] !== '' ? ' ('.get_text($row['ip_noti_code']).')' : '') : '-'; ?></td><th scope="row">통보 실패 누계</th><td><?php echo number_format((int) $row['ip_noti_failed_count']); ?>회</td></tr>
<tr><th scope="row">최근 취소 처리</th><td><?php echo $row['ip_cancel_status'] !== '' ? get_text(inicis_admin_status_label($row['ip_cancel_status'])).($row['ip_cancel_code'] !== '' ? ' ('.get_text($row['ip_cancel_code']).')' : '') : '-'; ?></td><th scope="row">가상계좌 입금기한</th><td><?php echo !empty($row['ip_vbank_due_at']) ? get_text($row['ip_vbank_due_at']) : '-'; ?></td></tr>
<tr><th scope="row">통보 메시지</th><td><?php echo $row['ip_noti_message'] !== '' ? get_text($row['ip_noti_message']) : '-'; ?></td><th scope="row">취소 메시지</th><td><?php echo $row['ip_cancel_message'] !== '' ? get_text($row['ip_cancel_message']) : '-'; ?></td></tr>
<tr><th scope="row">감사 이력 상태</th><td><?php echo !empty($row['ip_audit_error']) ? '<strong style="color:#d00">상세 기록 오류</strong>' : '정상'; ?></td><th scope="row">최근 이상 알림</th><td><?php echo !empty($row['ip_alerted_at']) ? get_text($row['ip_alerted_at']) : '-'; ?></td></tr>
<tr><th scope="row">마지막 메시지</th><td colspan="3"><?php echo $row['ip_result_message'] !== '' ? get_text($row['ip_result_message']) : '-'; ?></td></tr>
<tr><th scope="row">승인 일시</th><td><?php echo !empty($row['ip_approved_at']) ? get_text($row['ip_approved_at']) : '-'; ?></td><th scope="row">주문 저장 일시</th><td><?php echo !empty($row['ip_ordered_at']) ? get_text($row['ip_ordered_at']) : '-'; ?></td></tr>
<tr><th scope="row">통보 일시</th><td><?php echo !empty($row['ip_notified_at']) ? get_text($row['ip_notified_at']) : '-'; ?></td><th scope="row">취소 일시</th><td><?php echo !empty($row['ip_canceled_at']) ? get_text($row['ip_canceled_at']) : '-'; ?></td></tr>
<tr><th scope="row">주문 DB의 TID</th><td><?php echo $has_order ? get_text($saved_tid) : '-'; ?></td><th scope="row">주문 DB의 금액</th><td><?php echo $has_order ? number_format($saved_amount).'원' : '-'; ?></td></tr>
<?php if ($row['ip_order_type'] !== 'personal') { ?><tr><th scope="row">주문 상태/입금액</th><td><?php echo $has_order ? get_text($row['order_status']).' / '.number_format((int) $row['order_receipt_price']).'원' : '-'; ?></td><th scope="row">주문 미수금/취소액</th><td><?php echo $has_order ? number_format((int) $row['order_misu']).'원 / '.number_format((int) $row['order_cancel_price']).'원' : '-'; ?></td></tr><?php } ?>
<tr><th scope="row">KG 거래조회 상태</th><td><?php echo !empty($row['ip_pg_checked_at']) ? ($row['ip_pg_result_code'] === '00' ? get_text(inicis_admin_pg_status_label($row['ip_pg_status'])) : '조회 실패 ('.get_text($row['ip_pg_result_code']).')') : '미조회'; ?></td><th scope="row">KG 거래조회 일시</th><td><?php echo !empty($row['ip_pg_checked_at']) ? get_text($row['ip_pg_checked_at']) : '-'; ?></td></tr>
<tr><th scope="row">KG 조회 TID</th><td><?php echo !empty($row['ip_pg_tid']) ? get_text($row['ip_pg_tid']) : '-'; ?></td><th scope="row">KG 조회 금액</th><td><?php echo (int) $row['ip_pg_amount'] > 0 ? number_format((int) $row['ip_pg_amount']).'원' : '-'; ?></td></tr>
<tr><th scope="row">KG 조회 메시지</th><td colspan="3"><?php echo !empty($row['ip_pg_message']) ? get_text($row['ip_pg_message']) : '-'; ?></td></tr>
</tbody>
</table>
</div>
<div class="btn_fixed_top">
<a href="<?php echo $list_url; ?>" class="btn btn_02">목록</a>
<?php if ($can_inquiry) { ?>
<form method="post" action="./inicislogcheck.php" style="display:inline">
<input type="hidden" name="token" value="">
<input type="hidden" name="mode" value="single">
<input type="hidden" name="oid" value="<?php echo get_text($row['ip_oid']); ?>">
<button type="submit" class="btn btn_02" onclick="return confirm('이 거래를 KG이니시스에서 조회하시겠습니까? 주문 생성이나 결제 취소는 실행하지 않습니다.');">KG 거래조회</button>
</form>
<?php } ?>
<?php if ($has_order && $row['ip_order_type'] === 'personal') { ?>
<a href="./personalpayform.php?w=u&amp;pp_id=<?php echo urlencode($row['ip_oid']); ?>" class="btn btn_03">개인결제 보기</a>
<?php } elseif ($has_order) { ?>
<a href="./orderform.php?od_id=<?php echo urlencode($row['ip_oid']); ?>" class="btn btn_03">주문 보기</a>
<?php } ?>
</div>
<div class="tbl_head01 tbl_wrap">
<table>
<caption>결제 단계별 처리 이력</caption>
<thead>
<tr>
<th scope="col">순서</th>
<th scope="col">처리일시</th>
<th scope="col">경로</th>
<th scope="col">단계</th>
<th scope="col">결과</th>
<th scope="col">코드</th>
<th scope="col">메시지</th>
<th scope="col">IP</th>
</tr>
</thead>
<tbody>
<?php for ($i = 1; $event = sql_fetch_array($events); $i++) { ?>
<tr class="bg<?php echo ($i - 1) % 2; ?>">
<td class="td_num"><?php echo $i; ?></td>
<td class="td_time"><?php echo get_text($event['pe_created_at']); ?></td>
<td class="td_center"><?php echo get_text(inicis_admin_source_label($event['pe_source'])); ?></td>
<td class="td_center"><?php echo get_text(inicis_admin_stage_label($event['pe_stage'])); ?></td>
<td class="td_center"><?php echo get_text(inicis_admin_status_label($event['pe_status'])); ?></td>
<td class="td_center"><?php echo $event['pe_code'] !== '' ? get_text($event['pe_code']) : '-'; ?></td>
<td class="td_left"><?php echo $event['pe_message'] !== '' ? get_text($event['pe_message']) : '-'; ?></td>
<td class="td_center"><?php echo get_text($event['pe_ip']); ?></td>
</tr>
<?php }
if ($i === 1)
echo '<tr><td colspan="8" class="empty_table">단계별 이력이 없습니다.</td></tr>';
?>
</tbody>
</table>
</div>
<?php
include_once(G5_ADMIN_PATH.'/admin.tail.php');
+13 -11
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);
@@ -365,7 +367,7 @@ $pg_anchor = '<ul class="anchor">
<tbody>
<tr>
<td><?php echo $od['od_id']; ?></td>
<td class="td_paybybig"><?php echo $s_receipt_way; ?></td>
<td class="td_paybybig"><?php echo get_text($s_receipt_way); ?></td>
<td class="td_numbig td_numsum"><?php echo display_price($amount['order']); ?></td>
<td class="td_numbig"><?php echo display_price($od_send_cost + $od_send_cost2); ?></td>
<td class="td_numbig"><?php echo display_point($od_temp_point); ?></td>
@@ -485,7 +487,7 @@ $pg_anchor = '<ul class="anchor">
<tr>
<th scope="row"><span class="sound_only">주문하시는 분 </span>주소</th>
<td>
<span><?php echo $data['od_zip']; ?></span>
<span><?php echo get_text($data['od_zip']); ?></span>
<span><?php echo get_text($data['od_addr1']); ?></span>
<span><?php echo get_text($data['od_addr2']); ?></span>
<span><?php echo get_text($data['od_addr3']); ?></span>
@@ -526,7 +528,7 @@ $pg_anchor = '<ul class="anchor">
<tr>
<th scope="row"><span class="sound_only">받으시는 분 </span>주소</th>
<td>
<span><?php echo $data['od_b_zip']; ?></span>
<span><?php echo get_text($data['od_b_zip']); ?></span>
<span><?php echo get_text($data['od_b_addr1']); ?></span>
<span><?php echo get_text($data['od_b_addr2']); ?></span>
<span><?php echo get_text($data['od_b_addr3']); ?></span>
@@ -536,7 +538,7 @@ $pg_anchor = '<ul class="anchor">
<?php if ($default['de_hope_date_use']) { ?>
<tr>
<th scope="row">희망배송일</th>
<td><?php echo $data['od_hope_date']; ?> (<?php echo get_yoil($data['od_hope_date']); ?>)</td>
<td><?php echo get_text($data['od_hope_date']); ?> (<?php echo get_yoil($data['od_hope_date']); ?>)</td>
</tr>
<?php } ?>
<tr>
@@ -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');
+22 -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,13 @@ $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)) : '';
$od_ip = (isset($data['od_ip']) && !is_array($data['od_ip']) && preg_match('/^[0-9a-fA-F:.]{1,45}$/', $data['od_ip'])) ? $data['od_ip'] : '';
$od_settle_case = (isset($data['od_settle_case']) && !is_array($data['od_settle_case'])) ? addslashes(clean_xss_tags(stripslashes($data['od_settle_case']), 1, 1)) : '';
$od_test = (isset($data['od_test']) && !is_array($data['od_test'])) ? (int) $data['od_test'] : 0;
// 주문서에 입력
$sql = " insert {$g5['g5_shop_order_table']}
@@ -295,9 +300,9 @@ $sql = " insert {$g5['g5_shop_order_table']}
od_shop_memo = '',
od_hope_date = '{$od_hope_date}',
od_time = '{$od['dt_time']}',
od_ip = '{$data['od_ip']}',
od_settle_case = '{$data['od_settle_case']}',
od_test = '{$data['od_test']}'
od_ip = '$od_ip',
od_settle_case = '$od_settle_case',
od_test = '$od_test'
";
$result = sql_query($sql, true);
@@ -321,8 +326,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 +351,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 +361,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',
+9 -1
View File
@@ -6,6 +6,11 @@ auth_check_menu($auth, $sub_menu, "r");
$sql_common = " from {$g5['g5_shop_order_data_table']} ";
$allowed_sfl = array('od_id');
if (!in_array($sfl, $allowed_sfl)) {
$sfl = 'od_id';
}
$sql_search = " where cart_id <> '0' ";
if ($stx) {
$sql_search .= " and ( ";
@@ -24,6 +29,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
@@ -133,7 +141,7 @@ $colspan = 10;
<td class="td_center"><?php echo get_text($data['od_tel']); ?></td>
<td class="td_name"><?php echo get_text($data['od_b_name']); ?></td>
<td class="td_price"><?php echo number_format($ct['price']); ?></td>
<td class="td_center"><?php echo $data['od_settle_case']; ?></td>
<td class="td_center"><?php echo get_text($data['od_settle_case']); ?></td>
<td class="td_time"><?php echo $row['dt_time']; ?></td>
<td class="td_mng td_mng_m">
<a href="./inorderform.php?od_id=<?php echo $row['od_id']; ?>&amp;<?php echo $qstr; ?>" class="btn btn_03"><span class="sound_only"><?php echo $row['od_id']; ?> </span>보기</a>
+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
View File
@@ -6,6 +6,8 @@ check_demo();
auth_check_menu($auth, $sub_menu, "w");
if (function_exists('check_request_origin')) check_request_origin(G5_ADMIN_URL);
$post_it_id_count = (isset($_POST['it_id']) && is_array($_POST['it_id'])) ? count($_POST['it_id']) : 0;
for ($i=0; $i<$post_it_id_count; $i++)
+2
View File
@@ -8,6 +8,8 @@ ini_set('memory_limit', '50M');
auth_check_menu($auth, $sub_menu, "w");
if (function_exists('check_request_origin')) check_request_origin(G5_ADMIN_URL);
function only_number($n)
{
return preg_replace('/[^0-9]/', '', (string)$n);
+12 -26
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',
+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();
}
}
+400 -11
View File
@@ -113,8 +113,120 @@ if ($od['od_pg'] === 'nicepay' && $od['od_settle_case'] === '가상계좌' && $o
$print_od_deposit_name .= '_NICE';
}
if (!function_exists('shop_admin_get_nicepay_status')) {
function shop_admin_get_nicepay_status($tid, $default)
{
$result = array(
'data' => array(),
'error' => ''
);
if (!function_exists('curl_init')) {
$result['error'] = 'cURL 모듈이 설치되어 있지 않아 나이스페이 거래 상태를 조회할 수 없습니다.';
return $result;
}
$tid = preg_replace('/[^0-9a-zA-Z]/', '', (string) $tid);
if ($tid === '') {
$result['error'] = '거래 ID가 없어 나이스페이 거래 상태를 조회할 수 없습니다.';
return $result;
}
if (!empty($default['de_card_test'])) {
$mid = 'nicepay00m';
$merchantKey = 'EYzu8jGGMfqaDEp76gSckuvnaHHu+bC4opsSN6lHv3b2lurNYkVXrZ7Z1AoqQnXI3eLuaUFyoRNC6FkrzVjceg==';
} else {
$mid = 'SR'.$default['de_nicepay_mid'];
$merchantKey = $default['de_nicepay_key'];
}
if ($mid === 'SR' || $merchantKey === '') {
$result['error'] = '나이스페이 MID 또는 KEY가 설정되어 있지 않아 거래 상태를 조회할 수 없습니다.';
return $result;
}
$ediDate = preg_replace('/[^0-9]/', '', G5_TIME_YMDHIS);
$signData = bin2hex(hash('sha256', $tid.$mid.$ediDate.$merchantKey, true));
$postUrl = 'https://webapi.nicepay.co.kr/webapi/inquery/trans_status.jsp';
$data = array(
'TID' => $tid,
'MID' => $mid,
'EdiDate' => $ediDate,
'SignData' => $signData,
'CharSet' => 'utf-8',
'EdiType' => 'JSON'
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $postUrl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 15);
curl_setopt($ch, CURLOPT_TIMEOUT, 25);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($ch, CURLOPT_POST, true);
$response = curl_exec($ch);
$curl_error = curl_error($ch);
curl_close($ch);
if ($response === false || $response === '') {
$result['error'] = '나이스페이 거래 상태 조회 응답이 없습니다.'.($curl_error ? ' '.$curl_error : '');
return $result;
}
$responseData = json_decode($response, true);
if (!is_array($responseData)) {
$utf8_response = @iconv('EUC-KR', 'UTF-8//IGNORE', $response);
if ($utf8_response) {
$responseData = json_decode($utf8_response, true);
}
}
if (!is_array($responseData)) {
$result['error'] = '나이스페이 거래 상태 조회 응답을 해석할 수 없습니다.';
return $result;
}
$result['data'] = $responseData;
return $result;
}
}
if (!function_exists('shop_admin_format_nicepay_auth_date')) {
function shop_admin_format_nicepay_auth_date($auth_date)
{
$auth_date = preg_replace('/[^0-9]/', '', (string) $auth_date);
if (strlen($auth_date) === 12) {
return '20'.substr($auth_date, 0, 2).'-'.substr($auth_date, 2, 2).'-'.substr($auth_date, 4, 2).' '.substr($auth_date, 6, 2).':'.substr($auth_date, 8, 2).':'.substr($auth_date, 10, 2);
}
if (strlen($auth_date) === 14) {
return substr($auth_date, 0, 4).'-'.substr($auth_date, 4, 2).'-'.substr($auth_date, 6, 2).' '.substr($auth_date, 8, 2).':'.substr($auth_date, 10, 2).':'.substr($auth_date, 12, 2);
}
return $auth_date;
}
}
$nicepay_status_result = array();
$nicepay_status_error = '';
if ($od['od_pg'] === 'nicepay') {
$nicepay_status = shop_admin_get_nicepay_status($od['od_tno'], $default);
$nicepay_status_result = $nicepay_status['data'];
$nicepay_status_error = $nicepay_status['error'];
}
// add_javascript('js 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
$is_nicepay_vbank_pg_cancel = ($od['od_pg'] === 'nicepay' && $od['od_settle_case'] === '가상계좌' && is_cancel_shop_pg_order($od));
if ($is_nicepay_vbank_pg_cancel) {
add_stylesheet('<link rel="stylesheet" href="'.G5_JS_URL.'/remodal/remodal.css">', 11);
add_stylesheet('<link rel="stylesheet" href="'.G5_JS_URL.'/remodal/remodal-default-theme.css">', 12);
add_javascript('<script src="'.G5_JS_URL.'/remodal/remodal.js"></script>', 10);
}
?>
<section id="anc_sodr_list">
@@ -144,6 +256,13 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
<input type="hidden" name="search" value="<?php echo $search; ?>">
<input type="hidden" name="page" value="<?php echo $page;?>">
<input type="hidden" name="pg_cancel" value="0">
<input type="hidden" name="submit_ct_status" value="">
<?php if ($is_nicepay_vbank_pg_cancel) { ?>
<input type="hidden" name="RefundAcctNo" value="">
<input type="hidden" name="RefundBankCd" value="">
<input type="hidden" name="RefundAcctNm" value="">
<input type="hidden" name="nicepay_vbank_refund_confirmed" value="0">
<?php } ?>
<div class="tbl_head01 tbl_wrap">
<table>
@@ -311,6 +430,52 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
} //end if
?>
<?php if ($od['od_pg'] === 'nicepay') { ?>
<section id="anc_sodr_nicepay_status">
<h2 class="h2_frm">나이스페이 결제 조회</h2>
<?php if ($nicepay_status_error) { ?>
<div class="local_desc01 local_desc">
<p><?php echo get_text($nicepay_status_error); ?></p>
</div>
<?php } else {
$nicepay_status_map = array(
'0' => '승인 상태',
'1' => '취소 상태',
'9' => '승인 거래 없음'
);
$nicepay_status_code = isset($nicepay_status_result['Status']) ? (string) $nicepay_status_result['Status'] : '';
$nicepay_status_text = isset($nicepay_status_map[$nicepay_status_code]) ? $nicepay_status_map[$nicepay_status_code] : '';
$nicepay_auth_date = isset($nicepay_status_result['AuthDate']) ? shop_admin_format_nicepay_auth_date($nicepay_status_result['AuthDate']) : '';
?>
<div class="tbl_head01 tbl_wrap">
<table>
<caption>나이스페이 결제 조회</caption>
<thead>
<tr>
<th scope="col">결과코드</th>
<th scope="col">결과 메시지</th>
<th scope="col">거래 ID</th>
<th scope="col">거래 상태</th>
<th scope="col">승인번호</th>
<th scope="col">승인일시</th>
</tr>
</thead>
<tbody>
<tr>
<td><?php echo isset($nicepay_status_result['ResultCode']) ? get_text($nicepay_status_result['ResultCode']) : '-'; ?></td>
<td><?php echo isset($nicepay_status_result['ResultMsg']) ? get_text($nicepay_status_result['ResultMsg']) : '-'; ?></td>
<td><?php echo isset($nicepay_status_result['TID']) ? get_text($nicepay_status_result['TID']) : get_text($od['od_tno']); ?></td>
<td><?php echo $nicepay_status_code !== '' ? get_text($nicepay_status_code.($nicepay_status_text ? ' ('.$nicepay_status_text.')' : '')) : '-'; ?></td>
<td><?php echo isset($nicepay_status_result['AuthCode']) && $nicepay_status_result['AuthCode'] !== '' ? get_text($nicepay_status_result['AuthCode']) : '-'; ?></td>
<td><?php echo $nicepay_auth_date !== '' ? get_text($nicepay_auth_date) : '-'; ?></td>
</tr>
</tbody>
</table>
</div>
<?php } ?>
</section>
<?php } ?>
<section id="anc_sodr_pay">
<h2 class="h2_frm">주문결제 내역</h2>
<?php echo $pg_anchor; ?>
@@ -332,7 +497,7 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
//$amount['미수'] = $amount['order'] - $amount['receipt'] - $amount['coupon'];
// 결제방법
$s_receipt_way = check_pay_name_replace($od['od_settle_case'], $od);
$s_receipt_way = get_text(check_pay_name_replace($od['od_settle_case'], $od));
if ($od['od_receipt_point'] > 0)
$s_receipt_way .= "+포인트";
@@ -409,7 +574,7 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
</tr>
<?php } ?>
<tr>
<th scope="row"><?php echo $od['od_settle_case']; ?> 입금액</th>
<th scope="row"><?php echo get_text($od['od_settle_case']); ?> 입금액</th>
<td><?php echo display_price($od['od_receipt_price']); ?></td>
</tr>
<tr>
@@ -432,7 +597,7 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
<td><?php echo get_text($od['od_bank_account']); ?></td>
</tr>
<tr>
<th scope="row"><?php echo $od['od_settle_case']; ?> 결제액</th>
<th scope="row"><?php echo get_text($od['od_settle_case']); ?> 결제액</th>
<td><?php echo display_price($od['od_receipt_price']); ?></td>
</tr>
<tr>
@@ -705,7 +870,7 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
<?php } ?>
<tr>
<th scope="row"><label for="od_receipt_price"><?php echo $od['od_settle_case']; ?> 입금액</label></th>
<th scope="row"><label for="od_receipt_price"><?php echo get_text($od['od_settle_case']); ?> 입금액</label></th>
<td>
<?php echo $html_receipt_chk; ?>
<input type="text" name="od_receipt_price" value="<?php echo $od['od_receipt_price']; ?>" id="od_receipt_price" class="frm_input"> 원
@@ -739,7 +904,7 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
<td><?php echo get_text($od['od_bank_account']); ?></td>
</tr>
<tr>
<th scope="row"><label for="od_receipt_price"><?php echo $od['od_settle_case']; ?> 결제액</label></th>
<th scope="row"><label for="od_receipt_price"><?php echo get_text($od['od_settle_case']); ?> 결제액</label></th>
<td>
<?php echo $html_receipt_chk; ?>
<input type="text" name="od_receipt_price" value="<?php echo $od['od_receipt_price']; ?>" id="od_receipt_price" class="frm_input"> 원
@@ -870,8 +1035,8 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
<?php if($od['od_status'] == '주문' && $od['od_misu'] > 0) { ?>
<a href="./personalpayform.php?popup=yes&amp;od_id=<?php echo $od_id; ?>" id="personalpay_add" class="btn btn_02">개인결제추가</a>
<?php } ?>
<?php if($od['od_misu'] < 0 && ($od['od_receipt_price'] - $od['od_refund_price']) > 0 && ($od['od_settle_case'] == '신용카드' || $od['od_settle_case'] == '계좌이체' || $od['od_settle_case'] == 'KAKAOPAY')) { ?>
<a href="./orderpartcancel.php?od_id=<?php echo $od_id; ?>" id="orderpartcancel" class="btn btn_02"><?php echo $od['od_settle_case']; ?> 부분취소</a>
<?php if($od['od_misu'] < 0 && ($od['od_receipt_price'] - $od['od_refund_price']) > 0 && ($od['od_settle_case'] == '신용카드' || $od['od_settle_case'] == '계좌이체' || $od['od_settle_case'] == 'KAKAOPAY' || ($od['od_pg'] == 'nicepay' && $od['od_settle_case'] == '간편결제'))) { ?>
<a href="./orderpartcancel.php?od_id=<?php echo $od_id; ?>" id="orderpartcancel" class="btn btn_02"><?php echo get_text($od['od_settle_case']); ?> 부분취소</a>
<?php } ?>
<a href="./orderlist.php?<?php echo $qstr; ?>" class="btn btn_02">목록</a>
</div>
@@ -1044,7 +1209,157 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
</form>
</section>
<?php if ($is_nicepay_vbank_pg_cancel) {
$nicepay_refund_bank_codes = array(
'은행/기관' => array(
'001' => '한국은행',
'002' => '산업은행',
'003' => '기업은행',
'004' => '국민은행',
'005' => '외환은행',
'007' => '수협은행',
'008' => '수출입은행',
'011' => 'NH농협은행',
'012' => '농협중앙회(지역농축협)',
'020' => '우리은행',
'023' => 'SC제일은행',
'026' => '서울은행',
'027' => '한국씨티은행',
'030' => '수협중앙회',
'031' => 'iM뱅크(대구)',
'032' => '부산은행',
'034' => '광주은행',
'035' => '제주은행',
'037' => '전북은행',
'039' => '경남은행',
'045' => '새마을금고',
'048' => '신협',
'050' => '저축은행',
'051' => '기타 외국계은행',
'052' => '모건스탠리은행',
'054' => 'HSBC은행',
'055' => '도이치은행',
'056' => '알비에스피엘씨은행',
'057' => '제이피모간체이스은행',
'058' => '미즈호은행',
'059' => '엠유에프지은행',
'060' => 'BOA은행',
'061' => '비엔피파리바은행',
'062' => '중국공상은행',
'063' => '중국은행',
'064' => '산림조합중앙회',
'065' => '대화은행',
'071' => '우체국',
'076' => '신용보증기금',
'077' => '기술보증기금',
'081' => '하나은행',
'088' => '신한은행',
'089' => '케이뱅크',
'090' => '카카오뱅크',
'092' => '토스뱅크',
'093' => '한국주택금융공사',
'094' => '서울보증보험',
'095' => '경찰청',
'099' => '금융결제원'
),
'증권사' => array(
'209' => '유안타증권',
'218' => 'KB증권',
'238' => '미래에셋증권',
'240' => '삼성증권',
'243' => '한국투자증권',
'247' => 'NH투자증권',
'261' => '교보증권',
'262' => 'iM증권',
'263' => '현대차증권',
'264' => '키움증권',
'265' => 'LS증권',
'266' => '에스케이증권',
'267' => '대신증권',
'269' => '한화투자증권',
'270' => '하나증권',
'271' => '토스증권',
'278' => '신한투자증권',
'279' => 'DB증권',
'280' => '유진투자증권',
'287' => '메리츠증권',
'288' => '카카오페이증권',
'289' => '엔에이치투자증권',
'290' => '부국증권',
'291' => '신영증권',
'292' => '케이프투자증권'
)
);
?>
<div class="remodal" data-remodal-id="nicepay-vbank-refund" data-remodal-options="hashTracking:false, closeOnOutsideClick:false">
<button data-remodal-action="close" class="remodal-close"></button>
<h3>나이스페이 가상계좌 환불 정보</h3>
<p>입금 후 환불 건은 환불계좌 정보를 입력해야 합니다. 입금 전 발급취소 건은 비워두고 진행할 수 있습니다.</p>
<div class="tbl_frm01 tbl_wrap">
<table>
<caption>나이스페이 가상계좌 환불 정보 입력</caption>
<colgroup>
<col class="grid_4">
<col>
</colgroup>
<tbody>
<tr>
<th scope="row"><label for="nicepay_refund_acct_no">환불계좌번호</label></th>
<td><input type="text" id="nicepay_refund_acct_no" class="frm_input" size="22" maxlength="16" inputmode="numeric" autocomplete="off"> 숫자만 입력</td>
</tr>
<tr>
<th scope="row"><label for="nicepay_refund_bank_cd">환불은행</label></th>
<td>
<select id="nicepay_refund_bank_cd" class="frm_input">
<option value="">은행을 선택해 주세요</option>
<?php foreach ($nicepay_refund_bank_codes as $bank_group => $bank_codes) { ?>
<optgroup label="<?php echo $bank_group; ?>">
<?php foreach ($bank_codes as $bank_code => $bank_name) { ?>
<option value="<?php echo $bank_code; ?>"><?php echo $bank_name; ?> (<?php echo $bank_code; ?>)</option>
<?php } ?>
</optgroup>
<?php } ?>
</select>
</td>
</tr>
<tr>
<th scope="row"><label for="nicepay_refund_acct_nm">환불계좌주명</label></th>
<td><input type="text" id="nicepay_refund_acct_nm" class="frm_input" size="18" maxlength="10" autocomplete="off"> 10 byte 이하</td>
</tr>
</tbody>
</table>
</div>
<br>
<button type="button" class="remodal-cancel" data-remodal-action="cancel">취소</button>
<button type="button" class="remodal-confirm" id="nicepay_vbank_refund_submit">확인</button>
</div>
<?php } ?>
<script>
<?php if ($is_nicepay_vbank_pg_cancel) { ?>
var nicepayVbankCancel = true;
var nicepayVbankRefundRequired = <?php echo ((int) $od['od_receipt_price'] > 0) ? 'true' : 'false'; ?>;
<?php } else { ?>
var nicepayVbankCancel = false;
var nicepayVbankRefundRequired = false;
<?php } ?>
function nicepay_submit_orderform(f)
{
var status = document.pressed || (f.submit_ct_status ? f.submit_ct_status.value : "");
var statusInput = f.querySelector("input[type=hidden][name=ct_status]");
if (!statusInput) {
statusInput = document.createElement("input");
statusInput.type = "hidden";
statusInput.name = "ct_status";
f.appendChild(statusInput);
}
statusInput.value = status;
f.submit();
}
$(function() {
// 전체 옵션선택
$("#sit_select_all").click(function() {
@@ -1080,12 +1395,70 @@ $(function() {
window.open(href, "partcancelwin", "left=100, top=100, width=600, height=350, scrollbars=yes");
return false;
});
$("#nicepay_refund_acct_no").on("input", function() {
this.value = this.value.replace(/[^0-9]/g, "");
});
$("#nicepay_vbank_refund_submit").on("click", function() {
var f = document.frmorderform;
var acctNo = $.trim($("#nicepay_refund_acct_no").val()).replace(/[^0-9]/g, "");
var bankCd = $.trim($("#nicepay_refund_bank_cd").val()).replace(/[^0-9]/g, "");
var acctNm = $.trim($("#nicepay_refund_acct_nm").val());
var hasRefundInfo = (acctNo !== "" || bankCd !== "" || acctNm !== "");
if (!nicepayVbankRefundRequired && !hasRefundInfo) {
f.RefundAcctNo.value = "";
f.RefundBankCd.value = "";
f.RefundAcctNm.value = "";
f.nicepay_vbank_refund_confirmed.value = 1;
if (form_submit(f)) {
nicepay_submit_orderform(f);
}
return false;
}
if (acctNo === "" || acctNo.length > 16) {
alert("환불계좌번호를 숫자 16자리 이하로 입력해 주십시오.");
$("#nicepay_refund_acct_no").focus();
return false;
}
if (!/^[0-9]{3}$/.test(bankCd)) {
alert("환불은행을 선택해 주십시오.");
$("#nicepay_refund_bank_cd").focus();
return false;
}
if (acctNm === "") {
alert("환불계좌주명을 입력해 주십시오.");
$("#nicepay_refund_acct_nm").focus();
return false;
}
f.RefundAcctNo.value = acctNo;
f.RefundBankCd.value = bankCd;
f.RefundAcctNm.value = acctNm;
f.nicepay_vbank_refund_confirmed.value = 1;
if (form_submit(f)) {
nicepay_submit_orderform(f);
}
return false;
});
});
function form_submit(f)
{
var check = false;
var status = document.pressed;
var status = document.pressed || (f.submit_ct_status ? f.submit_ct_status.value : "");
if (f.submit_ct_status) {
f.submit_ct_status.value = status;
}
for (i=0; i<f.chk_cnt.value; i++) {
if (document.getElementById('ct_chk_'+i).checked == true)
@@ -1107,13 +1480,26 @@ function form_submit(f)
<?php if($od['od_pg'] == 'KAKAOPAY') { ?>
var cancel_pg = "카카오페이";
<?php } else { ?>
var cancel_pg = "PG사의 <?php echo $od['od_settle_case']; ?>";
var cancel_pg = "PG사의 <?php echo get_text($od['od_settle_case']); ?>";
<?php } ?>
if(chk_cnt == chked_cnt) {
if(confirm(cancel_pg+" 결제를 함께 취소하시겠습니까?\n\n한번 취소한 결제는 다시 복구할 수 없습니다.")) {
// 체크하지 않은 나머지 품목이 모두 취소류 상태이면 이번 처리로 주문 전체가 취소된다.
var remain_active_cnt = $ct_chk.not(":checked").filter(function() {
var row_status = $.trim($(this).closest("tr").find("td.td_mngsmall").first().text());
return row_status != "취소" && row_status != "반품" && row_status != "품절";
}).length;
if(chked_cnt > 0 && remain_active_cnt == 0) {
if(nicepayVbankCancel && f.nicepay_vbank_refund_confirmed.value == "1") {
f.pg_cancel.value = 1;
msg = cancel_pg+" 결제 취소와 함께 ";
} else if(confirm(cancel_pg+" 결제를 함께 취소하시겠습니까?\n\n한번 취소한 결제는 다시 복구할 수 없습니다.")) {
f.pg_cancel.value = 1;
msg = cancel_pg+" 결제 취소와 함께 ";
if (nicepayVbankCancel && f.nicepay_vbank_refund_confirmed.value != "1") {
$('[data-remodal-id=nicepay-vbank-refund]').remodal().open();
return false;
}
} else {
f.pg_cancel.value = 0;
msg = "";
@@ -1125,6 +1511,9 @@ function form_submit(f)
if (confirm(msg+"\'" + status + "\' 상태를 선택하셨습니다.\n\n선택하신대로 처리하시겠습니까?")) {
return true;
} else {
if (nicepayVbankCancel && f.nicepay_vbank_refund_confirmed) {
f.nicepay_vbank_refund_confirmed.value = 0;
}
return false;
}
}
+199 -16
View File
@@ -6,6 +6,16 @@ auth_check_menu($auth, $sub_menu, "w");
check_admin_token();
$od_id = isset($_POST['od_id']) ? safe_replace_regex($_POST['od_id'], 'od_id') : '';
$ct_status = isset($_POST['ct_status']) ? clean_xss_tags($_POST['ct_status'], 1, 1) : '';
if ($ct_status === '' && isset($_POST['submit_ct_status'])) {
$ct_status = clean_xss_tags($_POST['submit_ct_status'], 1, 1);
}
$pg_cancel = isset($_POST['pg_cancel']) ? (int) $_POST['pg_cancel'] : 0;
$nicepay_refund_acct_no = isset($_POST['RefundAcctNo']) ? preg_replace('/[^0-9]/', '', $_POST['RefundAcctNo']) : '';
$nicepay_refund_bank_cd = isset($_POST['RefundBankCd']) ? preg_replace('/[^0-9]/', '', $_POST['RefundBankCd']) : '';
$nicepay_refund_acct_nm = isset($_POST['RefundAcctNm']) ? trim(clean_xss_tags($_POST['RefundAcctNm'], 1, 1)) : '';
$ct_chk_count = isset($_POST['ct_chk']) ? count($_POST['ct_chk']) : 0;
if(!$ct_chk_count)
alert('처리할 자료를 하나 이상 선택해 주십시오.');
@@ -13,12 +23,171 @@ if(!$ct_chk_count)
$status_normal = array('주문','입금','준비','배송','완료');
$status_cancel = array('취소','반품','품절');
if (in_array($_POST['ct_status'], $status_normal) || in_array($_POST['ct_status'], $status_cancel)) {
if (in_array($ct_status, $status_normal) || in_array($ct_status, $status_cancel)) {
; // 통과
} else {
alert('변경할 상태가 올바르지 않습니다.');
}
// INIpay PRO 전체취소는 로컬 상품상태를 바꾸기 전에 PG 취소를 먼저 확정한다.
// PG 취소 실패 후에도 주문만 취소되어 가상계좌 입금이 남는 상태를 방지한다.
$inicis_pro_cancel_preprocessed = false;
$inicis_pro_order_lock = '';
if (in_array($_POST['ct_status'], $status_cancel)) {
$selected_ct_ids = array();
$posted_ct_count = isset($_POST['ct_id']) && is_array($_POST['ct_id']) ? count($_POST['ct_id']) : 0;
for ($pre_i = 0; $pre_i < $posted_ct_count; $pre_i++) {
$pre_k = isset($_POST['ct_chk'][$pre_i]) ? (int) $_POST['ct_chk'][$pre_i] : -1;
if ($pre_k < 0 || !isset($_POST['ct_id'][$pre_k]))
continue;
$pre_ct_id = (int) $_POST['ct_id'][$pre_k];
if ($pre_ct_id > 0)
$selected_ct_ids[$pre_ct_id] = $pre_ct_id;
}
if (count($selected_ct_ids)) {
$selected_ct_sql = implode(',', array_values($selected_ct_ids));
$future = sql_fetch(" select count(*) as total_count,
sum(if(ct_status in ('취소','반품','품절') or ct_id in ($selected_ct_sql), 1, 0)) as cancel_count
from {$g5['g5_shop_cart_table']}
where od_id = '".sql_escape_string($od_id)."' ");
if ((int) $future['total_count'] > 0 && (int) $future['total_count'] === (int) $future['cancel_count']) {
$pre_od = sql_fetch(" select * from {$g5['g5_shop_order_table']} where od_id = '".sql_escape_string($od_id)."' ");
if (!empty($pre_od['od_tno']) && $pre_od['od_pg'] === 'inicis') {
include_once(G5_SHOP_PATH.'/inicis/pro/inicis_pro.lib.php');
$pro_tables = inicis_pro_audit_tables();
$pro_summary = sql_fetch(" select * from `{$pro_tables['summary']}`
where ip_oid = '".sql_escape_string($pre_od['od_id'])."'
and ip_tid = '".sql_escape_string($pre_od['od_tno'])."' ", false);
if (!empty($pro_summary['ip_id'])) {
$inicis_pro_order_lock = inicis_pro_lock($pre_od['od_id']);
if ($inicis_pro_order_lock === '')
alert('동일 주문의 결제 또는 통보 처리가 진행 중입니다. 잠시 후 다시 취소해 주십시오.');
// KG이니시스 상점관리자에서 이미 취소한 거래이면 PG 취소 없이 주문 취소만 진행한다.
$pre_inquiry = inicis_pro_inquiry($pre_od['od_tno'], $pre_od['od_id'], $pro_summary);
$pre_inquiry_data = isset($pre_inquiry['data']) && is_array($pre_inquiry['data']) ? $pre_inquiry['data'] : array();
$pre_pg_status = isset($pre_inquiry_data['status']) ? strtoupper(preg_replace('/[^A-Za-z0-9_]/', '', (string) $pre_inquiry_data['status'])) : '';
if (!empty($pre_inquiry['success']) && in_array($pre_pg_status, array('1', 'C', 'CANCEL', 'DEPOSIT_CANCELED', 'REFUND_COMPLETED'))) {
inicis_pro_save_inquiry($pre_od['od_id'], $pre_inquiry, 'admin');
inicis_pro_audit_write($pre_od['od_id'], 'cancel', 'canceled', array(
'tid' => $pre_od['od_tno'],
'mid' => $pro_summary['ip_mid'],
'amount' => isset($pro_summary['ip_amount']) ? (int) $pro_summary['ip_amount'] : 0,
'pay_type' => isset($pro_summary['ip_pay_type']) ? $pro_summary['ip_pay_type'] : '',
'source' => 'admin',
'code' => $pre_pg_status,
'message' => 'KG이니시스에서 이미 취소된 거래로 확인되어 주문 취소만 진행합니다.'
));
$inicis_pro_cancel_preprocessed = true;
} else {
$pre_refunded = (int) $pre_od['od_refund_price'];
$pre_remaining = (int) $pre_od['od_receipt_price'] - $pre_refunded;
if ($pre_refunded > 0 && $pre_remaining <= 0) {
// 이전 부분취소로 결제금액이 모두 환불된 주문은 PG 취소 없이 주문 취소만 진행한다.
inicis_pro_audit_write($pre_od['od_id'], 'cancel', 'canceled', array(
'tid' => $pre_od['od_tno'],
'mid' => $pro_summary['ip_mid'],
'amount' => isset($pro_summary['ip_amount']) ? (int) $pro_summary['ip_amount'] : 0,
'pay_type' => isset($pro_summary['ip_pay_type']) ? $pro_summary['ip_pay_type'] : '',
'source' => 'admin',
'message' => '이전 부분취소로 결제금액이 모두 환불되어 주문 취소만 진행합니다.'
));
$inicis_pro_cancel_preprocessed = true;
} elseif (!isset($_POST['pg_cancel']) || (int) $_POST['pg_cancel'] !== 1) {
// PG 승인취소 없이 주문만 취소하는 선택을 이력에 남긴다. 결제는 KG이니시스에 승인 상태로 남는다.
inicis_pro_audit_write($pre_od['od_id'], 'cancel', 'canceled', array(
'tid' => $pre_od['od_tno'],
'mid' => $pro_summary['ip_mid'],
'amount' => isset($pro_summary['ip_amount']) ? (int) $pro_summary['ip_amount'] : 0,
'pay_type' => isset($pro_summary['ip_pay_type']) ? $pro_summary['ip_pay_type'] : '',
'source' => 'admin',
'message' => 'PG 승인취소 없이 주문만 취소했습니다. 결제는 KG이니시스에 남아 있습니다.',
'event_only' => '1'
));
} else {
$pro_environment = !empty($pro_summary['ip_environment']) ? $pro_summary['ip_environment'] : inicis_pro_environment();
if ($pro_summary['ip_mid'] !== inicis_pro_get_mid(!empty($pro_summary['ip_pay_type']) ? $pro_summary['ip_pay_type'] : null) || $pro_environment !== inicis_pro_environment())
alert('거래 당시 MID 또는 결제환경과 현재 설정이 달라 PG 취소를 실행할 수 없습니다. KG이니시스 상점관리자에서 원거래를 확인해 주십시오.');
include_once(G5_SHOP_PATH.'/settle_inicis.inc.php');
$pre_cancel_args = array(
'paymethod' => get_type_inicis_paymethod($pre_od['od_settle_case']),
'tid' => $pre_od['od_tno'],
'mid' => $pro_summary['ip_mid'],
'audit_oid' => $pre_od['od_id'],
'audit_source' => 'admin',
'msg' => '쇼핑몰 운영자 승인 취소',
'url' => $pro_environment === 'test' ? 'https://stginiapi.inicis.com/api/v1/refund' : 'https://iniapi.inicis.com/api/v1/refund'
);
// 부분취소 이력이 있는 거래는 전체취소 요청이 거부되므로 잔여 금액을 부분취소로 처리한다.
$pre_cancel_is_part = $pre_refunded > 0 && $pre_remaining > 0;
if ($pre_cancel_is_part) {
$pre_cancel_args['msg'] = '쇼핑몰 운영자 승인 취소(잔여금액)';
$pre_cancel_args['price'] = $pre_remaining;
$pre_cancel_args['confirmPrice'] = 0;
}
$pre_cancel_response = inicis_tid_cancel($pre_cancel_args, $pre_cancel_is_part);
$pre_cancel_result = json_decode($pre_cancel_response, true);
if (!isset($pre_cancel_result['resultCode']) || $pre_cancel_result['resultCode'] !== '00') {
$pre_cancel_code = !empty($pre_cancel_result['resultCode']) ? $pre_cancel_result['resultCode'] : 'COMMUNICATION_FAILED';
$pre_cancel_message = !empty($pre_cancel_result['resultMsg']) ? $pre_cancel_result['resultMsg'] : 'KG이니시스 취소 응답을 확인하지 못했습니다.';
alert($pre_cancel_message.' 코드 : '.$pre_cancel_code);
}
if ($pre_cancel_is_part) {
inicis_pro_audit_write($pre_od['od_id'], 'cancel', 'canceled', array(
'tid' => $pre_od['od_tno'],
'mid' => $pro_summary['ip_mid'],
'amount' => isset($pro_summary['ip_amount']) ? (int) $pro_summary['ip_amount'] : 0,
'pay_type' => isset($pro_summary['ip_pay_type']) ? $pro_summary['ip_pay_type'] : '',
'source' => 'admin',
'code' => '00',
'message' => '잔여 금액 부분취소로 전체취소를 완료했습니다.'
));
}
$inicis_pro_cancel_preprocessed = true;
}
}
}
}
}
}
}
if ($pg_cancel === 1 && in_array($ct_status, $status_cancel)) {
$nicepay_refund_order = sql_fetch(" select od_id, od_pg, od_settle_case, od_status, od_receipt_price from {$g5['g5_shop_order_table']} where od_id = '$od_id' ");
if (isset($nicepay_refund_order['od_id']) && $nicepay_refund_order['od_pg'] === 'nicepay' && $nicepay_refund_order['od_settle_case'] === '가상계좌' && is_cancel_shop_pg_order($nicepay_refund_order)) {
$nicepay_refund_required = ((int) $nicepay_refund_order['od_receipt_price'] > 0);
$nicepay_refund_inputted = ($nicepay_refund_acct_no !== '' || $nicepay_refund_bank_cd !== '' || $nicepay_refund_acct_nm !== '');
if (!$nicepay_refund_required && !$nicepay_refund_inputted) {
$nicepay_refund_acct_no = '';
$nicepay_refund_bank_cd = '';
$nicepay_refund_acct_nm = '';
} else {
if ($nicepay_refund_acct_no === '' || strlen($nicepay_refund_acct_no) > 16) {
alert('나이스페이 가상계좌 취소를 위해 환불계좌번호를 숫자 16자리 이하로 입력해 주십시오.');
}
if (!preg_match('/^[0-9]{3}$/', $nicepay_refund_bank_cd)) {
alert('나이스페이 가상계좌 취소를 위해 환불계좌코드를 숫자 3자리로 입력해 주십시오.');
}
if ($nicepay_refund_acct_nm === '') {
alert('나이스페이 가상계좌 취소를 위해 환불계좌주명을 입력해 주십시오.');
}
$nicepay_refund_acct_nm_euckr = function_exists('iconv') ? @iconv('UTF-8', 'EUC-KR//IGNORE', $nicepay_refund_acct_nm) : $nicepay_refund_acct_nm;
if (strlen($nicepay_refund_acct_nm_euckr) > 10) {
alert('나이스페이 환불계좌주명은 10 byte 이하로 입력해 주십시오.');
}
}
}
}
$search = isset($_REQUEST['search']) ? get_search_string($_REQUEST['search']) : '';
$sort1 = isset($_REQUEST['sort1']) ? clean_xss_tags($_REQUEST['sort1'], 1, 1) : '';
$sort2 = isset($_REQUEST['sort2']) ? clean_xss_tags($_REQUEST['sort2'], 1, 1) : '';
@@ -172,7 +341,7 @@ if(is_array($arr_it_id) && !empty($arr_it_id)) {
// 장바구니 상품 모두 취소일 경우 주문상태 변경
$cancel_change = false;
if (in_array($_POST['ct_status'], $status_cancel)) {
if (in_array($ct_status, $status_cancel)) {
$sql = " select count(*) as od_count1,
SUM(IF(ct_status = '취소' OR ct_status = '반품' OR ct_status = '품절', 1, 0)) as od_count2
from {$g5['g5_shop_cart_table']}
@@ -227,15 +396,19 @@ if (in_array($_POST['ct_status'], $status_cancel)) {
case 'inicis':
include_once(G5_SHOP_PATH.'/settle_inicis.inc.php');
$cancel_msg = '쇼핑몰 운영자 승인 취소';
$args = array(
'paymethod' => get_type_inicis_paymethod($od['od_settle_case']),
'tid' => $od['od_tno'],
'msg' => $cancel_msg
);
$response = inicis_tid_cancel($args);
$result = json_decode($response, true);
if ($inicis_pro_cancel_preprocessed) {
$result = array('resultCode' => '00', 'resultMsg' => 'INIpay PRO PG 취소 선처리 완료');
} else {
$args = array(
'paymethod' => get_type_inicis_paymethod($od['od_settle_case']),
'tid' => $od['od_tno'],
'msg' => $cancel_msg
);
$response = inicis_tid_cancel($args);
$result = json_decode($response, true);
}
if (isset($result['resultCode'])) {
if ($result['resultCode'] != '00') {
@@ -254,17 +427,24 @@ if (in_array($_POST['ct_status'], $status_cancel)) {
$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'];
// 0:전체 취소, 1:부분 취소(별도 계약 필요)
$partialCancelCode = 0;
if($cancelAmt <= 0) {
$pg_res_cd = 'NO_CANCEL_AMT';
$pg_res_msg = '취소 요청금액이 없습니다.';
break;
}
include G5_SHOP_PATH.'/nicepay/cancel_process.php';
if (isset($result['ResultCode'])) {
// 실패했다면
if ($result['ResultCode'] !== '2001') {
if (! in_array($result['ResultCode'], array('2001', '2211'), true)) {
$pg_res_cd = $result['ResultCode'];
$pg_res_msg = $result['ResultMsg'];
}
@@ -336,7 +516,7 @@ if (in_array($_POST['ct_status'], $status_cancel)) {
}
// 관리자 주문취소 로그
$mod_history .= G5_TIME_YMDHIS.' '.$member['mb_id'].' 주문'.$_POST['ct_status'].' 처리'.$pg_cancel_log."\n";
$mod_history .= G5_TIME_YMDHIS.' '.$member['mb_id'].' 주문'.$ct_status.' 처리'.$pg_cancel_log."\n";
}
}
@@ -364,8 +544,8 @@ if ($mod_history) { // 주문변경 히스토리 기록
if($cancel_change) {
$sql .= " , od_status = '취소' "; // 주문상품 모두 취소, 반품, 품절이면 주문 취소
} else {
if (isset($_POST['ct_status']) && in_array($_POST['ct_status'], $status_normal)) { // 정상인 주문상태만 기록
$sql .= " , od_status = '{$_POST['ct_status']}' ";
if ($ct_status && in_array($ct_status, $status_normal)) { // 정상인 주문상태만 기록
$sql .= " , od_status = '$ct_status' ";
}
}
@@ -376,6 +556,9 @@ $qstr = "sort1=$sort1&amp;sort2=$sort2&amp;sel_field=$sel_field&amp;search=$sear
$url = "./orderform.php?od_id=$od_id&amp;$qstr";
if ($inicis_pro_order_lock !== '')
inicis_pro_unlock($inicis_pro_order_lock);
// 신용카드 취소 때 오류가 있으면 알림
if($pg_cancel == 1 && $pg_res_cd && $pg_res_msg) {
alert('오류코드 : '.$pg_res_cd.' 오류내용 : '.$pg_res_msg, $url);
@@ -386,4 +569,4 @@ if($pg_cancel == 1 && $pg_res_cd && $pg_res_msg) {
alert("포인트로 결제한 주문은,\\n\\n주문상태 변경으로 인해 포인트의 가감이 발생하는 경우\\n\\n회원관리 > 포인트관리에서 수작업으로 포인트를 맞추어 주셔야 합니다.", $url);
else
goto_url($url);
}
}
+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");
+20 -18
View File
@@ -2,9 +2,11 @@
$sub_menu = '400400';
include_once('./_common.php');
auth_check_menu($auth, $sub_menu, "w");
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 +19,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 +68,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");
+2 -2
View File
@@ -305,7 +305,7 @@ if( function_exists('pg_setting_check') ){
$s_receipt_way = $s_br = "";
if ($row['od_settle_case'])
{
$s_receipt_way = check_pay_name_replace($row['od_settle_case'], $row);
$s_receipt_way = get_text(check_pay_name_replace($row['od_settle_case'], $row));
$s_br = '<br />';
}
else
@@ -402,7 +402,7 @@ if( function_exists('pg_setting_check') ){
<?php echo $row['od_status']; ?>
</td>
<td headers="odrpay" class="odrpay">
<input type="hidden" name="current_settle_case[<?php echo $i ?>]" value="<?php echo $row['od_settle_case'] ?>">
<input type="hidden" name="current_settle_case[<?php echo $i ?>]" value="<?php echo get_text($row['od_settle_case']) ?>">
<?php echo $s_receipt_way; ?>
</td>
<td headers="delino" class="delino">
+2
View File
@@ -4,6 +4,8 @@ include_once('./_common.php');
//print_r2($_POST); exit;
auth_check_menu($auth, $sub_menu, "d");
check_admin_token();
$count_post_chk = (isset($_POST['chk']) && is_array($_POST['chk'])) ? count($_POST['chk']) : 0;
+2
View File
@@ -4,6 +4,8 @@ include_once('./_common.php');
include_once('./admin.shop.lib.php');
include_once(G5_LIB_PATH.'/mailer.lib.php');
auth_check_menu($auth, $sub_menu, "w");
check_admin_token();
define("_ORDERMAIL_", true);
+11 -6
View File
@@ -21,7 +21,7 @@ if($od['od_settle_case'] == '계좌이체' && substr($od['od_receipt_time'], 0,
if($od['od_receipt_price'] - $od['od_refund_price'] <= 0)
alert_close('부분취소 처리할 금액이 없습니다.');
$g5['title'] = $od['od_settle_case'].' 부분취소';
$g5['title'] = get_text($od['od_settle_case']).' 부분취소';
include_once(G5_PATH.'/head.sub.php');
// 취소가능금액
@@ -29,10 +29,11 @@ $od_misu = abs($od['od_misu']);
?>
<form name="forderpartcancel" method="post" action="./orderpartcancelupdate.php" onsubmit="return form_check(this);">
<input type="hidden" name="token" value="<?php echo get_admin_token(); ?>">
<input type="hidden" name="od_id" value="<?php echo $od_id; ?>">
<div class="new_win">
<h1><?php echo $od['od_settle_case']; ?> 부분취소</h1>
<h1><?php echo get_text($od['od_settle_case']); ?> 부분취소</h1>
<div class="tbl_frm01 tbl_wrap">
<table>
@@ -70,14 +71,18 @@ $od_misu = abs($od['od_misu']);
</div>
</form>
<script src="<?php echo G5_ADMIN_URL ?>/admin.js"></script>
<script>
var g5_admin_csrf_token_key = "<?php echo (function_exists('admin_csrf_token_key')) ? admin_csrf_token_key() : ''; ?>";
function form_check(f)
{
var max_mny = parseInt(<?php echo $od_misu; ?>);
var tax_mny = parseInt(f.mod_tax_mny.value.replace("/[^0-9]/g", ""));
var tax_mny = parseInt(f.mod_tax_mny.value.replace(/[^0-9]/g, ""), 10) || 0;
var free_mny = 0;
if(typeof f.mod_free.mny.value != "undefined")
free_mny = parseInt(f.mod_free_mny.value.replace("/[^0-9]/g", ""));
if(typeof f.mod_free_mny != "undefined")
free_mny = parseInt(f.mod_free_mny.value.replace(/[^0-9]/g, ""), 10) || 0;
if(!tax_mny && !free_mny) {
alert("과세 취소금액 또는 비과세 취소금액을 입력해 주십시오.");
@@ -104,4 +109,4 @@ function form_check(f)
</script>
<?php
include_once(G5_PATH.'/tail.sub.php');
include_once(G5_PATH.'/tail.sub.php');
+4 -2
View File
@@ -6,6 +6,8 @@ auth_check_menu($auth, $sub_menu, "w");
check_admin_token();
$od_id = isset($_POST['od_id']) ? safe_replace_regex($_POST['od_id'], 'od_id') : '';
$mod_memo = isset($_POST['mod_memo']) ? trim(clean_xss_tags($_POST['mod_memo'], 1, 1)) : '';
$tax_mny = isset($_POST['mod_tax_mny']) ? preg_replace('/[^0-9]/', '', $_POST['mod_tax_mny']) : 0;
$free_mny = isset($_POST['mod_free_mny']) ? preg_replace('/[^0-9]/', '', $_POST['mod_free_mny']) : 0;
@@ -44,10 +46,10 @@ include_once(G5_PATH.'/head.sub.php');
?>
<script>
alert("<?php echo $od['od_settle_case']; ?> 부분취소 처리됐습니다.");
alert("<?php echo get_text($od['od_settle_case']); ?> 부분취소 처리됐습니다.");
opener.document.location.reload();
self.close();
</script>
<?php
include_once(G5_PATH.'/tail.sub.php');
include_once(G5_PATH.'/tail.sub.php');
+2
View File
@@ -4,6 +4,8 @@ include_once('./_common.php');
auth_check_menu($auth, $sub_menu, 'w');
if (function_exists('check_request_origin')) check_request_origin(G5_ADMIN_URL);
$_POST = array_map('trim', $_POST);
if(!$_POST['pp_name'])
+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);
+8
View File
@@ -6,6 +6,11 @@ auth_check_menu($auth, $sub_menu, "r");
$sql_common = " from {$g5['g5_shop_personalpay_table']} ";
$allowed_sfl = array('pp_id', 'pp_name', 'od_id');
if (!in_array($sfl, $allowed_sfl)) {
$sfl = 'pp_id';
}
$sql_search = " where (1) ";
if ($stx) {
$sql_search .= " and ( ";
@@ -27,6 +32,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);
+3 -1
View File
@@ -2,7 +2,9 @@
$sub_menu = "900600";
include_once('./_common.php');
auth_check_menu($auth, $sub_menu, "r");
auth_check_menu($auth, $sub_menu, "w");
if (function_exists('check_request_origin')) check_request_origin(G5_ADMIN_URL);
$post_chk_fg_no = (isset($_POST['chk_fg_no']) && is_array($_POST['chk_fg_no'])) ? $_POST['chk_fg_no'] : array();
+2
View File
@@ -4,6 +4,8 @@ include_once("./_common.php");
auth_check_menu($auth, $sub_menu, "w");
if (function_exists('check_request_origin')) check_request_origin(G5_ADMIN_URL);
$post_cnk = (isset($_POST['chk']) && is_array($_POST['chk'])) ? $_POST['chk'] : array();
if ($w == 'u') // 업데이트
+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);
+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;
+3 -1
View File
@@ -4,7 +4,9 @@ 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) : '';
if (function_exists('check_request_origin')) check_request_origin(G5_ADMIN_URL);
$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)
+2
View File
@@ -4,6 +4,8 @@ include_once("./_common.php");
auth_check_menu($auth, $sub_menu, "w");
if (function_exists('check_request_origin')) check_request_origin(G5_ADMIN_URL);
$g5['title'] = "전화번호부";
$post_bk_no = (isset($_POST['bk_no']) && is_array($_POST['bk_no'])) ? $_POST['bk_no'] : array();
+2
View File
@@ -4,6 +4,8 @@ include_once("./_common.php");
auth_check_menu($auth, $sub_menu, "w");
if (function_exists('check_request_origin')) check_request_origin(G5_ADMIN_URL);
$g5['title'] = "휴대폰번호 업데이트";
$g5['sms5_demo'] = 0;
+7 -5
View File
@@ -6,6 +6,8 @@ $post_chk = (isset($_POST['chk']) && is_array($_POST['chk'])) ? $_POST['chk'] :
auth_check_menu($auth, $sub_menu, "w");
if (function_exists('check_request_origin')) check_request_origin(G5_ADMIN_URL);
if ($w == 'u') // 업데이트
{
for ($i=0; $i<count($post_chk); $i++)
@@ -13,7 +15,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 +67,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');
+3 -1
View File
@@ -2,7 +2,9 @@
$sub_menu = "900800";
include_once('./_common.php');
auth_check_menu($auth, $sub_menu, "r");
auth_check_menu($auth, $sub_menu, "w");
if (function_exists('check_request_origin')) check_request_origin(G5_ADMIN_URL);
$post_chk_bg_no = isset($_POST['chk_bg_no']) ? $_POST['chk_bg_no'] : array();
+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) : '';
+2
View File
@@ -6,6 +6,8 @@ check_demo();
auth_check_menu($auth, $sub_menu, 'd');
if (function_exists('check_request_origin')) check_request_origin(G5_ADMIN_URL);
if ($is_admin != 'super')
alert('최고관리자만 접근 가능합니다.');
+3 -2
View File
@@ -58,6 +58,7 @@ for ($i=0; $row=sql_fetch_array($result); $i++) {
if (count($arr)) {
foreach ($arr as $key=>$value) {
$count = $value;
$last_date = date('Y-m-t', strtotime($key.'-01'));
$rate = ($count / $sum_count * 100);
$s_rate = number_format($rate, 1);
@@ -66,7 +67,7 @@ for ($i=0; $row=sql_fetch_array($result); $i++) {
?>
<tr class="<?php echo $bg; ?>">
<td class="td_category"><a href="./visit_date.php?fr_date=<?php echo $key ?>-01&amp;to_date=<?php echo $key ?>-31"><?php echo $key ?></a></td>
<td class="td_category"><a href="./visit_date.php?fr_date=<?php echo $key ?>-01&amp;to_date=<?php echo $last_date ?>"><?php echo $key ?></a></td>
<td>
<div class="visit_bar">
<span style="width:<?php echo $s_rate ?>%"></span>
@@ -91,4 +92,4 @@ for ($i=0; $row=sql_fetch_array($result); $i++) {
</div>
<?php
include_once('./admin.tail.php');
include_once('./admin.tail.php');
+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.'">';
}
+2 -1
View File
@@ -9,7 +9,8 @@ if (G5_IS_MOBILE) {
} else {
// 상단 파일 경로를 입력하지 않았다면 기본 상단 파일도 include 하지 않음
if (trim($board['bo_include_head'])) {
if (is_include_path_check($board['bo_include_head'])) { //파일경로 체크
if (is_include_path_check($board['bo_include_head'])
&& (!function_exists('is_content_include_allowed') || is_content_include_allowed($board['bo_include_head']))) { //파일경로 체크
@include ($board['bo_include_head']);
} else { //파일경로가 올바르지 않으면 기본파일을 가져옴
include_once(G5_BBS_PATH.'/_head.php');
+2 -1
View File
@@ -10,7 +10,8 @@ if (G5_IS_MOBILE) {
echo run_replace('board_content_tail', html_purifier(stripslashes($board['bo_content_tail'])), $board);
// 하단 파일 경로를 입력하지 않았다면 기본 하단 파일도 include 하지 않음
if (trim($board['bo_include_tail'])) {
if (is_include_path_check($board['bo_include_tail'])) { //파일경로 체크
if (is_include_path_check($board['bo_include_tail'])
&& (!function_exists('is_content_include_allowed') || is_content_include_allowed($board['bo_include_tail']))) { //파일경로 체크
@include ($board['bo_include_tail']);
} else { //파일경로가 올바르지 않으면 기본파일을 가져옴
include_once(G5_BBS_PATH.'/_tail.php');
+4 -2
View File
@@ -31,7 +31,8 @@ if (! (isset($co['co_id']) && $co['co_id']))
$g5['title'] = $co['co_subject'];
if ($co['co_include_head'] && is_include_path_check($co['co_include_head']))
if ($co['co_include_head'] && is_include_path_check($co['co_include_head'])
&& (!function_exists('is_content_include_allowed') || is_content_include_allowed($co['co_include_head'])))
@include_once($co['co_include_head']);
else
include_once('./_head.php');
@@ -99,7 +100,8 @@ if(is_file($skin_file)) {
echo '<p>'.str_replace(G5_PATH.'/', '', $skin_file).'이 존재하지 않습니다.</p>';
}
if ($co['co_include_tail'] && is_include_path_check($co['co_include_tail']))
if ($co['co_include_tail'] && is_include_path_check($co['co_include_tail'])
&& (!function_exists('is_content_include_allowed') || is_content_include_allowed($co['co_include_tail'])))
@include_once($co['co_include_tail']);
else
include_once('./_tail.php');
+1 -1
View File
@@ -18,7 +18,7 @@ for ($i=0; $row=sql_fetch_array($result); $i++) {
if ($row['mb_id']) {
$list[$i]['name'] = get_sideview($row['mb_id'], cut_str($row['mb_nick'], $config['cf_cut_name']), $row['mb_email'], $row['mb_homepage']);
} else {
if ($is_admin)
if ($is_admin === 'super')
$list[$i]['name'] = $row['lo_ip'];
else
$list[$i]['name'] = preg_replace("/([0-9]+).([0-9]+).([0-9]+).([0-9]+)/", G5_IP_DISPLAY, $row['lo_ip']);
+2 -1
View File
@@ -61,7 +61,8 @@ else if ($w == 'd')
if ($member['mb_id'] || $is_admin == 'super')
{
$sql = " delete from {$g5['poll_etc_table']} where pc_id = '{$pc_id}' ";
if (!$is_admin)
// 최고관리자가 아니면 본인 기타의견만 삭제 (게시판/그룹 관리자 문맥으로 우회 불가)
if ($is_admin !== 'super')
$sql .= " and mb_id = '{$member['mb_id']}' ";
sql_query($sql);
}
+15 -1
View File
@@ -11,11 +11,25 @@ $no = isset($_REQUEST['no']) ? (int) $_REQUEST['no'] : 0;
if (!get_session('ss_qa_view_'.$qa_id))
alert('잘못된 접근입니다.');
$sql = " select qa_subject, qa_file{$no}, qa_source{$no} from {$g5['qa_content_table']} where qa_id = '$qa_id' ";
$sql = " select qa_subject, mb_id, qa_type, qa_parent, qa_file{$no}, qa_source{$no} from {$g5['qa_content_table']} where qa_id = '$qa_id' ";
$file = sql_fetch($sql);
if (!$file['qa_file'.$no])
alert_close('파일 정보가 존재하지 않습니다.');
// 세션 표식만으로는 권한을 보장하지 못하므로 문의 스레드의 실제 소유자를 다시 확인
if ($is_admin !== 'super') {
if ($file['qa_type']) {
// 답변 첨부는 부모 질문의 소유자를 기준으로 판정
$parent = sql_fetch(" select mb_id from {$g5['qa_content_table']} where qa_id = '{$file['qa_parent']}' ");
$thread_owner = isset($parent['mb_id']) ? $parent['mb_id'] : '';
} else {
$thread_owner = $file['mb_id'];
}
if (! ($is_member && $thread_owner !== '' && $thread_owner === $member['mb_id']))
alert('다운로드 권한이 없습니다.');
}
if($is_guest) {
alert('다운로드 권한이 없습니다.\\n회원이시라면 로그인 후 이용해 보십시오.', G5_BBS_URL.'/login.php?url='.urlencode(G5_BBS_URL.'/qaview.php?qa_id='.$qa_id));
}
+2 -1
View File
@@ -9,7 +9,8 @@ if (G5_IS_MOBILE) {
include_once('./_head.php');
echo run_replace('qa_mobile_content_head', conv_content($qaconfig['qa_mobile_content_head'], 1), $qaconfig);
} else {
if($qaconfig['qa_include_head'] && is_include_path_check($qaconfig['qa_include_head']))
if($qaconfig['qa_include_head'] && is_include_path_check($qaconfig['qa_include_head'])
&& (!function_exists('is_content_include_allowed') || is_content_include_allowed($qaconfig['qa_include_head'])))
@include ($qaconfig['qa_include_head']);
else
include ('./_head.php');
+2 -1
View File
@@ -47,7 +47,8 @@ if(is_file($skin_file)) {
$sql_common = " from {$g5['qa_content_table']} ";
$sql_search = " where qa_type = '0' ";
if(!$is_admin)
// 최고관리자가 아니면 본인 문의만 조회 (게시판/그룹 관리자 문맥으로 우회 불가)
if($is_admin !== 'super')
$sql_search .= " and mb_id = '{$member['mb_id']}' ";
if($sca) {
+2 -1
View File
@@ -7,7 +7,8 @@ if (G5_IS_MOBILE) {
include_once('./_tail.php');
} else {
echo run_replace('qa_content_tail', conv_content($qaconfig['qa_content_tail'], 1), $qaconfig);
if($qaconfig['qa_include_tail'] && is_include_path_check($qaconfig['qa_include_tail']))
if($qaconfig['qa_include_tail'] && is_include_path_check($qaconfig['qa_include_tail'])
&& (!function_exists('is_content_include_allowed') || is_content_include_allowed($qaconfig['qa_include_tail'])))
@include ($qaconfig['qa_include_tail']);
else
include ('./_tail.php');
+2 -2
View File
@@ -21,7 +21,7 @@ $skin_file = $qa_skin_path.'/view.skin.php';
if(is_file($skin_file)) {
$sql = " select * from {$g5['qa_content_table']} where qa_id = '$qa_id' ";
if(!$is_admin) {
if($is_admin !== 'super') {
$sql .= " and mb_id = '{$member['mb_id']}' ";
}
@@ -50,7 +50,7 @@ if(is_file($skin_file)) {
$sql = " select qa_id, qa_subject
from {$g5['qa_content_table']}
where qa_type = '0' ";
if(!$is_admin) {
if($is_admin !== 'super') {
$sql .= " and mb_id = '{$member['mb_id']}' ";
}
+4 -3
View File
@@ -98,11 +98,12 @@ for ($i=1; $i<=5; $i++) {
}
if($w == 'u' || $w == 'a' || $w == 'r') {
if($w == 'a' && !$is_admin)
if($w == 'a' && $is_admin !== 'super')
alert('답변은 관리자만 등록할 수 있습니다.');
$sql = " select * from {$g5['qa_content_table']} where qa_id = '$qa_id' ";
if(!$is_admin) {
// 최고관리자가 아니면 본인 문의만 대상으로 (게시판/그룹 관리자 문맥으로 우회 불가)
if($is_admin !== 'super') {
$sql .= " and mb_id = '{$member['mb_id']}' ";
}
@@ -112,7 +113,7 @@ if($w == 'u' || $w == 'a' || $w == 'r') {
if(!$write['qa_id'])
alert('게시글이 존재하지 않습니다.\\n삭제되었거나 자신의 글이 아닌 경우입니다.');
if(!$is_admin) {
if($is_admin !== 'super') {
if($write['qa_type'] == 0 && $write['qa_status'] == 1)
alert('답변이 등록된 문의글은 수정할 수 없습니다.');
+6
View File
@@ -74,6 +74,10 @@ $mb_addr2 = addslashes(clean_xss_tags(stripslashes($mb_addr2), 1, 1));
$mb_addr3 = addslashes(clean_xss_tags(stripslashes($mb_addr3), 1, 1));
$mb_addr_jibeon = preg_match("/^(N|R|J)$/", $mb_addr_jibeon) ? $mb_addr_jibeon : '';
for ($i = 1; $i <= 10; $i++) {
${'mb_' . $i} = addslashes(clean_xss_tags(stripslashes(${'mb_' . $i}), 1, 1));
}
$mb_marketing_agree = isset($_POST['mb_marketing_agree']) ? trim($_POST['mb_marketing_agree']) : "0";
$mb_thirdparty_agree = isset($_POST['mb_thirdparty_agree']) ? trim($_POST['mb_thirdparty_agree']) : "0";
@@ -642,6 +646,8 @@ if($w == '' && isset($default['de_member_reg_coupon_use']) && $default['de_membe
if($j > 20)
break;
}
$j++;
} while(1);
if($create_coupon) {
+4
View File
@@ -125,6 +125,10 @@ $_REQUEST = array_map_deep(G5_ESCAPE_FUNCTION, $_REQUEST);
// PHP 4.1.0 부터 지원됨
// php.ini 의 register_globals=off 일 경우
// 관리자 메뉴 코드는 각 스크립트가 직접 지정하므로 요청값이 개입하지 못하게 한다.
unset($_GET['sub_menu'], $_POST['sub_menu'], $_REQUEST['sub_menu'], $_SERVER['sub_menu']);
@extract($_GET);
@extract($_POST);
@extract($_SERVER);
+97
View File
@@ -354,6 +354,14 @@ CREATE TABLE IF NOT EXISTS `g5_shop_default` (
`de_inicis_iniapi_key` varchar(30) NOT NULL DEFAULT '',
`de_inicis_iniapi_iv` varchar(30) NOT NULL DEFAULT '',
`de_inicis_sign_key` varchar(255) NOT NULL DEFAULT '',
`de_inicis_pro_use` tinyint(4) NOT NULL DEFAULT '0',
`de_inicis_hash_key` varchar(255) NOT NULL DEFAULT '',
`de_inicis_pro_alert_use` tinyint(4) NOT NULL DEFAULT '1',
`de_inicis_pro_reconcile_use` tinyint(4) NOT NULL DEFAULT '0',
`de_inicis_pro_log_days` int(11) NOT NULL DEFAULT '365',
`de_inicis_pro_summary_days` int(11) NOT NULL DEFAULT '1825',
`de_inicis_pro_monitor_at` datetime DEFAULT NULL,
`de_inicis_pro_monitor_message` varchar(255) NOT NULL DEFAULT '',
`de_iche_use` tinyint(4) NOT NULL DEFAULT '0',
`de_easy_pay_use` tinyint(4) NOT NULL DEFAULT '0',
`de_easy_pay_services` varchar(255) NOT NULL DEFAULT '',
@@ -888,3 +896,92 @@ CREATE TABLE IF NOT EXISTS `g5_shop_inicis_log` (
`is_mail_send` tinyint(4) NOT NULL DEFAULT '1',
PRIMARY KEY (`oid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `g5_shop_inicis_pay`
--
DROP TABLE IF EXISTS `g5_shop_inicis_pay`;
CREATE TABLE IF NOT EXISTS `g5_shop_inicis_pay` (
`ip_id` int(11) NOT NULL AUTO_INCREMENT,
`ip_oid` varchar(64) NOT NULL DEFAULT '',
`ip_tid` varchar(80) NOT NULL DEFAULT '',
`ip_auth_tid` varchar(80) NOT NULL DEFAULT '',
`ip_mid` varchar(80) NOT NULL DEFAULT '',
`ip_environment` varchar(10) NOT NULL DEFAULT '',
`mb_id` varchar(20) NOT NULL DEFAULT '',
`ip_amount` int(11) NOT NULL DEFAULT '0',
`ip_pay_type` varchar(20) NOT NULL DEFAULT '',
`ip_easy_pay` varchar(20) NOT NULL DEFAULT '',
`ip_device` varchar(10) NOT NULL DEFAULT '',
`ip_order_type` varchar(10) NOT NULL DEFAULT '',
`ip_status` varchar(30) NOT NULL DEFAULT '',
`ip_result_code` varchar(30) NOT NULL DEFAULT '',
`ip_result_message` varchar(255) NOT NULL DEFAULT '',
`ip_noti_status` varchar(30) NOT NULL DEFAULT '',
`ip_noti_code` varchar(30) NOT NULL DEFAULT '',
`ip_noti_message` varchar(255) NOT NULL DEFAULT '',
`ip_noti_failed_count` int(11) NOT NULL DEFAULT '0',
`ip_noti_at` datetime DEFAULT NULL,
`ip_cancel_status` varchar(30) NOT NULL DEFAULT '',
`ip_cancel_code` varchar(30) NOT NULL DEFAULT '',
`ip_cancel_message` varchar(255) NOT NULL DEFAULT '',
`ip_cancel_checked_at` datetime DEFAULT NULL,
`ip_refund_required` tinyint(4) NOT NULL DEFAULT '0',
`ip_vbank_due_at` datetime DEFAULT NULL,
`ip_expired_at` datetime DEFAULT NULL,
`ip_order_exists` tinyint(4) NOT NULL DEFAULT '0',
`ip_approved_at` datetime DEFAULT NULL,
`ip_ordered_at` datetime DEFAULT NULL,
`ip_notified_at` datetime DEFAULT NULL,
`ip_canceled_at` datetime DEFAULT NULL,
`ip_created_at` datetime DEFAULT NULL,
`ip_updated_at` datetime DEFAULT NULL,
`ip_ip` varchar(45) NOT NULL DEFAULT '',
`ip_event_count` int(11) NOT NULL DEFAULT '0',
`ip_audit_error` tinyint(4) NOT NULL DEFAULT '0',
`ip_alerted_at` datetime DEFAULT NULL,
`ip_alert_key` varchar(64) NOT NULL DEFAULT '',
`ip_pg_status` varchar(30) NOT NULL DEFAULT '',
`ip_pg_amount` int(11) NOT NULL DEFAULT '0',
`ip_pg_tid` varchar(80) NOT NULL DEFAULT '',
`ip_pg_result_code` varchar(30) NOT NULL DEFAULT '',
`ip_pg_message` varchar(255) NOT NULL DEFAULT '',
`ip_pg_checked_at` datetime DEFAULT NULL,
PRIMARY KEY (`ip_id`),
UNIQUE KEY `ip_oid` (`ip_oid`),
KEY `ip_tid` (`ip_tid`),
KEY `ip_auth_tid` (`ip_auth_tid`),
KEY `ip_status` (`ip_status`),
KEY `ip_noti_status` (`ip_noti_status`),
KEY `ip_cancel_status` (`ip_cancel_status`),
KEY `ip_refund_required` (`ip_refund_required`),
KEY `ip_updated_at` (`ip_updated_at`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `g5_shop_inicis_pay_event`
--
DROP TABLE IF EXISTS `g5_shop_inicis_pay_event`;
CREATE TABLE IF NOT EXISTS `g5_shop_inicis_pay_event` (
`pe_id` int(11) NOT NULL AUTO_INCREMENT,
`ip_oid` varchar(64) NOT NULL DEFAULT '',
`ip_tid` varchar(80) NOT NULL DEFAULT '',
`pe_stage` varchar(30) NOT NULL DEFAULT '',
`pe_status` varchar(30) NOT NULL DEFAULT '',
`pe_code` varchar(30) NOT NULL DEFAULT '',
`pe_message` varchar(255) NOT NULL DEFAULT '',
`pe_source` varchar(10) NOT NULL DEFAULT '',
`pe_ip` varchar(45) NOT NULL DEFAULT '',
`pe_created_at` datetime DEFAULT NULL,
PRIMARY KEY (`pe_id`),
KEY `ip_oid` (`ip_oid`),
KEY `ip_tid` (`ip_tid`),
KEY `pe_status` (`pe_status`),
KEY `pe_created_at` (`pe_created_at`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+2
View File
@@ -660,6 +660,8 @@ if($g5_shop_install) {
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, "\$g5['g5_shop_inicis_pay_table'] = G5_SHOP_TABLE_PREFIX.'inicis_pay'; // 이니시스 결제 처리 현황 테이블\n");
install_file_write($f, "\$g5['g5_shop_inicis_pay_event_table'] = G5_SHOP_TABLE_PREFIX.'inicis_pay_event'; // 이니시스 결제 처리 이력 테이블\n");
}
install_file_write($f, "?>");
+29
View File
@@ -924,6 +924,8 @@ function get_write($write_table, $wr_id, $is_cache=false)
{
global $g5, $g5_object;
$wr_id = (int) $wr_id;
$wr_bo_table = preg_replace('/^'.preg_quote($g5['write_prefix']).'/i', '', $write_table);
$write = $g5_object->get('bbs', $wr_id, $wr_bo_table);
@@ -4851,6 +4853,33 @@ function filter_input_include_path($path){
return str_replace('//', '/', strip_tags($path));
}
// 콘텐츠 상단/하단 include 대상이 템플릿 파일인지 실행 직전 재확인한다.
// 승인 확장자만 허용하고, 업로드가 저장되는 data 디렉터리로 귀결되는 경로는 거부한다.
function is_content_include_allowed($path){
if( !is_string($path) || $path === '' ){
return false;
}
$ext = strtolower(pathinfo($path, PATHINFO_EXTENSION));
if( !in_array($ext, array('php', 'htm', 'html')) ){
return false;
}
$real = @realpath($path);
if( $real !== false && defined('G5_DATA_PATH') ){
$data_real = @realpath(G5_DATA_PATH);
if( $data_real !== false ){
$real_norm = str_replace('\\', '/', $real);
$data_norm = rtrim(str_replace('\\', '/', $data_real), '/').'/';
if( strpos($real_norm, $data_norm) === 0 ){
return false;
}
}
}
return true;
}
function option_array_checked($option, $arr=array()){
$checked = '';

Some files were not shown because too many files have changed in this diff Show More