Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9aadcf3e99 | ||
|
|
0d247c542c | ||
|
|
148d748c2d | ||
|
|
de7063192e | ||
|
|
e2d215c368 | ||
|
|
c4cd61c916 | ||
|
|
f7aa440a80 | ||
|
|
2517343d51 | ||
|
|
6dec001465 | ||
|
|
062b33dde3 | ||
|
|
97b5d7e122 | ||
|
|
40096220e2 | ||
|
|
7a80ae913d | ||
|
|
560aa0af47 | ||
|
|
6d4e75e1c9 | ||
|
|
77e0cda39b | ||
|
|
cf8fc646ea | ||
|
|
e769d11b79 | ||
|
|
b356b3710c | ||
|
|
1ec79e8e33 | ||
|
|
5bd9cd2d17 | ||
|
|
e4bd69ab82 | ||
|
|
ff8e8741b3 | ||
|
|
ded3349bfc | ||
|
|
93b4352891 | ||
|
|
53b954b47f | ||
|
|
3510a03f57 | ||
|
|
83e3c00a05 | ||
|
|
2adaa0a658 | ||
|
|
a9ba776ef0 | ||
|
|
76b1122430 | ||
|
|
313f1daeb0 | ||
|
|
873839add7 | ||
|
|
65875b7f35 | ||
|
|
fcc749bde3 | ||
|
|
639b788ad1 | ||
|
|
69709a79a7 | ||
|
|
672d05f968 | ||
|
|
d0f136cca0 | ||
|
|
fd303da77a | ||
|
|
e784186b0f | ||
|
|
e74486e171 | ||
|
|
545e6a504d | ||
|
|
1da82df500 | ||
|
|
5bdbf360b0 | ||
|
|
d111100856 | ||
|
|
7b3c2e845b | ||
|
|
c91b74d991 | ||
|
|
7ec4d3a66c | ||
|
|
05fe1b0cdb | ||
|
|
0242e8f1a3 | ||
|
|
4e8474f231 | ||
|
|
71209fc7c9 | ||
|
|
375a8336e8 | ||
|
|
120d2960f2 | ||
|
|
9659cceae6 | ||
|
|
7e42eb78e4 | ||
|
|
e475219115 | ||
|
|
c70260c8cf | ||
|
|
bb6ed59052 | ||
|
|
d4dddaca57 | ||
|
|
0080b199ea | ||
|
|
ebd18b6001 | ||
|
|
04a4de4923 | ||
|
|
96df43480b | ||
|
|
6571119db6 | ||
|
|
35acbfa750 | ||
|
|
d9c21ea018 | ||
|
|
68be1c1f86 | ||
|
|
ff1f6d723b | ||
|
|
bb4d345add | ||
|
|
3678b92b2f | ||
|
|
c8d51529d1 | ||
|
|
129d0ea766 | ||
|
|
d80289ff28 | ||
|
|
c4b54a6219 | ||
|
|
8e7ec335c3 | ||
|
|
5a36b2d85d | ||
|
|
2b21804111 | ||
|
|
a21f3103bb | ||
|
|
f7106379b8 | ||
|
|
f4d184979f | ||
|
|
f6ec58ca18 | ||
|
|
a0e86f2bc8 | ||
|
|
4ecacec171 | ||
|
|
913d1c66c7 | ||
|
|
42859072eb | ||
|
|
0ae67a652c | ||
|
|
516eac386f | ||
|
|
188d0e30a0 | ||
|
|
c450f8bbde | ||
|
|
b3aa81c74a | ||
|
|
11a26c82af | ||
|
|
43f626885e | ||
|
|
0b6f081f76 | ||
|
|
adbd9c3acc | ||
|
|
8fcbd2a9b1 | ||
|
|
f8c06a26cb | ||
|
|
1fd5ec46ae | ||
|
|
cbd70fbe18 | ||
|
|
bc07b8383e | ||
|
|
23c60a8ba1 | ||
|
|
abb777016d | ||
|
|
e45bd1d9e1 | ||
|
|
acdbcfd8ba | ||
|
|
1f48f6bd80 | ||
|
|
87d86d317e | ||
|
|
7fa554f396 | ||
|
|
6bc322c9d6 | ||
|
|
43fba4407d | ||
|
|
3d7fa04569 | ||
|
|
82ee3ef438 | ||
|
|
4049c6c164 | ||
|
|
f80ed3946f | ||
|
|
d7d5f26524 | ||
|
|
e0a42d8f46 | ||
|
|
6c6787ec1f | ||
|
|
d419f430a9 | ||
|
|
1a5661a995 | ||
|
|
8a5767dc70 | ||
|
|
935ea84c7c | ||
|
|
1cade844fb | ||
|
|
dfca17a599 | ||
|
|
5ed691136d | ||
|
|
cdda832081 | ||
|
|
5374fb5f74 | ||
|
|
16a8dca6f7 | ||
|
|
b00fc18275 | ||
|
|
0c6ff731f6 | ||
|
|
77835010df | ||
|
|
33416852fc | ||
|
|
3a4612420c | ||
|
|
6a55f1457d | ||
|
|
76d83c2bae | ||
|
|
afd8b35423 | ||
|
|
e7c89675b6 | ||
|
|
10c6c18857 | ||
|
|
3e002199d5 | ||
|
|
7dde02d396 | ||
|
|
31871ee3e6 | ||
|
|
ff9a7534ed | ||
|
|
9869be5970 | ||
|
|
1fa4467cd1 | ||
|
|
3e75ccea65 | ||
|
|
be9f50f96b | ||
|
|
7c217cb41b | ||
|
|
5fc1c3bc27 | ||
|
|
d707c5abac | ||
|
|
eeea46cb69 | ||
|
|
669cce7011 | ||
|
|
ee8b57eb13 | ||
|
|
c927925a05 | ||
|
|
d914a7843d | ||
|
|
c04591e24a | ||
|
|
a6fbbe6ad2 | ||
|
|
4c00c60006 | ||
|
|
56b1958d37 | ||
|
|
6b2f9e094c | ||
|
|
a781b4aef3 | ||
|
|
8be4476f56 | ||
|
|
59d0b3c19c | ||
|
|
f4f8c57a74 | ||
|
|
d5619707bc | ||
|
|
9e7465319b | ||
|
|
f1f2150c67 | ||
|
|
3de722d3df | ||
|
|
7119b4f612 | ||
|
|
efaefbbd0e | ||
|
|
b12bf551ec | ||
|
|
65a419e9cd | ||
|
|
3f32ecd3e6 | ||
|
|
b5d218d446 | ||
|
|
f2e7dbc5ed | ||
|
|
c38de4c94b | ||
|
|
7d8a660642 | ||
|
|
5875e8b86b | ||
|
|
68a5b9c25a | ||
|
|
2dff49914b | ||
|
|
51518e45e4 | ||
|
|
7883ff65dc | ||
|
|
a2608754bd | ||
|
|
758bb67b7b | ||
|
|
0037f72cce | ||
|
|
df940f8168 | ||
|
|
614b040960 | ||
|
|
dccb50d8a3 | ||
|
|
5331aa8be5 | ||
|
|
79f915988b | ||
|
|
3cfe8b6b84 | ||
|
|
31ef78e916 | ||
|
|
a612e69d3e | ||
|
|
29e55de1fa | ||
|
|
c4db6e7751 | ||
|
|
47a3790c57 | ||
|
|
2894c269ea | ||
|
|
c00c73465a | ||
|
|
3e0e8be6da | ||
|
|
92a052fa7a | ||
|
|
4ebdd8ba30 | ||
|
|
4d5c597665 | ||
|
|
7e65a297bf | ||
|
|
ddcc82d89b | ||
|
|
ad99ea7673 | ||
|
|
b3fa6dc127 |
@@ -1,2 +1,6 @@
|
||||
.gitattributes export-ignore
|
||||
.gitignore export-ignore
|
||||
*.php whitespace=blank-at-eol,blank-at-eof,space-before-tab,cr-at-eol
|
||||
|
||||
/tests export-ignore
|
||||
/bin export-ignore
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
/.htaccess
|
||||
data/
|
||||
test/
|
||||
/tests/
|
||||
/bin/
|
||||
sirgle/
|
||||
test.php
|
||||
*.key
|
||||
@@ -23,6 +25,7 @@ g5_tree/
|
||||
.DS_Store
|
||||
*.swp
|
||||
*.swo
|
||||
CLAUDE.local.md
|
||||
naver*.html
|
||||
initests01/
|
||||
SIRsoft000/
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
# 저장소 작업 지침
|
||||
|
||||
## 적용 범위
|
||||
|
||||
이 문서는 저장소 루트와 모든 하위 디렉터리에 적용한다.
|
||||
|
||||
## 문서 작성 언어
|
||||
|
||||
- README, 보안 정책, 설치 안내, 개발 가이드 등 저장소 문서는 원칙적으로 한국어로 작성한다.
|
||||
- 파일명, 코드 식별자, 명령어, API 명칭, 설정값과 외부 서비스의 고유 명칭은 원문을 유지한다.
|
||||
- 영문 문서나 번역본이 별도로 필요한 경우에는 해당 작업에서 명시적으로 요청된 범위에 한해 추가한다.
|
||||
|
||||
## 커밋 메시지
|
||||
|
||||
- 커밋 메시지는 한국어로 작성한다.
|
||||
- 제목은 `<접두어>: <변경 내용>` 형식을 사용한다.
|
||||
- 접두어는 아래 권장 목록에서 변경 목적에 가장 가까운 항목을 선택한다.
|
||||
- 변경 대상을 포함해 무엇을 왜 변경했는지 알 수 있도록 구체적으로 작성한다.
|
||||
- `수정`, `업데이트`, `작업`처럼 변경 내용을 식별하기 어려운 표현만 사용하지 않는다.
|
||||
- 하나의 커밋에는 가능한 한 하나의 목적에 해당하는 변경만 포함한다.
|
||||
- 제목만으로 설명이 부족하면 본문에 변경 이유, 영향 범위와 검증 방법을 추가한다.
|
||||
- 관련 이슈가 있으면 커밋 본문이나 꼬리말에 이슈 번호를 기록한다.
|
||||
|
||||
### 권장 접두어
|
||||
|
||||
- `feat`: 새로운 기능 추가
|
||||
- `fix`: 버그 또는 잘못된 동작 수정
|
||||
- `security`: 보안 취약점 수정이나 보안 강화
|
||||
- `docs`: 문서 추가 또는 변경
|
||||
- `refactor`: 동작 변경 없는 코드 구조 개선
|
||||
- `perf`: 성능 개선
|
||||
- `test`: 테스트 추가 또는 변경
|
||||
- `build`: 빌드 시스템이나 의존성 변경
|
||||
- `ci`: CI/CD 설정이나 자동화 변경
|
||||
- `chore`: 기능과 직접 관련 없는 유지보수 작업
|
||||
- `revert`: 이전 변경 되돌리기
|
||||
|
||||
### 보안 이슈 식별자
|
||||
|
||||
- KVE, CVE 등 식별자가 부여된 보안 이슈를 조치하는 커밋은 제목에 관련 식별자를 반드시 병기한다.
|
||||
- 식별자는 `security:` 접두어 바로 뒤에 원문 그대로 작성한다.
|
||||
- 하나의 커밋이 여러 보안 이슈를 함께 조치하면 관련 식별자를 모두 병기한다.
|
||||
- 예: `security: KVE-2026-1909 모바일 KCP Windows 명령 인자 주입 차단`
|
||||
|
||||
### 작성 예시
|
||||
|
||||
- `docs: Git과 압축파일 설치 절차를 구분해 README에 안내`
|
||||
- `fix: 품목 일부 취소 시 PG 취소금액 불일치 수정`
|
||||
- `security: KVE-2026-1899 상품 정렬값 화이트리스트 검증으로 SQL 삽입 차단`
|
||||
- `refactor: 객체 캐시의 유형별 저장 키 생성 로직 분리`
|
||||
@@ -0,0 +1,88 @@
|
||||
# 그누보드5
|
||||
|
||||
그누보드5는 PHP와 MySQL 또는 MariaDB 기반의 오픈소스 CMS입니다. 게시판과 회원 관리 기능을 제공하며 쇼핑몰 솔루션 영카트를 포함합니다.
|
||||
|
||||
## 버전 확인
|
||||
|
||||
현재 소스 코드의 버전은 [`version.php`](version.php)에서 확인할 수 있습니다.
|
||||
|
||||
## 다운로드 및 설치
|
||||
|
||||
### 설치 환경
|
||||
|
||||
#### 기본 요구사항
|
||||
|
||||
- PHP 5.2.17 이상
|
||||
- 최소 요구 버전은 PHP 5.2.17이며 PHP 7.2 이상을 권장합니다.
|
||||
- MySQL 5.0 이상 또는 MySQL 5.0 이상의 기능을 지원하는 MariaDB
|
||||
- Linux 호환 운영체제
|
||||
|
||||
#### 필수 라이브러리
|
||||
|
||||
- GD Library 2.0 이상
|
||||
- iconv
|
||||
|
||||
#### 추가로 필요한 모듈 및 프로그램
|
||||
|
||||
- 글을 SNS로 복사하는 기능 사용 시
|
||||
- cURL
|
||||
- JSON
|
||||
- 영카트5 모바일 결제 사용 시
|
||||
- SOAP
|
||||
- OpenSSL
|
||||
|
||||
> SIR에서 직접 제작한 그누보드5 및 호환 프로그램은 Linux에서만 개발하고 테스트했습니다. 다른 운영체제에서의 정상 동작은 보장하지 않습니다.
|
||||
|
||||
설치 환경에 관한 자세한 내용은 [그누보드5 공식 매뉴얼](https://sir.kr/manuals/g5/1)을 확인하십시오.
|
||||
|
||||
### Git을 이용하는 방법
|
||||
|
||||
Git을 사용할 수 있는 서버에서는 [GitHub 저장소](https://github.com/gnuboard/gnuboard5)를 복제하여 설치할 수 있습니다.
|
||||
|
||||
```bash
|
||||
git clone https://github.com/gnuboard/gnuboard5.git
|
||||
cd gnuboard5
|
||||
```
|
||||
|
||||
복제한 `gnuboard5` 디렉터리를 웹 서버의 서비스 경로로 사용하거나, 서비스 경로 안에 소스 전체를 배치합니다. 이후 아래의 공통 설치 절차를 진행합니다.
|
||||
|
||||
### 압축파일을 이용하는 방법
|
||||
|
||||
1. 다음 중 한 곳에서 설치할 버전의 압축파일을 내려받습니다.
|
||||
- [GitHub Releases](https://github.com/gnuboard/gnuboard5/releases)에서 원하는 버전을 선택하고 `Source code (zip)`을 내려받습니다. `*.patch.zip` 파일은 기존 설치본을 업데이트하기 위한 패치이므로 신규 설치에는 사용하지 않습니다.
|
||||
- [SIR 그누보드5 다운로드](https://sir.kr/boards/g5_pds)에서 원하는 버전의 배포본을 내려받습니다.
|
||||
2. 내려받은 압축파일을 풉니다.
|
||||
3. 압축을 푼 디렉터리의 파일과 하위 디렉터리를 FTP, SFTP 등의 방법으로 웹 서버의 서비스 경로에 업로드합니다.
|
||||
4. 업로드가 끝나면 아래의 공통 설치 절차를 진행합니다.
|
||||
|
||||
### 공통 설치 절차
|
||||
|
||||
1. 브라우저에서 소스를 배치한 주소로 접속하여 설치 화면을 엽니다.
|
||||
2. `data` 디렉터리를 만들라는 안내가 표시되면 `config.php`가 있는 디렉터리에 `data`를 만들고 웹 서버가 쓸 수 있도록 권한을 설정합니다. 공식 매뉴얼에서는 `707` 권한을 예시로 사용합니다.
|
||||
3. 라이선스 내용을 확인하고 동의한 뒤 설치를 계속합니다.
|
||||
4. MySQL 또는 MariaDB 접속 정보와 최고관리자 정보를 입력합니다.
|
||||
5. 설치 완료 화면을 확인한 뒤 생성한 최고관리자 계정으로 로그인합니다.
|
||||
|
||||
> 기존 사이트에 재설치하면 데이터가 삭제될 수 있습니다. 진행하기 전에 파일과 데이터베이스를 백업하십시오.
|
||||
|
||||
### 기존 설치 업데이트
|
||||
|
||||
소스 코드를 업데이트한 뒤 데이터베이스 변경이 포함된 버전은 관리자 메뉴의 **환경설정 → DB업그레이드**에서 변경 내용을 확인하고 명시적으로 실행합니다.
|
||||
|
||||
운영 절차와 마이그레이션 작성 규칙은 [데이터베이스 마이그레이션 문서](docs/database-migrations.md)를 확인하십시오.
|
||||
|
||||
## 문서 및 지원
|
||||
|
||||
- [5.6.391 쇼핑몰 분류 표시 수정 안내](docs/release-5.6.391.md)
|
||||
- [5.6.39 보안 업데이트 및 필수 DB업그레이드 안내](docs/release-5.6.39.md)
|
||||
|
||||
- [5.6.37 SIRK 전용 카카오페이 연동 종료 및 기존 거래 지원](docs/sirk-kakaopay-retirement.md)
|
||||
- [그누보드5 공식 페이지](https://sir.kr/main/g5/)
|
||||
- [그누보드5 공식 매뉴얼](https://sir.kr/manuals/g5/1)
|
||||
- [그누보드5 Q&A](https://sir.kr/questions?s_tag=%EA%B7%B8%EB%88%84%EB%B3%B4%EB%93%9C5)
|
||||
|
||||
보안 취약점 신고 방법은 [`SECURITY.md`](SECURITY.md)를 확인하십시오.
|
||||
|
||||
## 라이선스
|
||||
|
||||
라이선스 전문과 적용 조건은 [`LICENSE.txt`](LICENSE.txt)를 확인하십시오.
|
||||
|
||||
+4
-2
@@ -1,3 +1,5 @@
|
||||
# Gnuboard5 Security Policy
|
||||
# 그누보드5 보안 정책
|
||||
|
||||
Please ask [https://sir.kr/security/.](https://sir.kr/co_qa)
|
||||
그누보드5에서 보안 취약점을 발견한 경우 악용 가능한 상세 내용을 공개 GitHub 이슈에 게시하지 마십시오.
|
||||
|
||||
취약점 정보와 재현 방법은 [SIR 보안 취약점 신고 게시판](https://sir.kr/boards/co_qa)을 통해 제보해 주십시오.
|
||||
|
||||
@@ -3,6 +3,10 @@ define('G5_IS_ADMIN', true);
|
||||
require_once '../common.php';
|
||||
require_once G5_ADMIN_PATH . '/admin.lib.php';
|
||||
|
||||
if (function_exists('g5_check_data_htaccess')) {
|
||||
g5_check_data_htaccess();
|
||||
}
|
||||
|
||||
if (isset($token)) {
|
||||
$token = @htmlspecialchars(strip_tags($token), ENT_QUOTES);
|
||||
}
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ function print_menu2($key, $no = '')
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($is_admin != 'super' && (!array_key_exists($menu[$key][$i][0], $auth) || !strstr($auth[$menu[$key][$i][0]], 'r'))) {
|
||||
if ($is_admin != 'super' && (!array_key_exists($menu[$key][$i][0], $auth) || strpos($auth[$menu[$key][$i][0]], 'r') === false)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
+131
-3
@@ -281,7 +281,7 @@ function auth_check($auth, $attr, $return = false)
|
||||
|
||||
$attr = strtolower($attr);
|
||||
|
||||
if (!strstr($auth, $attr)) {
|
||||
if (strpos($auth, $attr) === false) {
|
||||
if ($attr == 'r') {
|
||||
$msg = '읽을 권한이 없습니다.';
|
||||
if ($return) {
|
||||
@@ -389,7 +389,7 @@ function order_select($fld, $sel = '')
|
||||
// 불법접근을 막도록 토큰을 생성하면서 토큰값을 리턴
|
||||
function get_admin_token()
|
||||
{
|
||||
$token = md5(uniqid(rand(), true));
|
||||
$token = get_random_token_string(16);
|
||||
set_session('ss_admin_token', $token);
|
||||
|
||||
return $token;
|
||||
@@ -478,6 +478,30 @@ function check_log_folder($log_path, $is_delete = true)
|
||||
}
|
||||
}
|
||||
|
||||
// 회원 본인확인 식별값과 인증 이력만 정리한다. 호출부에서 관리자 권한을 검증한다.
|
||||
function admin_clear_member_certification($mb_id)
|
||||
{
|
||||
global $g5;
|
||||
|
||||
$esc_mb_id = sql_real_escape_string($mb_id);
|
||||
$history_table = isset($g5['member_cert_history_table']) ? $g5['member_cert_history_table'] : G5_TABLE_PREFIX.'member_cert_history';
|
||||
|
||||
// 일반 회원정보(이름·연락처)와 이메일 인증 상태는 유지한다.
|
||||
if (!sql_query(" update {$g5['member_table']}
|
||||
set mb_certify = '', mb_adult = 0, mb_dupinfo = '', mb_birth = '', mb_sex = ''
|
||||
where mb_id = '{$esc_mb_id}' ", false)) {
|
||||
return false;
|
||||
}
|
||||
if (!sql_query(" delete from {$history_table} where mb_id = '{$esc_mb_id}' ", false)) {
|
||||
return false;
|
||||
}
|
||||
if (!sql_query(" delete from {$g5['cert_history_table']} where mb_id = '{$esc_mb_id}' ", false)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// POST로 넘어온 토큰과 세션에 저장된 토큰 비교
|
||||
function check_admin_token()
|
||||
{
|
||||
@@ -610,6 +634,110 @@ function admin_menu_find_by($call, $search_key)
|
||||
return '';
|
||||
}
|
||||
|
||||
function admin_menu_local_path($url)
|
||||
{
|
||||
$url = (string) $url;
|
||||
|
||||
if (!$url) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$url = preg_replace('/[?#].*$/', '', $url);
|
||||
|
||||
$maps = array(
|
||||
G5_ADMIN_URL => G5_ADMIN_PATH,
|
||||
);
|
||||
|
||||
if (defined('G5_SMS5_ADMIN_URL') && defined('G5_SMS5_ADMIN_PATH')) {
|
||||
$maps[G5_SMS5_ADMIN_URL] = G5_SMS5_ADMIN_PATH;
|
||||
}
|
||||
|
||||
foreach ($maps as $base_url => $base_path) {
|
||||
if (strpos($url, $base_url) !== 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$path = $base_path.substr($url, strlen($base_url));
|
||||
|
||||
if (substr($path, -1) === '/') {
|
||||
$path .= 'index.php';
|
||||
}
|
||||
|
||||
return $path;
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
function admin_menu_is_super_only($menu_item)
|
||||
{
|
||||
static $cache = array();
|
||||
|
||||
$sub_menu = isset($menu_item[0]) ? (string) $menu_item[0] : '';
|
||||
if (!$sub_menu) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isset($cache[$sub_menu])) {
|
||||
return $cache[$sub_menu];
|
||||
}
|
||||
|
||||
// 향후 메뉴 정의에서 명시적으로 최고관리자 전용 표시가 필요할 때 사용한다.
|
||||
if (isset($menu_item[4]) && $menu_item[4] === 'super') {
|
||||
return $cache[$sub_menu] = true;
|
||||
}
|
||||
|
||||
$path = admin_menu_local_path(isset($menu_item[2]) ? $menu_item[2] : '');
|
||||
if (!$path || !is_readable($path)) {
|
||||
return $cache[$sub_menu] = false;
|
||||
}
|
||||
|
||||
$content = file_get_contents($path, false, null, 0, 12000);
|
||||
if ($content === false) {
|
||||
return $cache[$sub_menu] = false;
|
||||
}
|
||||
|
||||
$pattern = '/if\s*\([^\)]*\$is_admin\s*(?:!==|!=)\s*[\'"]super[\'"][^\)]*\)\s*\{?[\s\S]{0,250}(?:alert|alert_close|die)\s*\([^\;]*(?:최고관리자만|최고관리자로)/u';
|
||||
|
||||
return $cache[$sub_menu] = (bool) preg_match($pattern, $content);
|
||||
}
|
||||
|
||||
function admin_get_assignable_auth_menu()
|
||||
{
|
||||
global $menu;
|
||||
|
||||
$assignable_auth_menu = array();
|
||||
|
||||
if (!isset($menu) || !is_array($menu)) {
|
||||
return $assignable_auth_menu;
|
||||
}
|
||||
|
||||
foreach ($menu as $menu_group) {
|
||||
if (!is_array($menu_group)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
for ($i=1; $i<count($menu_group); $i++) {
|
||||
if (!isset($menu_group[$i]) || !is_array($menu_group[$i])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$sub_menu = isset($menu_group[$i][0]) ? $menu_group[$i][0] : '';
|
||||
if (!$sub_menu || $sub_menu === '-' || substr($sub_menu, -3) === '000') {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (admin_menu_is_super_only($menu_group[$i])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$assignable_auth_menu[$sub_menu] = isset($menu_group[$i][1]) ? $menu_group[$i][1] : '';
|
||||
}
|
||||
}
|
||||
|
||||
return $assignable_auth_menu;
|
||||
}
|
||||
|
||||
// 접근 권한 검사
|
||||
if (!$member['mb_id']) {
|
||||
alert('로그인 하십시오.', G5_BBS_URL . '/login.php?url=' . urlencode(correct_goto_url(G5_ADMIN_URL)));
|
||||
@@ -698,4 +826,4 @@ if (run_replace('safe_admin_add_script_boolean', false) === false) {
|
||||
$config['cf_analytics'] = '';
|
||||
$config['cf_add_script'] = '';
|
||||
$config['cf_add_meta'] = '';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
|
||||
+3
-3
@@ -17,7 +17,7 @@ $print_version = ($is_admin == 'super') ? 'Version ' . G5_GNUBOARD_VER : '';
|
||||
</div>
|
||||
<footer id="ft">
|
||||
<p>
|
||||
Copyright © <?php echo $_SERVER['HTTP_HOST']; ?>. All rights reserved. <?php echo $print_version; ?><br>
|
||||
Copyright © <?php echo htmlspecialchars($_SERVER['HTTP_HOST']); ?>. All rights reserved. <?php echo $print_version; ?><br>
|
||||
<button type="button" class="scroll_top"><span class="top_img"></span><span class="top_txt">TOP</span></button>
|
||||
</p>
|
||||
</footer>
|
||||
@@ -52,8 +52,8 @@ $print_version = ($is_admin == 'super') ? 'Version ' . G5_GNUBOARD_VER : '';
|
||||
|
||||
<!-- <p>실행시간 : <?php echo get_microtime() - $begin_time; ?> -->
|
||||
|
||||
<script src="<?php echo G5_ADMIN_URL ?>/admin.js?ver=<?php echo G5_JS_VER; ?>"></script>
|
||||
<script src="<?php echo G5_JS_URL ?>/jquery.anchorScroll.js?ver=<?php echo G5_JS_VER; ?>"></script>
|
||||
<script src="<?php echo get_versioned_asset_url(G5_ADMIN_URL.'/admin.js'); ?>"></script>
|
||||
<script src="<?php echo get_versioned_asset_url(G5_JS_URL.'/jquery.anchorScroll.js'); ?>"></script>
|
||||
<script>
|
||||
$(function() {
|
||||
|
||||
|
||||
+12
-5
@@ -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 ( ";
|
||||
@@ -54,6 +59,8 @@ $listall = '<a href="' . $_SERVER['SCRIPT_NAME'] . '" class="ov_listall btn_ov02
|
||||
$g5['title'] = "관리권한설정";
|
||||
require_once './admin.head.php';
|
||||
|
||||
$assignable_auth_menu = admin_get_assignable_auth_menu();
|
||||
|
||||
$colspan = 5;
|
||||
?>
|
||||
|
||||
@@ -105,8 +112,8 @@ $colspan = 5;
|
||||
$is_continue = true;
|
||||
}
|
||||
|
||||
// 메뉴번호가 바뀌는 경우에 현재 없는 저장된 메뉴는 삭제함
|
||||
if (!isset($auth_menu[$row['au_menu']])) {
|
||||
// 메뉴번호가 바뀌거나 권한 부여 대상이 아닌 메뉴는 삭제함
|
||||
if (!isset($assignable_auth_menu[$row['au_menu']])) {
|
||||
sql_query(" delete from {$g5['auth_table']} where au_menu = '{$row['au_menu']}' ");
|
||||
$is_continue = true;
|
||||
}
|
||||
@@ -130,7 +137,7 @@ $colspan = 5;
|
||||
<td class="td_auth_mbnick"><?php echo $mb_nick ?></td>
|
||||
<td class="td_menu">
|
||||
<?php echo $row['au_menu'] ?>
|
||||
<?php echo $auth_menu[$row['au_menu']] ?>
|
||||
<?php echo $assignable_auth_menu[$row['au_menu']] ?>
|
||||
</td>
|
||||
<td class="td_auth"><?php echo $row['au_auth'] ?></td>
|
||||
</tr>
|
||||
@@ -154,7 +161,7 @@ $colspan = 5;
|
||||
//if (isset($stx))
|
||||
// echo '<script>document.fsearch.sfl.value = "'.$sfl.'";</script>'."\n";
|
||||
|
||||
if (strstr($sfl, 'mb_id')) {
|
||||
if (strpos($sfl, 'mb_id') !== false) {
|
||||
$mb_id = $stx;
|
||||
} else {
|
||||
$mb_id = '';
|
||||
@@ -205,7 +212,7 @@ echo $pagelist;
|
||||
<select id="au_menu" name="au_menu" required class="required">
|
||||
<option value=''>선택하세요</option>
|
||||
<?php
|
||||
foreach ($auth_menu as $key => $value) {
|
||||
foreach ($assignable_auth_menu as $key => $value) {
|
||||
if (!(substr($key, -3) == '000' || $key == '-' || !$key)) {
|
||||
echo '<option value="' . $key . '">' . $key . ' ' . $value . '</option>';
|
||||
}
|
||||
|
||||
@@ -19,6 +19,11 @@ if (!(isset($mb['mb_id']) && $mb['mb_id'])) {
|
||||
|
||||
check_admin_token();
|
||||
|
||||
$assignable_auth_menu = admin_get_assignable_auth_menu();
|
||||
if (!$au_menu || !isset($assignable_auth_menu[$au_menu])) {
|
||||
alert('해당 메뉴는 관리권한을 부여할 수 없습니다.');
|
||||
}
|
||||
|
||||
require_once G5_CAPTCHA_PATH . '/captcha.lib.php';
|
||||
|
||||
if (!chk_captcha()) {
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ if (empty($bo_table)) {
|
||||
<script>
|
||||
var g5_admin_csrf_token_key = "<?php echo (function_exists('admin_csrf_token_key')) ? admin_csrf_token_key() : ''; ?>";
|
||||
</script>
|
||||
<script src="<?php echo G5_ADMIN_URL ?>/admin.js?ver=<?php echo G5_JS_VER; ?>"></script>
|
||||
<script src="<?php echo get_versioned_asset_url(G5_ADMIN_URL.'/admin.js'); ?>"></script>
|
||||
|
||||
<div class="new_win">
|
||||
<h1><?php echo $g5['title']; ?></h1>
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
+1
-62
@@ -13,81 +13,20 @@ if (!$row['cnt']) {
|
||||
|
||||
$html_title = '게시판';
|
||||
|
||||
if (!isset($board['bo_device'])) {
|
||||
// 게시판 사용 필드 추가
|
||||
// both : pc, mobile 둘다 사용
|
||||
// pc : pc 전용 사용
|
||||
// mobile : mobile 전용 사용
|
||||
// none : 사용 안함
|
||||
sql_query(" ALTER TABLE `{$g5['board_table']}` ADD `bo_device` ENUM( 'both', 'pc', 'mobile' ) NOT NULL DEFAULT 'both' AFTER `bo_subject` ", false);
|
||||
}
|
||||
|
||||
if (!isset($board['bo_mobile_skin'])) {
|
||||
sql_query(" ALTER TABLE `{$g5['board_table']}` ADD `bo_mobile_skin` VARCHAR(255) NOT NULL DEFAULT '' AFTER `bo_skin` ", false);
|
||||
}
|
||||
|
||||
if (!isset($board['bo_gallery_width'])) {
|
||||
sql_query(" ALTER TABLE `{$g5['board_table']}` ADD `bo_gallery_width` INT NOT NULL AFTER `bo_gallery_cols`, ADD `bo_gallery_height` INT NOT NULL DEFAULT '0' AFTER `bo_gallery_width`, ADD `bo_mobile_gallery_width` INT NOT NULL DEFAULT '0' AFTER `bo_gallery_height`, ADD `bo_mobile_gallery_height` INT NOT NULL DEFAULT '0' AFTER `bo_mobile_gallery_width` ", false);
|
||||
}
|
||||
|
||||
if (!isset($board['bo_mobile_subject_len'])) {
|
||||
sql_query(" ALTER TABLE `{$g5['board_table']}` ADD `bo_mobile_subject_len` INT(11) NOT NULL DEFAULT '0' AFTER `bo_subject_len` ", false);
|
||||
}
|
||||
|
||||
if (!isset($board['bo_mobile_page_rows'])) {
|
||||
sql_query(" ALTER TABLE `{$g5['board_table']}` ADD `bo_mobile_page_rows` INT(11) NOT NULL DEFAULT '0' AFTER `bo_page_rows` ", false);
|
||||
}
|
||||
|
||||
if (!isset($board['bo_mobile_content_head'])) {
|
||||
sql_query(" ALTER TABLE `{$g5['board_table']}` ADD `bo_mobile_content_head` TEXT NOT NULL AFTER `bo_content_head`, ADD `bo_mobile_content_tail` TEXT NOT NULL AFTER `bo_content_tail`", false);
|
||||
}
|
||||
|
||||
if (!isset($board['bo_use_cert'])) {
|
||||
sql_query(" ALTER TABLE `{$g5['board_table']}` ADD `bo_use_cert` ENUM('','cert','adult') NOT NULL DEFAULT '' AFTER `bo_use_email` ", false);
|
||||
}
|
||||
|
||||
if (!isset($board['bo_use_sns'])) {
|
||||
sql_query(" ALTER TABLE `{$g5['board_table']}` ADD `bo_use_sns` TINYINT NOT NULL DEFAULT '0' AFTER `bo_use_cert` ", false);
|
||||
|
||||
$result = sql_query(" select bo_table from `{$g5['board_table']}` ");
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++) {
|
||||
sql_query(
|
||||
" ALTER TABLE `{$g5['write_prefix']}{$row['bo_table']}`
|
||||
ADD `wr_facebook_user` VARCHAR(255) NOT NULL DEFAULT '' AFTER `wr_ip`,
|
||||
ADD `wr_twitter_user` VARCHAR(255) NOT NULL DEFAULT '' AFTER `wr_facebook_user` ", false
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$sql = " SHOW COLUMNS FROM `{$g5['board_table']}` LIKE 'bo_use_cert' ";
|
||||
$row = sql_fetch($sql);
|
||||
if (strpos($row['Type'], 'hp-') === false) {
|
||||
sql_query(" ALTER TABLE `{$g5['board_table']}` CHANGE `bo_use_cert` `bo_use_cert` ENUM('','cert','adult','hp-cert','hp-adult') NOT NULL DEFAULT '' ", false);
|
||||
}
|
||||
|
||||
if (!isset($board['bo_use_list_file'])) {
|
||||
sql_query(" ALTER TABLE `{$g5['board_table']}` ADD `bo_use_list_file` TINYINT NOT NULL DEFAULT '0' AFTER `bo_use_list_view` ", false);
|
||||
|
||||
$result = sql_query(" select bo_table from `{$g5['board_table']}` ");
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++) {
|
||||
sql_query(
|
||||
" ALTER TABLE `{$g5['write_prefix']}{$row['bo_table']}`
|
||||
ADD `wr_file` TINYINT NOT NULL DEFAULT '0' AFTER `wr_datetime` ", false
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (!isset($board['bo_mobile_subject'])) {
|
||||
sql_query(" ALTER TABLE `{$g5['board_table']}` ADD `bo_mobile_subject` VARCHAR(255) NOT NULL DEFAULT '' AFTER `bo_subject` ", false);
|
||||
}
|
||||
|
||||
if (!isset($board['bo_use_captcha'])) {
|
||||
sql_query(" ALTER TABLE `{$g5['board_table']}` ADD `bo_use_captcha` TINYINT NOT NULL DEFAULT '0' AFTER `bo_use_sns` ", false);
|
||||
}
|
||||
|
||||
if (!isset($board['bo_select_editor'])) {
|
||||
sql_query(" ALTER TABLE `{$g5['board_table']}` ADD `bo_select_editor` VARCHAR(50) NOT NULL DEFAULT '' AFTER `bo_use_dhtml_editor` ", false);
|
||||
}
|
||||
|
||||
$board_default = array(
|
||||
'bo_mobile_subject'=>'',
|
||||
@@ -1500,4 +1439,4 @@ function fboardform_submit(f)
|
||||
</script>
|
||||
|
||||
<?php
|
||||
require_once './admin.tail.php';
|
||||
require_once './admin.tail.php';
|
||||
|
||||
+29
-10
@@ -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;
|
||||
@@ -139,7 +148,7 @@ $bo_hot = isset($_POST['bo_hot']) ? (int) $_POST['bo_hot'] : 0;
|
||||
$bo_image_width = isset($_POST['bo_image_width']) ? (int) $_POST['bo_image_width'] : 0;
|
||||
$bo_use_search = isset($_POST['bo_use_search']) ? (int) $_POST['bo_use_search'] : 0;
|
||||
$bo_use_cert = isset($_POST['bo_use_cert']) ? preg_replace('/[^0-9a-z_]/i', '', $_POST['bo_use_cert']) : '';
|
||||
$bo_device = isset($_POST['bo_device']) ? clean_xss_tags($_POST['bo_device'], 1, 1) : '';
|
||||
$bo_device = isset($_POST['bo_device']) ? addslashes(clean_xss_tags(stripslashes($_POST['bo_device']), 1, 1)) : '';
|
||||
$bo_list_level = isset($_POST['bo_list_level']) ? (int) $_POST['bo_list_level'] : 0;
|
||||
$bo_read_level = isset($_POST['bo_read_level']) ? (int) $_POST['bo_read_level'] : 0;
|
||||
$bo_write_level = isset($_POST['bo_write_level']) ? (int) $_POST['bo_write_level'] : 0;
|
||||
@@ -155,9 +164,9 @@ $bo_read_point = isset($_POST['bo_read_point']) ? (int) $_POST['bo_read_point']
|
||||
$bo_write_point = isset($_POST['bo_write_point']) ? (int) $_POST['bo_write_point'] : 0;
|
||||
$bo_comment_point = isset($_POST['bo_comment_point']) ? (int) $_POST['bo_comment_point'] : 0;
|
||||
$bo_download_point = isset($_POST['bo_download_point']) ? (int) $_POST['bo_download_point'] : 0;
|
||||
$bo_select_editor = isset($_POST['bo_select_editor']) ? clean_xss_tags($_POST['bo_select_editor'], 1, 1) : '';
|
||||
$bo_skin = isset($_POST['bo_skin']) ? clean_xss_tags($_POST['bo_skin'], 1, 1) : '';
|
||||
$bo_mobile_skin = isset($_POST['bo_mobile_skin']) ? clean_xss_tags($_POST['bo_mobile_skin'], 1, 1) : '';
|
||||
$bo_select_editor = isset($_POST['bo_select_editor']) ? addslashes(clean_xss_tags(stripslashes($_POST['bo_select_editor']), 1, 1)) : '';
|
||||
$bo_skin = isset($_POST['bo_skin']) ? addslashes(clean_xss_tags(stripslashes($_POST['bo_skin']), 1, 1)) : '';
|
||||
$bo_mobile_skin = isset($_POST['bo_mobile_skin']) ? addslashes(clean_xss_tags(stripslashes($_POST['bo_mobile_skin']), 1, 1)) : '';
|
||||
$bo_content_head = isset($_POST['bo_content_head']) ? $_POST['bo_content_head'] : '';
|
||||
$bo_content_tail = isset($_POST['bo_content_tail']) ? $_POST['bo_content_tail'] : '';
|
||||
$bo_mobile_content_head = isset($_POST['bo_mobile_content_head']) ? $_POST['bo_mobile_content_head'] : '';
|
||||
@@ -176,7 +185,17 @@ $bo_write_min = isset($_POST['bo_write_min']) ? (int) $_POST['bo_write_min'] : 0
|
||||
$bo_write_max = isset($_POST['bo_write_max']) ? (int) $_POST['bo_write_max'] : 0;
|
||||
$bo_comment_min = isset($_POST['bo_comment_min']) ? (int) $_POST['bo_comment_min'] : 0;
|
||||
$bo_comment_max = isset($_POST['bo_comment_max']) ? (int) $_POST['bo_comment_max'] : 0;
|
||||
$bo_sort_field = isset($_POST['bo_sort_field']) ? clean_xss_tags($_POST['bo_sort_field'], 1, 1) : '';
|
||||
$bo_sort_field = isset($_POST['bo_sort_field']) ? trim(stripslashes($_POST['bo_sort_field'])) : '';
|
||||
$bo_allowed_sort_field = array('');
|
||||
if (function_exists('get_board_sort_fields')) {
|
||||
foreach (get_board_sort_fields(isset($board) ? $board : array()) as $bo_sort_v) {
|
||||
$bo_allowed_sort_field[] = $bo_sort_v[0];
|
||||
}
|
||||
}
|
||||
if (!in_array($bo_sort_field, $bo_allowed_sort_field, true)) {
|
||||
$bo_sort_field = '';
|
||||
}
|
||||
$bo_sort_field = addslashes($bo_sort_field);
|
||||
|
||||
if (strpbrk($bo_skin.$bo_mobile_skin, "?%*:|\"<>") !== false) {
|
||||
alert('스킨 디렉토리명 오류!');
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) . "',
|
||||
|
||||
@@ -31,9 +31,6 @@ if ($w == '') {
|
||||
alert('제대로 된 값이 넘어오지 않았습니다.');
|
||||
}
|
||||
|
||||
if (!isset($group['gr_device'])) {
|
||||
sql_query(" ALTER TABLE `{$g5['group_table']}` ADD `gr_device` ENUM('both','pc','mobile') NOT NULL DEFAULT 'both' AFTER `gr_subject` ", false);
|
||||
}
|
||||
|
||||
// 접근회원수
|
||||
$sql1 = " select count(*) as cnt from {$g5['group_member_table']} where gr_id = '{$gr_id}' ";
|
||||
|
||||
@@ -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] : '';
|
||||
}
|
||||
|
||||
@@ -4,14 +4,6 @@ require_once './_common.php';
|
||||
|
||||
auth_check_menu($auth, $sub_menu, 'r');
|
||||
|
||||
if (!isset($group['gr_device'])) {
|
||||
// 게시판 그룹 사용 필드 추가
|
||||
// both : pc, mobile 둘다 사용
|
||||
// pc : pc 전용 사용
|
||||
// mobile : mobile 전용 사용
|
||||
// none : 사용 안함
|
||||
sql_query(" ALTER TABLE `{$g5['group_table']}` ADD `gr_device` ENUM( 'both', 'pc', 'mobile' ) NOT NULL DEFAULT 'both' AFTER `gr_subject` ", false);
|
||||
}
|
||||
|
||||
$sql_common = " from {$g5['group_table']} ";
|
||||
|
||||
@@ -20,6 +12,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) {
|
||||
|
||||
@@ -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&stx=' . $gr_id);
|
||||
alert("이 그룹에 속한 게시판이 존재하여 게시판 그룹을 삭제할 수 없습니다.\\n\\n이 그룹에 속한 게시판을 먼저 삭제하여 주십시오.", './board_list.php?sfl=a.gr_id&stx=' . $gr_id);
|
||||
}
|
||||
|
||||
// 그룹 삭제
|
||||
|
||||
@@ -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 ( ";
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
$sub_menu = "300200";
|
||||
require_once './_common.php';
|
||||
|
||||
sql_query(" ALTER TABLE {$g5['group_member_table']} CHANGE `gm_id` `gm_id` INT( 11 ) DEFAULT '0' NOT NULL AUTO_INCREMENT ", false);
|
||||
|
||||
if ($w == '') {
|
||||
auth_check_menu($auth, $sub_menu, 'w');
|
||||
|
||||
@@ -21,7 +21,7 @@ if (!is_file(G5_DATA_PATH . '/cache/browscap_cache.php')) {
|
||||
}
|
||||
|
||||
require_once G5_PLUGIN_PATH . '/browscap/Browscap.php';
|
||||
$browscap = new phpbrowscap\Browscap(G5_DATA_PATH . '/cache');
|
||||
$browscap = new Browscap(G5_DATA_PATH . '/cache');
|
||||
$browscap->doAutoUpdate = false;
|
||||
$browscap->cacheFilename = 'browscap_cache.php';
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ if ($is_admin != 'super') {
|
||||
|
||||
require_once G5_PLUGIN_PATH . '/browscap/Browscap.php';
|
||||
|
||||
$browscap = new phpbrowscap\Browscap(G5_DATA_PATH . '/cache');
|
||||
$browscap = new Browscap(G5_DATA_PATH . '/cache');
|
||||
$browscap->updateMethod = 'cURL';
|
||||
$browscap->cacheFilename = 'browscap_cache.php';
|
||||
$browscap->updateCache();
|
||||
|
||||
+62
-454
@@ -12,440 +12,9 @@ if ($is_admin != 'super') {
|
||||
$sql = " select * from {$g5['config_table']} limit 1";
|
||||
$config = sql_fetch($sql);
|
||||
|
||||
if (!isset($config['cf_add_script'])) {
|
||||
sql_query(
|
||||
" ALTER TABLE `{$g5['config_table']}`
|
||||
ADD `cf_add_script` TEXT NOT NULL AFTER `cf_admin_email_name` ",
|
||||
true
|
||||
);
|
||||
if (!isset($config['cf_email_certify_minutes'])) {
|
||||
alert('DB 업그레이드가 필요합니다.', G5_ADMIN_URL . '/dbupgrade.php');
|
||||
}
|
||||
|
||||
if (!isset($config['cf_mobile_new_skin'])) {
|
||||
sql_query(
|
||||
" ALTER TABLE `{$g5['config_table']}`
|
||||
ADD `cf_mobile_new_skin` VARCHAR(255) NOT NULL AFTER `cf_memo_send_point`,
|
||||
ADD `cf_mobile_search_skin` VARCHAR(255) NOT NULL AFTER `cf_mobile_new_skin`,
|
||||
ADD `cf_mobile_connect_skin` VARCHAR(255) NOT NULL AFTER `cf_mobile_search_skin`,
|
||||
ADD `cf_mobile_member_skin` VARCHAR(255) NOT NULL AFTER `cf_mobile_connect_skin` ",
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
if (isset($config['cf_gcaptcha_mp3'])) {
|
||||
sql_query(
|
||||
" ALTER TABLE `{$g5['config_table']}`
|
||||
CHANGE `cf_gcaptcha_mp3` `cf_captcha_mp3` VARCHAR(255) NOT NULL DEFAULT '' ",
|
||||
true
|
||||
);
|
||||
} elseif (!isset($config['cf_captcha_mp3'])) {
|
||||
sql_query(
|
||||
" ALTER TABLE `{$g5['config_table']}`
|
||||
ADD `cf_captcha_mp3` VARCHAR(255) NOT NULL DEFAULT '' AFTER `cf_mobile_member_skin` ",
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
if (!isset($config['cf_editor'])) {
|
||||
sql_query(
|
||||
" ALTER TABLE `{$g5['config_table']}`
|
||||
ADD `cf_editor` VARCHAR(255) NOT NULL DEFAULT '' AFTER `cf_captcha_mp3` ",
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
if (!isset($config['cf_googl_shorturl_apikey'])) {
|
||||
sql_query(
|
||||
" ALTER TABLE `{$g5['config_table']}`
|
||||
ADD `cf_googl_shorturl_apikey` VARCHAR(255) NOT NULL DEFAULT '' AFTER `cf_captcha_mp3` ",
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
if (!isset($config['cf_mobile_pages'])) {
|
||||
sql_query(
|
||||
" ALTER TABLE `{$g5['config_table']}`
|
||||
ADD `cf_mobile_pages` INT(11) NOT NULL DEFAULT '0' AFTER `cf_write_pages` ",
|
||||
true
|
||||
);
|
||||
sql_query(" UPDATE `{$g5['config_table']}` SET cf_mobile_pages = '5' ", true);
|
||||
}
|
||||
|
||||
if (!isset($config['cf_facebook_appid'])) {
|
||||
sql_query(
|
||||
" ALTER TABLE `{$g5['config_table']}`
|
||||
ADD `cf_facebook_appid` VARCHAR(255) NOT NULL AFTER `cf_googl_shorturl_apikey`,
|
||||
ADD `cf_facebook_secret` VARCHAR(255) NOT NULL AFTER `cf_facebook_appid`,
|
||||
ADD `cf_twitter_key` VARCHAR(255) NOT NULL AFTER `cf_facebook_secret`,
|
||||
ADD `cf_twitter_secret` VARCHAR(255) NOT NULL AFTER `cf_twitter_key` ",
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
// uniqid 테이블이 없을 경우 생성
|
||||
if (!sql_query(" DESC {$g5['uniqid_table']} ", false)) {
|
||||
sql_query(
|
||||
" CREATE TABLE IF NOT EXISTS `{$g5['uniqid_table']}` (
|
||||
`uq_id` bigint(20) unsigned NOT NULL,
|
||||
`uq_ip` varchar(255) NOT NULL,
|
||||
PRIMARY KEY (`uq_id`)
|
||||
) ",
|
||||
false
|
||||
);
|
||||
}
|
||||
|
||||
if (!sql_query(" SELECT uq_ip from {$g5['uniqid_table']} limit 1 ", false)) {
|
||||
sql_query(" ALTER TABLE {$g5['uniqid_table']} ADD `uq_ip` VARCHAR(255) NOT NULL ");
|
||||
}
|
||||
|
||||
// 임시저장 테이블이 없을 경우 생성
|
||||
if (!sql_query(" DESC {$g5['autosave_table']} ", false)) {
|
||||
sql_query(
|
||||
" CREATE TABLE IF NOT EXISTS `{$g5['autosave_table']}` (
|
||||
`as_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`mb_id` varchar(20) NOT NULL,
|
||||
`as_uid` bigint(20) unsigned NOT NULL,
|
||||
`as_subject` varchar(255) NOT NULL,
|
||||
`as_content` text NOT NULL,
|
||||
`as_datetime` datetime NOT NULL,
|
||||
PRIMARY KEY (`as_id`),
|
||||
UNIQUE KEY `as_uid` (`as_uid`),
|
||||
KEY `mb_id` (`mb_id`)
|
||||
) ",
|
||||
false
|
||||
);
|
||||
}
|
||||
|
||||
if (!isset($config['cf_admin_email'])) {
|
||||
sql_query(
|
||||
" ALTER TABLE `{$g5['config_table']}`
|
||||
ADD `cf_admin_email` VARCHAR(255) NOT NULL AFTER `cf_admin` ",
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
if (!isset($config['cf_admin_email_name'])) {
|
||||
sql_query(
|
||||
" ALTER TABLE `{$g5['config_table']}`
|
||||
ADD `cf_admin_email_name` VARCHAR(255) NOT NULL AFTER `cf_admin_email` ",
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
if (!isset($config['cf_cert_use'])) {
|
||||
sql_query(
|
||||
" ALTER TABLE `{$g5['config_table']}`
|
||||
ADD `cf_cert_use` TINYINT(4) NOT NULL DEFAULT '0' AFTER `cf_editor`,
|
||||
ADD `cf_cert_ipin` VARCHAR(255) NOT NULL DEFAULT '' AFTER `cf_cert_use`,
|
||||
ADD `cf_cert_hp` VARCHAR(255) NOT NULL DEFAULT '' AFTER `cf_cert_ipin`,
|
||||
ADD `cf_cert_kcb_cd` VARCHAR(255) NOT NULL DEFAULT '' AFTER `cf_cert_hp`,
|
||||
ADD `cf_cert_kcp_cd` VARCHAR(255) NOT NULL DEFAULT '' AFTER `cf_cert_kcb_cd`,
|
||||
ADD `cf_cert_limit` INT(11) NOT NULL DEFAULT '0' AFTER `cf_cert_kcp_cd` ",
|
||||
true
|
||||
);
|
||||
sql_query(
|
||||
" ALTER TABLE `{$g5['member_table']}`
|
||||
CHANGE `mb_hp_certify` `mb_certify` VARCHAR(20) NOT NULL DEFAULT '' ",
|
||||
true
|
||||
);
|
||||
sql_query(" update {$g5['member_table']} set mb_certify = 'hp' where mb_certify = '1' ");
|
||||
sql_query(" update {$g5['member_table']} set mb_certify = '' where mb_certify = '0' ");
|
||||
sql_query(
|
||||
" CREATE TABLE IF NOT EXISTS `{$g5['cert_history_table']}` (
|
||||
`cr_id` int(11) NOT NULL auto_increment,
|
||||
`mb_id` varchar(255) NOT NULL DEFAULT '',
|
||||
`cr_company` varchar(255) NOT NULL DEFAULT '',
|
||||
`cr_method` varchar(255) NOT NULL DEFAULT '',
|
||||
`cr_ip` varchar(255) NOT NULL DEFAULT '',
|
||||
`cr_date` date NOT NULL DEFAULT '0000-00-00',
|
||||
`cr_time` time NOT NULL DEFAULT '00:00:00',
|
||||
PRIMARY KEY (`cr_id`),
|
||||
KEY `mb_id` (`mb_id`)
|
||||
)",
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
if (!isset($config['cf_analytics'])) {
|
||||
sql_query(
|
||||
" ALTER TABLE `{$g5['config_table']}`
|
||||
ADD `cf_analytics` TEXT NOT NULL AFTER `cf_intercept_ip` ",
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
if (!isset($config['cf_add_meta'])) {
|
||||
sql_query(
|
||||
" ALTER TABLE `{$g5['config_table']}`
|
||||
ADD `cf_add_meta` TEXT NOT NULL AFTER `cf_analytics` ",
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
if (!isset($config['cf_syndi_token'])) {
|
||||
sql_query(
|
||||
" ALTER TABLE `{$g5['config_table']}`
|
||||
ADD `cf_syndi_token` VARCHAR(255) NOT NULL AFTER `cf_add_meta` ",
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
if (!isset($config['cf_syndi_except'])) {
|
||||
sql_query(
|
||||
" ALTER TABLE `{$g5['config_table']}`
|
||||
ADD `cf_syndi_except` TEXT NOT NULL AFTER `cf_syndi_token` ",
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
if (!isset($config['cf_sms_use'])) {
|
||||
sql_query(
|
||||
" ALTER TABLE `{$g5['config_table']}`
|
||||
ADD `cf_sms_use` varchar(255) NOT NULL DEFAULT '' AFTER `cf_cert_limit`,
|
||||
ADD `cf_icode_id` varchar(255) NOT NULL DEFAULT '' AFTER `cf_sms_use`,
|
||||
ADD `cf_icode_pw` varchar(255) NOT NULL DEFAULT '' AFTER `cf_icode_id`,
|
||||
ADD `cf_icode_server_ip` varchar(255) NOT NULL DEFAULT '' AFTER `cf_icode_pw`,
|
||||
ADD `cf_icode_server_port` varchar(255) NOT NULL DEFAULT '' AFTER `cf_icode_server_ip` ",
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
if (!isset($config['cf_mobile_page_rows'])) {
|
||||
sql_query(
|
||||
" ALTER TABLE `{$g5['config_table']}`
|
||||
ADD `cf_mobile_page_rows` int(11) NOT NULL DEFAULT '0' AFTER `cf_page_rows` ",
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
if (!isset($config['cf_cert_req'])) {
|
||||
sql_query(
|
||||
" ALTER TABLE `{$g5['config_table']}`
|
||||
ADD `cf_cert_req` tinyint(4) NOT NULL DEFAULT '0' AFTER `cf_cert_limit` ",
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
if (!isset($config['cf_faq_skin'])) {
|
||||
sql_query(
|
||||
" ALTER TABLE `{$g5['config_table']}`
|
||||
ADD `cf_faq_skin` varchar(255) NOT NULL DEFAULT '' AFTER `cf_connect_skin`,
|
||||
ADD `cf_mobile_faq_skin` varchar(255) NOT NULL DEFAULT '' AFTER `cf_mobile_connect_skin` ",
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
// LG유플러스 본인확인 필드 추가
|
||||
if (!isset($config['cf_lg_mid'])) {
|
||||
sql_query(
|
||||
" ALTER TABLE `{$g5['config_table']}`
|
||||
ADD `cf_lg_mid` varchar(255) NOT NULL DEFAULT '' AFTER `cf_cert_kcp_cd`,
|
||||
ADD `cf_lg_mert_key` varchar(255) NOT NULL DEFAULT '' AFTER `cf_lg_mid` ",
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
if (!isset($config['cf_optimize_date'])) {
|
||||
sql_query(
|
||||
" ALTER TABLE `{$g5['config_table']}`
|
||||
ADD `cf_optimize_date` date NOT NULL default '0000-00-00' AFTER `cf_popular_del` ",
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
// 카카오톡링크 api 키
|
||||
if (!isset($config['cf_kakao_js_apikey'])) {
|
||||
sql_query(
|
||||
" ALTER TABLE `{$g5['config_table']}`
|
||||
ADD `cf_kakao_js_apikey` varchar(255) NOT NULL DEFAULT '' AFTER `cf_googl_shorturl_apikey` ",
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
// SMS 전송유형 필드 추가
|
||||
if (!isset($config['cf_sms_type'])) {
|
||||
sql_query(
|
||||
" ALTER TABLE `{$g5['config_table']}`
|
||||
ADD `cf_sms_type` varchar(10) NOT NULL DEFAULT '' AFTER `cf_sms_use` ",
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
// 접속자 정보 필드 추가
|
||||
if (!sql_query(" select vi_browser from {$g5['visit_table']} limit 1 ")) {
|
||||
sql_query(
|
||||
" ALTER TABLE `{$g5['visit_table']}`
|
||||
ADD `vi_browser` varchar(255) NOT NULL DEFAULT '' AFTER `vi_agent`,
|
||||
ADD `vi_os` varchar(255) NOT NULL DEFAULT '' AFTER `vi_browser`,
|
||||
ADD `vi_device` varchar(255) NOT NULL DEFAULT '' AFTER `vi_os` ",
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
//소셜 로그인 관련 필드 및 구글 리챕챠 필드 추가
|
||||
if (!isset($config['cf_social_login_use'])) {
|
||||
sql_query(
|
||||
"ALTER TABLE `{$g5['config_table']}`
|
||||
ADD `cf_social_login_use` tinyint(4) NOT NULL DEFAULT '0' AFTER `cf_googl_shorturl_apikey`,
|
||||
ADD `cf_google_clientid` varchar(100) NOT NULL DEFAULT '' AFTER `cf_twitter_secret`,
|
||||
ADD `cf_google_secret` varchar(100) NOT NULL DEFAULT '' AFTER `cf_google_clientid`,
|
||||
ADD `cf_naver_clientid` varchar(100) NOT NULL DEFAULT '' AFTER `cf_google_secret`,
|
||||
ADD `cf_naver_secret` varchar(100) NOT NULL DEFAULT '' AFTER `cf_naver_clientid`,
|
||||
ADD `cf_kakao_rest_key` varchar(100) NOT NULL DEFAULT '' AFTER `cf_naver_secret`,
|
||||
ADD `cf_social_servicelist` varchar(255) NOT NULL DEFAULT '' AFTER `cf_social_login_use`,
|
||||
ADD `cf_payco_clientid` varchar(100) NOT NULL DEFAULT '' AFTER `cf_social_servicelist`,
|
||||
ADD `cf_payco_secret` varchar(100) NOT NULL DEFAULT '' AFTER `cf_payco_clientid`,
|
||||
ADD `cf_captcha` varchar(100) NOT NULL DEFAULT '' AFTER `cf_kakao_js_apikey`,
|
||||
ADD `cf_recaptcha_site_key` varchar(100) NOT NULL DEFAULT '' AFTER `cf_captcha`,
|
||||
ADD `cf_recaptcha_secret_key` varchar(100) NOT NULL DEFAULT '' AFTER `cf_recaptcha_site_key`
|
||||
",
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
//소셜 로그인 관련 필드 카카오 클라이언트 시크릿 추가
|
||||
if (!isset($config['cf_kakao_client_secret'])) {
|
||||
sql_query(
|
||||
"ALTER TABLE `{$g5['config_table']}`
|
||||
ADD `cf_kakao_client_secret` varchar(100) NOT NULL DEFAULT '' AFTER `cf_kakao_rest_key`
|
||||
",
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
// 회원 이미지 관련 필드 추가
|
||||
if (!isset($config['cf_member_img_size'])) {
|
||||
sql_query(
|
||||
"ALTER TABLE `{$g5['config_table']}`
|
||||
ADD `cf_member_img_size` int(11) NOT NULL DEFAULT '0' AFTER `cf_member_icon_height`,
|
||||
ADD `cf_member_img_width` int(11) NOT NULL DEFAULT '0' AFTER `cf_member_img_size`,
|
||||
ADD `cf_member_img_height` int(11) NOT NULL DEFAULT '0' AFTER `cf_member_img_width`
|
||||
",
|
||||
true
|
||||
);
|
||||
|
||||
$sql = " update {$g5['config_table']} set cf_member_img_size = 50000, cf_member_img_width = 60, cf_member_img_height = 60 ";
|
||||
sql_query($sql, false);
|
||||
|
||||
$config['cf_member_img_size'] = 50000;
|
||||
$config['cf_member_img_width'] = 60;
|
||||
$config['cf_member_img_height'] = 60;
|
||||
}
|
||||
|
||||
// 소셜 로그인 관리 테이블 없을 경우 생성
|
||||
if (!sql_query(" DESC {$g5['social_profile_table']} ", false)) {
|
||||
sql_query(
|
||||
" CREATE TABLE IF NOT EXISTS `{$g5['social_profile_table']}` (
|
||||
`mp_no` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`mb_id` varchar(255) NOT NULL DEFAULT '',
|
||||
`provider` varchar(50) NOT NULL DEFAULT '',
|
||||
`object_sha` varchar(45) NOT NULL DEFAULT '',
|
||||
`identifier` varchar(255) NOT NULL DEFAULT '',
|
||||
`profileurl` varchar(255) NOT NULL DEFAULT '',
|
||||
`photourl` varchar(255) NOT NULL DEFAULT '',
|
||||
`displayname` varchar(150) NOT NULL DEFAULT '',
|
||||
`description` varchar(255) NOT NULL DEFAULT '',
|
||||
`mp_register_day` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`mp_latest_day` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
UNIQUE KEY `mp_no` (`mp_no`),
|
||||
KEY `mb_id` (`mb_id`),
|
||||
KEY `provider` (`provider`)
|
||||
) ",
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
// 짧은 URL 주소를 사용 여부 필드 추가
|
||||
if (!isset($config['cf_bbs_rewrite'])) {
|
||||
sql_query(
|
||||
" ALTER TABLE `{$g5['config_table']}`
|
||||
ADD `cf_bbs_rewrite` tinyint(4) NOT NULL DEFAULT '0' AFTER `cf_link_target` ",
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
// 읽지 않은 메모 수 칼럼 추가
|
||||
if (!isset($member['mb_memo_cnt'])) {
|
||||
sql_query(
|
||||
" ALTER TABLE `{$g5['member_table']}`
|
||||
ADD `mb_memo_cnt` int(11) NOT NULL DEFAULT '0' AFTER `mb_memo_call`",
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
// 스크랩 읽은 수 추가
|
||||
if (!isset($member['mb_scrap_cnt'])) {
|
||||
sql_query(
|
||||
" ALTER TABLE `{$g5['member_table']}`
|
||||
ADD `mb_scrap_cnt` int(11) NOT NULL DEFAULT '0' AFTER `mb_memo_cnt`",
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
// 아이코드 토큰키 추가
|
||||
if (!isset($config['cf_icode_token_key'])) {
|
||||
$sql = "ALTER TABLE `{$g5['config_table']}`
|
||||
ADD COLUMN `cf_icode_token_key` VARCHAR(100) NOT NULL DEFAULT '' AFTER `cf_icode_server_port`; ";
|
||||
sql_query($sql, false);
|
||||
}
|
||||
// 아이디/비밀번호 찾기에 본인확인 사용 여부 필드 추가
|
||||
if (!isset($config['cf_cert_find'])) {
|
||||
$sql = "ALTER TABLE `{$g5['config_table']}`
|
||||
ADD COLUMN `cf_cert_find` TINYINT(4) NOT NULL DEFAULT '0' AFTER `cf_cert_use`; ";
|
||||
sql_query($sql, false);
|
||||
}
|
||||
// 간편인증 필드 추가
|
||||
if (!isset($config['cf_cert_simple'])) {
|
||||
$sql = "ALTER TABLE `{$g5['config_table']}`
|
||||
ADD COLUMN `cf_cert_simple` VARCHAR(255) NOT NULL DEFAULT '' AFTER `cf_cert_hp`; ";
|
||||
sql_query($sql, false);
|
||||
}
|
||||
if (!isset($config['cf_cert_kg_cd'])) {
|
||||
$sql = "ALTER TABLE `{$g5['config_table']}`
|
||||
ADD COLUMN `cf_cert_kg_cd` VARCHAR(255) NOT NULL DEFAULT '' AFTER `cf_cert_simple`; ";
|
||||
sql_query($sql, false);
|
||||
}
|
||||
if (!isset($config['cf_cert_kg_mid'])) {
|
||||
$sql = "ALTER TABLE `{$g5['config_table']}`
|
||||
ADD COLUMN `cf_cert_kg_mid` VARCHAR(255) NOT NULL DEFAULT '' AFTER `cf_cert_kg_cd`; ";
|
||||
sql_query($sql, false);
|
||||
}
|
||||
if (!isset($config['cf_cert_use_seed'])) {
|
||||
$sql = "ALTER TABLE `{$g5['config_table']}`
|
||||
ADD COLUMN `cf_cert_use_seed` TINYINT(4) NOT NULL DEFAULT '1' AFTER `cf_cert_kg_mid`; ";
|
||||
sql_query($sql, false);
|
||||
}
|
||||
if (!isset($config['cf_cert_kcp_enckey'])) {
|
||||
$sql = "ALTER TABLE `{$g5['config_table']}`
|
||||
ADD COLUMN `cf_cert_kcp_enckey` VARCHAR(100) NOT NULL DEFAULT '' AFTER `cf_cert_kcp_cd`; ";
|
||||
sql_query($sql, false);
|
||||
|
||||
$config['cf_cert_kcp_enckey'] = '';
|
||||
}
|
||||
|
||||
// 광고성 정보 수신 동의 사용 필드 추가
|
||||
if (!isset($config['cf_use_promotion'])) {
|
||||
sql_query(
|
||||
" ALTER TABLE `{$g5['config_table']}`
|
||||
ADD `cf_use_promotion` tinyint(1) NOT NULL DEFAULT '0' AFTER `cf_privacy` ",
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
// 광고성 정보 수신 동의 여부 필드 추가 + 메일 / SMS 수신 일자 추가
|
||||
if (!isset($member['mb_marketing_agree'])) {
|
||||
sql_query(
|
||||
" ALTER TABLE `{$g5['member_table']}`
|
||||
ADD `mb_marketing_agree` tinyint(1) NOT NULL DEFAULT '0' AFTER `mb_scrap_cnt`,
|
||||
ADD `mb_marketing_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER `mb_marketing_agree`,
|
||||
ADD `mb_thirdparty_agree` tinyint(1) NOT NULL DEFAULT '0' AFTER `mb_marketing_date`,
|
||||
ADD `mb_thirdparty_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER `mb_thirdparty_agree`,
|
||||
ADD `mb_agree_log` TEXT NOT NULL AFTER `mb_thirdparty_date`,
|
||||
ADD `mb_mailling_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER `mb_mailling`,
|
||||
ADD `mb_sms_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER `mb_sms` ",
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
if (!$config['cf_faq_skin']) {
|
||||
$config['cf_faq_skin'] = "basic";
|
||||
}
|
||||
@@ -1068,7 +637,24 @@ if ($config['cf_sms_use'] && $config['cf_icode_id'] && $config['cf_icode_pw']) {
|
||||
<?php echo option_selected("", $config['cf_cert_hp'], "사용안함"); ?>
|
||||
<?php echo option_selected("kcb", $config['cf_cert_hp'], "코리아크레딧뷰로(KCB) 휴대폰 본인확인"); ?>
|
||||
<?php echo option_selected("kcp", $config['cf_cert_hp'], "NHN KCP 휴대폰 본인확인"); ?>
|
||||
<?php echo option_selected("kcp_v2", $config['cf_cert_hp'], "NHN KCP 휴대폰 본인확인(api_v2)"); ?>
|
||||
</select>
|
||||
<div id="cf_cert_hp_kcp_v2_notice" style="display:<?php echo ($config['cf_cert_hp'] == 'kcp_v2') ? 'block' : 'none'; ?>; margin-top:8px; padding:10px 12px; background:#fff8e1; border:1px solid #ffd54f; border-radius:4px; color:#5d4037; line-height:1.5;">
|
||||
<strong>NHN KCP 휴대폰 본인확인(api_v2)</strong> 사용 시,<br>
|
||||
NHN KCP 상점관리자 > 부가서비스 > 휴대폰본인확인 > 연동방식 설정 에서 <strong>신규 연동방식(V2) 사용여부를 ‘사용’</strong> 으로 변경해야 정상 동작합니다.<br>
|
||||
PHP 7.0 이상 환경에서만 동작하며, PHP 7.0 미만에서는 사용할 수 없습니다.
|
||||
</div>
|
||||
<script>
|
||||
jQuery(function($){
|
||||
function toggle_kcp_v2_notice() {
|
||||
var is_kcp_v2 = $('#cf_cert_hp').val() === 'kcp_v2';
|
||||
$('#cf_cert_hp_kcp_v2_notice').toggle(is_kcp_v2);
|
||||
}
|
||||
|
||||
$('#cf_cert_hp').on('change', toggle_kcp_v2_notice);
|
||||
toggle_kcp_v2_notice();
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -1104,16 +690,22 @@ if ($config['cf_sms_use'] && $config['cf_icode_id'] && $config['cf_icode_pw']) {
|
||||
<tr>
|
||||
<th scope="row" class="cf_cert_service"><label for="cf_cert_kcp_cd">NHN KCP 사이트코드</label></th>
|
||||
<td class="cf_cert_service">
|
||||
<?php
|
||||
$cf_cert_kcp_cd = get_sanitize_input($config['cf_cert_kcp_cd']);
|
||||
if (preg_match('/^SM([A-Z0-9]{3})$/i', $cf_cert_kcp_cd, $matches)) {
|
||||
$cf_cert_kcp_cd = $matches[1];
|
||||
}
|
||||
?>
|
||||
<?php echo help('SM으로 시작하는 5자리 사이트 코드중 뒤의 3자리만 입력해 주십시오.<br>서비스에 가입되어 있지 않다면, 본인확인 서비스 신청페이지에서 서비스 신청 후 사이트코드를 발급 받으실 수 있습니다.') ?>
|
||||
<span class="sitecode">SM</span>
|
||||
<input type="text" name="cf_cert_kcp_cd" value="<?php echo get_sanitize_input($config['cf_cert_kcp_cd']); ?>" id="cf_cert_kcp_cd" class="frm_input" size="3"> <a href="http://sir.kr/main/service/p_cert.php" target="_blank" class="btn_frmline">NHN KCP 휴대폰 본인확인 서비스 신청페이지</a>
|
||||
<span class="sitecode" id="cf_cert_kcp_cd_prefix">SM</span>
|
||||
<input type="text" name="cf_cert_kcp_cd" value="<?php echo $cf_cert_kcp_cd; ?>" id="cf_cert_kcp_cd" class="frm_input" size="3" maxlength="3"> <a href="http://sir.kr/main/service/p_cert.php" target="_blank" class="btn_frmline">NHN KCP 휴대폰 본인확인 서비스 신청페이지</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row" class="cf_cert_service"><label for="cf_cert_kcp_enckey">NHN KCP 가맹점 인증키</label></th>
|
||||
<td class="cf_cert_service">
|
||||
<?php echo help('(선택사항, 추후 NHN_KCP 상점관리자에서 인증키 발급 메뉴 오픈일정 이후부터 적용되는 내용입니다.)<br>NHN_KCP 상점관리자 > 기술관리센터 > 인증센터 > 가맹점 인증키관리 에서 인증키 발급 후에 인증키 정보를 입력') ?>
|
||||
<input type="text" name="cf_cert_kcp_enckey" value="<?php echo get_sanitize_input($config['cf_cert_kcp_enckey']); ?>" id="cf_cert_kcp_enckey" class="frm_input" maxlength="100" size="40"> <a href="https://partner.kcp.co.kr" target="_blank" class="btn_frmline">NHN KCP 상점관리자</a>
|
||||
<?php echo help('NHN KCP 상점관리자 > 기술관리센터 > 인증센터 > 가맹점 인증키관리 에서 인증키를 발급받아 입력해 주십시오.<br>NHN KCP 휴대폰 본인확인(api_v2)도 이 인증키 값을 사용합니다.') ?>
|
||||
<input type="text" name="cf_cert_kcp_enckey" value="<?php echo get_sanitize_input($config['cf_cert_kcp_enckey']); ?>" id="cf_cert_kcp_enckey" class="frm_input" maxlength="100" size="70"> <a href="https://partner.kcp.co.kr" target="_blank" class="btn_frmline">NHN KCP 상점관리자</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -1166,6 +758,13 @@ if ($config['cf_sms_use'] && $config['cf_icode_id'] && $config['cf_icode_pw']) {
|
||||
<input type="checkbox" name="cf_use_email_certify" value="1" id="cf_use_email_certify" <?php echo $config['cf_use_email_certify'] ? 'checked' : ''; ?>> 사용
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="cf_email_certify_minutes">메일인증 유효시간</label></th>
|
||||
<td>
|
||||
<?php echo help('인증메일 발송 후 링크를 사용할 수 있는 시간을 분 단위로 설정합니다. 0은 만료시간과 미인증 만료 정리를 적용하지 않습니다.<br>만료된 미인증 회원은 최고관리자 접속 시 하루 한 번 실행되는 정리에서 탈퇴 처리하며, 본인확인 정보와 소셜 연결을 해제합니다. 나머지 회원자료는 회원탈퇴후 삭제일 설정에 따라 정리합니다.') ?>
|
||||
<input type="number" name="cf_email_certify_minutes" value="<?php echo isset($config['cf_email_certify_minutes']) ? (int) $config['cf_email_certify_minutes'] : 60; ?>" id="cf_email_certify_minutes" class="frm_input" min="0"> 분
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="cf_formmail_is_member">폼메일 사용 여부</label></th>
|
||||
<td>
|
||||
@@ -1386,7 +985,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>
|
||||
@@ -1396,7 +995,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>
|
||||
@@ -1412,7 +1011,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>
|
||||
@@ -1428,7 +1027,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>
|
||||
@@ -1593,17 +1192,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>
|
||||
|
||||
@@ -1708,7 +1314,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 {
|
||||
@@ -1724,8 +1329,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; // 캡챠 사용시 자바스크립트에서 입력된 캡챠를 검사함 ?>
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -56,6 +56,7 @@ if (isset($_POST['cf_intercept_ip']) && $_POST['cf_intercept_ip']) {
|
||||
|
||||
$check_keys = array(
|
||||
'cf_use_email_certify' => 'int',
|
||||
'cf_email_certify_minutes' => 'int',
|
||||
'cf_use_homepage' => 'int',
|
||||
'cf_req_homepage' => 'int',
|
||||
'cf_use_tel' => 'int',
|
||||
@@ -173,11 +174,13 @@ 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])))) : '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$_POST['cf_email_certify_minutes'] = max(0, $_POST['cf_email_certify_minutes']);
|
||||
|
||||
// 본인확인을 사용할 경우 아이핀, 휴대폰인증 중 하나는 선택되어야 함
|
||||
if ($_POST['cf_cert_use'] && !$_POST['cf_cert_ipin'] && !$_POST['cf_cert_hp'] && !$_POST['cf_cert_simple']) {
|
||||
alert('본인확인을 위해 아이핀, 휴대폰 본인확인, KG이니시스 간편인증 서비스 중 하나 이상 선택해 주십시오.');
|
||||
@@ -226,6 +229,7 @@ $sql = " update {$g5['config_table']}
|
||||
cf_point_term = '{$_POST['cf_point_term']}',
|
||||
cf_use_copy_log = '{$_POST['cf_use_copy_log']}',
|
||||
cf_use_email_certify = '{$_POST['cf_use_email_certify']}',
|
||||
cf_email_certify_minutes = '{$_POST['cf_email_certify_minutes']}',
|
||||
cf_login_point = '{$_POST['cf_login_point']}',
|
||||
cf_cut_name = '{$_POST['cf_cut_name']}',
|
||||
cf_nick_modify = '{$_POST['cf_nick_modify']}',
|
||||
|
||||
@@ -8,41 +8,12 @@ auth_check_menu($auth, $sub_menu, "w");
|
||||
$co_id = isset($_REQUEST['co_id']) ? preg_replace('/[^a-z0-9_]/i', '', $_REQUEST['co_id']) : '';
|
||||
|
||||
// 상단, 하단 파일경로 필드 추가
|
||||
if (!sql_query(" select co_include_head from {$g5['content_table']} limit 1 ", false)) {
|
||||
$sql = " ALTER TABLE `{$g5['content_table']}` ADD `co_include_head` VARCHAR( 255 ) NOT NULL ,
|
||||
ADD `co_include_tail` VARCHAR( 255 ) NOT NULL ";
|
||||
sql_query($sql, false);
|
||||
}
|
||||
|
||||
// html purifier 사용여부 필드
|
||||
if (!sql_query(" select co_tag_filter_use from {$g5['content_table']} limit 1 ", false)) {
|
||||
sql_query(
|
||||
" ALTER TABLE `{$g5['content_table']}`
|
||||
ADD `co_tag_filter_use` tinyint(4) NOT NULL DEFAULT '0' AFTER `co_content` ",
|
||||
true
|
||||
);
|
||||
sql_query(" update {$g5['content_table']} set co_tag_filter_use = '1' ");
|
||||
}
|
||||
|
||||
// 모바일 내용 추가
|
||||
if (!sql_query(" select co_mobile_content from {$g5['content_table']} limit 1", false)) {
|
||||
sql_query(
|
||||
" ALTER TABLE `{$g5['content_table']}`
|
||||
ADD `co_mobile_content` longtext NOT NULL AFTER `co_content` ",
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
// 스킨 설정 추가
|
||||
if (!sql_query(" select co_skin from {$g5['content_table']} limit 1 ", false)) {
|
||||
sql_query(
|
||||
" ALTER TABLE `{$g5['content_table']}`
|
||||
ADD `co_skin` varchar(255) NOT NULL DEFAULT '' AFTER `co_mobile_content`,
|
||||
ADD `co_mobile_skin` varchar(255) NOT NULL DEFAULT '' AFTER `co_skin` ",
|
||||
true
|
||||
);
|
||||
sql_query(" update {$g5['content_table']} set co_skin = 'basic', co_mobile_skin = 'basic' ");
|
||||
}
|
||||
|
||||
$html_title = "내용";
|
||||
$g5['title'] = $html_title . ' 관리';
|
||||
|
||||
@@ -26,17 +26,34 @@ 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)) : '';
|
||||
|
||||
// 최고 관리자가 아니면 include 경로 변경 불가 (board_form_update.php 와 동일 정책)
|
||||
if ($is_admin !== 'super') {
|
||||
if ($w == 'u') {
|
||||
$co_include_head = isset($co_row['co_include_head']) ? $co_row['co_include_head'] : '';
|
||||
$co_include_tail = isset($co_row['co_include_tail']) ? $co_row['co_include_tail'] : '';
|
||||
} else {
|
||||
$co_include_head = '';
|
||||
$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;
|
||||
$co_html = isset($_POST['co_html']) ? (int) $_POST['co_html'] : 0;
|
||||
$co_content = isset($_POST['co_content']) ? $_POST['co_content'] : '';
|
||||
$co_mobile_content = isset($_POST['co_mobile_content']) ? $_POST['co_mobile_content'] : '';
|
||||
$co_skin = isset($_POST['co_skin']) ? clean_xss_tags($_POST['co_skin'], 1, 1) : '';
|
||||
$co_mobile_skin = isset($_POST['co_mobile_skin']) ? clean_xss_tags($_POST['co_mobile_skin'], 1, 1) : '';
|
||||
$co_skin = isset($_POST['co_skin']) ? addslashes(clean_xss_tags(stripslashes($_POST['co_skin']), 1, 1)) : '';
|
||||
$co_mobile_skin = isset($_POST['co_mobile_skin']) ? addslashes(clean_xss_tags(stripslashes($_POST['co_mobile_skin']), 1, 1)) : '';
|
||||
|
||||
// 관리자가 자동등록방지를 사용해야 할 경우
|
||||
if (((isset($co_row['co_include_head']) && $co_row['co_include_head'] !== $co_include_head) || (isset($co_row['co_include_tail']) && $co_row['co_include_tail'] !== $co_include_tail)) && function_exists('get_admin_captcha_by') && get_admin_captcha_by()) {
|
||||
@@ -75,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/ 포함된 문자를 상단 파일 경로에 포함시킬수 없습니다.';
|
||||
@@ -85,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',
|
||||
@@ -136,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);
|
||||
|
||||
@@ -8,30 +8,6 @@ if (!isset($g5['content_table'])) {
|
||||
die('<meta charset="utf-8">/data/dbconfig.php 파일에 <strong>$g5[\'content_table\'] = G5_TABLE_PREFIX.\'content\';</strong> 를 추가해 주세요.');
|
||||
}
|
||||
//내용(컨텐츠)정보 테이블이 있는지 검사한다.
|
||||
if (!sql_query(" DESCRIBE {$g5['content_table']} ", false)) {
|
||||
if (sql_query(" DESCRIBE {$g5['g5_shop_content_table']} ", false)) {
|
||||
sql_query(" ALTER TABLE {$g5['g5_shop_content_table']} RENAME TO `{$g5['content_table']}` ;", false);
|
||||
} else {
|
||||
$query_cp = sql_query(
|
||||
" CREATE TABLE IF NOT EXISTS `{$g5['content_table']}` (
|
||||
`co_id` varchar(20) NOT NULL DEFAULT '',
|
||||
`co_html` tinyint(4) NOT NULL DEFAULT '0',
|
||||
`co_subject` varchar(255) NOT NULL DEFAULT '',
|
||||
`co_content` longtext NOT NULL,
|
||||
`co_hit` int(11) NOT NULL DEFAULT '0',
|
||||
`co_include_head` varchar(255) NOT NULL,
|
||||
`co_include_tail` varchar(255) NOT NULL,
|
||||
PRIMARY KEY (`co_id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ",
|
||||
true
|
||||
);
|
||||
|
||||
// 내용관리 생성
|
||||
sql_query(" insert into `{$g5['content_table']}` set co_id = 'company', co_html = '1', co_subject = '회사소개', co_content= '<p align=center><b>회사소개에 대한 내용을 입력하십시오.</b></p>' ", false);
|
||||
sql_query(" insert into `{$g5['content_table']}` set co_id = 'privacy', co_html = '1', co_subject = '개인정보 처리방침', co_content= '<p align=center><b>개인정보 처리방침에 대한 내용을 입력하십시오.</b></p>' ", false);
|
||||
sql_query(" insert into `{$g5['content_table']}` set co_id = 'provision', co_html = '1', co_subject = '서비스 이용약관', co_content= '<p align=center><b>서비스 이용약관에 대한 내용을 입력하십시오.</b></p>' ", false);
|
||||
}
|
||||
}
|
||||
|
||||
$g5['title'] = '내용관리';
|
||||
require_once G5_ADMIN_PATH . '/admin.head.php';
|
||||
|
||||
+4
-15
@@ -354,16 +354,7 @@ border-bottom: 5px solid black;}
|
||||
.excel-download-progress .progress-download-box a:hover { border-color: #6f809a; box-shadow: 0 2px 4px rgba(111, 128, 154, 0.15); }
|
||||
.excel-download-progress .progress-download-box a:active { box-shadow: inset 0 1px 2px rgba(0,0,0,0.1); }
|
||||
|
||||
.field-select-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 15px; gap: 0px 10px; padding: 10px; background-color: #f9fafb; border: 1px solid #e5e7eb; border-radius: 8px; color: #374151; }
|
||||
.field-select-form label { display: flex; align-items: center; cursor: pointer; padding: 6px 10px; border-radius: 4px; }
|
||||
.field-select-form label:hover { background-color: #f3f4f6; }
|
||||
.field-select-form input[type="checkbox"] { margin-right: 8px; transform: scale(1.2); }
|
||||
.field-separator { grid-column: 1 / -1; border-top: 1px solid #d1d5db; margin: 8px 0; }
|
||||
.selected-fields-preview { padding: 8px; background-color: #eef2f7; border: 1px solid #d1d5db; border-radius: 6px; margin: 10px 0px; color: #1f2937; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
|
||||
.selected-fields-preview strong { padding: 4px 8px; }
|
||||
.selected-fields-preview .field-tag { background-color: #dbeafe; color: #1e40af; padding: 4px 8px; border-radius: 4px; }
|
||||
|
||||
/* 페이지 내 실행 */
|
||||
/* 페이지 내 실행 */
|
||||
.local_cmd {min-width:960px}
|
||||
.local_cmd01 {margin:0 0 10px;padding:0 }
|
||||
.local_cmd01 .cmd_tit {font-weight:bold}
|
||||
@@ -705,7 +696,6 @@ a.scf_pgreg {display:inline-block;margin:5px 0 0;padding:5px 10px;background:#22
|
||||
a.kcp_btn {display:inline-block;margin:5px 0 0;padding:5px 10px;background:#226C8B;color:#fff;font-weight:normal;text-decoration:none}
|
||||
a.lg_btn{display:inline-block;margin:5px 0 0;padding:5px 10px;background:#ED008C;color:#fff;font-weight:normal;text-decoration:none}
|
||||
a.kg_btn{display:inline-block;margin:5px 0 0;padding:5px 10px;background:#4A2C7C;color:#fff;font-weight:normal;text-decoration:none}
|
||||
a.kakao_btn{display:inline-block;margin:5px 0 0;padding:5px 10px;background:#FDDC2F;color:#3B1E1E;font-weight:normal;text-decoration:none}
|
||||
a.naver_btn {display:inline-block;margin:5px 0 0;padding:5px 10px;background:#00C73C;color:#fff;font-weight:normal;text-decoration:none}
|
||||
a.nicepay_btn{display:inline-block;margin:5px 0 0;padding:5px 10px;background:#0057bf;color:#fff;font-weight:normal;text-decoration:none}
|
||||
|
||||
@@ -749,7 +739,6 @@ ul.de_pg_tab li.tab-current a{background:#2CC185;color:#fff}
|
||||
.lg_info_fld th{background-color:#FFF4FA}
|
||||
.lg_info_fld_v2 th{background-color:#ffe8f5}
|
||||
.inicis_info_fld th{background-color:#F6F1FF}
|
||||
.kakao_info_fld th{background-color:#FFFCED}
|
||||
.naver_info_fld th{background-color:#F3FFF3}
|
||||
.nicepay_info_fld th{background-color:#d1e6ff}
|
||||
|
||||
@@ -1083,8 +1072,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;}
|
||||
@@ -1217,4 +1206,4 @@ input[type="text"]{max-width:200px}
|
||||
@media only screen and (max-device-width : 480px) and (orientation : portrait){
|
||||
/* Styles */
|
||||
input[type="text"]{max-width:200px}
|
||||
}
|
||||
}
|
||||
|
||||
+199
-352
@@ -1,366 +1,213 @@
|
||||
<?php
|
||||
$sub_menu = '100410';
|
||||
include_once('./_common.php');
|
||||
include_once(G5_LIB_PATH . '/migration.lib.php');
|
||||
include_once(G5_LIB_PATH . '/shop_install.lib.php');
|
||||
|
||||
auth_check_menu($auth, $sub_menu, 'r');
|
||||
|
||||
if ($is_admin != 'super') {
|
||||
alert('최고관리자만 접근 가능합니다.');
|
||||
}
|
||||
|
||||
$is_execute = isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] === 'POST';
|
||||
$migration_result = array('success' => true, 'applied' => 0, 'skipped' => 0, 'errors' => array());
|
||||
$shop_install_result = null;
|
||||
$action = '';
|
||||
|
||||
if ($is_execute) {
|
||||
check_demo();
|
||||
check_admin_token();
|
||||
$action = isset($_POST['action']) ? trim($_POST['action']) : 'migrate';
|
||||
if ($action === 'install_shop') {
|
||||
$shop_install_result = g5_shop_install_run();
|
||||
} elseif ($action === 'record_existing') {
|
||||
$migration_result = g5_migration_run('', true);
|
||||
} else {
|
||||
$migration_id = isset($_POST['migration_id']) ? trim($_POST['migration_id']) : '';
|
||||
$migration_result = g5_migration_run($migration_id);
|
||||
$migration_result = run_replace('admin_dbupgrade_result', $migration_result);
|
||||
}
|
||||
}
|
||||
|
||||
$migration_statuses = g5_migration_status();
|
||||
$pending_count = 0;
|
||||
$unrecorded_count = 0;
|
||||
foreach ($migration_statuses as $migration_status) {
|
||||
if (isset($migration_status['status']) && $migration_status['status'] === 'unrecorded') {
|
||||
$unrecorded_count++;
|
||||
} elseif (isset($migration_status['error']) || $migration_status['status'] !== 'success' || $migration_status['checksum_changed']) {
|
||||
$pending_count++;
|
||||
}
|
||||
}
|
||||
|
||||
if ($shop_install_result !== null && $shop_install_result['success']) {
|
||||
alert('쇼핑몰 설치가 완료되었습니다.', G5_ADMIN_URL . '/dbupgrade.php');
|
||||
} elseif ($shop_install_result !== null) {
|
||||
$db_upgrade_msg = '쇼핑몰 설치에 실패했습니다. 오류 내용을 확인해 주십시오.';
|
||||
} elseif (!$is_execute) {
|
||||
$db_upgrade_msg = $pending_count ? '확인·실행이 필요한 DB 마이그레이션이 있습니다. 아래 내용을 확인해 주십시오.' : ($unrecorded_count ? '현재 실행할 변경은 없지만 기존 상태 확인 이력이 등록되지 않았습니다.' : 'DB 마이그레이션이 모두 적용되어 있습니다.');
|
||||
} elseif (!$migration_result['success']) {
|
||||
$db_upgrade_msg = 'DB 마이그레이션에 실패했습니다. 오류 내용을 확인해 주십시오.';
|
||||
} elseif ($action === 'record_existing') {
|
||||
$db_upgrade_msg = '기존 상태 확인 이력 ' . (int) $migration_result['skipped'] . '건을 등록했습니다. 선행 항목에 실행이 필요하거나 실패 이력이 있으면 등록을 중단합니다.';
|
||||
} elseif ($migration_result['applied'] || $migration_result['skipped']) {
|
||||
$db_upgrade_msg = 'DB 마이그레이션이 완료되었습니다.';
|
||||
} else {
|
||||
$db_upgrade_msg = '적용할 DB 마이그레이션이 없습니다.';
|
||||
}
|
||||
|
||||
$g5['title'] = 'DB 업그레이드';
|
||||
include_once('./admin.head.php');
|
||||
|
||||
$is_check = false;
|
||||
|
||||
//소셜 로그인 관련 필드 및 구글 리챕챠 필드 추가
|
||||
if(!isset($config['cf_social_login_use'])) {
|
||||
sql_query("ALTER TABLE `{$g5['config_table']}`
|
||||
ADD `cf_social_login_use` tinyint(4) NOT NULL DEFAULT '0' AFTER `cf_googl_shorturl_apikey`,
|
||||
ADD `cf_google_clientid` varchar(100) NOT NULL DEFAULT '' AFTER `cf_twitter_secret`,
|
||||
ADD `cf_google_secret` varchar(100) NOT NULL DEFAULT '' AFTER `cf_google_clientid`,
|
||||
ADD `cf_naver_clientid` varchar(100) NOT NULL DEFAULT '' AFTER `cf_google_secret`,
|
||||
ADD `cf_naver_secret` varchar(100) NOT NULL DEFAULT '' AFTER `cf_naver_clientid`,
|
||||
ADD `cf_kakao_rest_key` varchar(100) NOT NULL DEFAULT '' AFTER `cf_naver_secret`,
|
||||
ADD `cf_social_servicelist` varchar(255) NOT NULL DEFAULT '' AFTER `cf_social_login_use`,
|
||||
ADD `cf_payco_clientid` varchar(100) NOT NULL DEFAULT '' AFTER `cf_social_servicelist`,
|
||||
ADD `cf_payco_secret` varchar(100) NOT NULL DEFAULT '' AFTER `cf_payco_clientid`,
|
||||
ADD `cf_captcha` varchar(100) NOT NULL DEFAULT '' AFTER `cf_kakao_js_apikey`,
|
||||
ADD `cf_recaptcha_site_key` varchar(100) NOT NULL DEFAULT '' AFTER `cf_captcha`,
|
||||
ADD `cf_recaptcha_secret_key` varchar(100) NOT NULL DEFAULT '' AFTER `cf_recaptcha_site_key`
|
||||
", true);
|
||||
|
||||
$is_check = true;
|
||||
}
|
||||
|
||||
//소셜 로그인 관련 필드 카카오 클라이언트 시크릿 추가
|
||||
if(!isset($config['cf_kakao_client_secret'])) {
|
||||
sql_query("ALTER TABLE `{$g5['config_table']}`
|
||||
ADD `cf_kakao_client_secret` varchar(100) NOT NULL DEFAULT '' AFTER `cf_kakao_rest_key`
|
||||
", true);
|
||||
|
||||
$is_check = true;
|
||||
}
|
||||
|
||||
// 회원 이미지 관련 필드 추가
|
||||
if(!isset($config['cf_member_img_size'])) {
|
||||
sql_query("ALTER TABLE `{$g5['config_table']}`
|
||||
ADD `cf_member_img_size` int(11) NOT NULL DEFAULT '0' AFTER `cf_member_icon_height`,
|
||||
ADD `cf_member_img_width` int(11) NOT NULL DEFAULT '0' AFTER `cf_member_img_size`,
|
||||
ADD `cf_member_img_height` int(11) NOT NULL DEFAULT '0' AFTER `cf_member_img_width`
|
||||
", true);
|
||||
|
||||
$sql = " update {$g5['config_table']} set cf_member_img_size = 50000, cf_member_img_width = 60, cf_member_img_height = 60 ";
|
||||
sql_query($sql, false);
|
||||
|
||||
$is_check = true;
|
||||
}
|
||||
|
||||
// 소셜 로그인 관리 테이블 없을 경우 생성
|
||||
if( isset($g5['social_profile_table']) && !sql_query(" DESC {$g5['social_profile_table']} ", false)) {
|
||||
sql_query(" CREATE TABLE IF NOT EXISTS `{$g5['social_profile_table']}` (
|
||||
`mp_no` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`mb_id` varchar(255) NOT NULL DEFAULT '',
|
||||
`provider` varchar(50) NOT NULL DEFAULT '',
|
||||
`object_sha` varchar(45) NOT NULL DEFAULT '',
|
||||
`identifier` varchar(255) NOT NULL DEFAULT '',
|
||||
`profileurl` varchar(255) NOT NULL DEFAULT '',
|
||||
`photourl` varchar(255) NOT NULL DEFAULT '',
|
||||
`displayname` varchar(150) NOT NULL DEFAULT '',
|
||||
`description` varchar(255) NOT NULL DEFAULT '',
|
||||
`mp_register_day` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`mp_latest_day` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
UNIQUE KEY `mp_no` (`mp_no`),
|
||||
KEY `mb_id` (`mb_id`),
|
||||
KEY `provider` (`provider`)
|
||||
) ", true);
|
||||
|
||||
$is_check = true;
|
||||
}
|
||||
|
||||
// 게시판 짧은 주소
|
||||
$sql = " select bo_table from {$g5['board_table']} ";
|
||||
$result = sql_query($sql);
|
||||
|
||||
while ($row = sql_fetch_array($result)) {
|
||||
$write_table = $g5['write_prefix'] . $row['bo_table']; // 게시판 테이블 전체이름
|
||||
|
||||
$sql = " SHOW COLUMNS FROM {$write_table} LIKE 'wr_seo_title' ";
|
||||
$row = sql_fetch($sql);
|
||||
|
||||
if( !$row ){
|
||||
sql_query("ALTER TABLE `{$write_table}`
|
||||
ADD `wr_seo_title` varchar(200) NOT NULL DEFAULT '' AFTER `wr_content`,
|
||||
ADD INDEX `wr_seo_title` (`wr_seo_title`);
|
||||
", false);
|
||||
|
||||
$is_check = true;
|
||||
}
|
||||
}
|
||||
|
||||
// 내용 관리 짧은 주소
|
||||
$sql = " SHOW COLUMNS FROM `{$g5['content_table']}` LIKE 'co_seo_title' ";
|
||||
$row = sql_fetch($sql);
|
||||
|
||||
if( !$row ){
|
||||
sql_query("ALTER TABLE `{$g5['content_table']}`
|
||||
ADD `co_seo_title` varchar(200) NOT NULL DEFAULT '' AFTER `co_content`,
|
||||
ADD INDEX `co_seo_title` (`co_seo_title`);
|
||||
", false);
|
||||
|
||||
$is_check = true;
|
||||
}
|
||||
|
||||
$sql = "select * from {$g5['content_table']} limit 100 ";
|
||||
$result = sql_query($sql);
|
||||
|
||||
while ($row = sql_fetch_array($result)) {
|
||||
|
||||
if( ! $row['co_seo_title']){
|
||||
|
||||
$co_seo_title = exist_seo_title_recursive('content', generate_seo_title($row['co_subject']), $g5['content_table'], $row['co_id']);
|
||||
|
||||
$sql = " update {$g5['content_table']}
|
||||
set co_seo_title = '$co_seo_title'
|
||||
where co_id = '{$row['co_id']}' ";
|
||||
sql_query($sql);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// 메모 테이블
|
||||
$sql = " SHOW COLUMNS FROM `{$g5['memo_table']}` LIKE 'me_send_id' ";
|
||||
$row = sql_fetch($sql);
|
||||
|
||||
if( !$row ){
|
||||
sql_query("ALTER TABLE `{$g5['memo_table']}`
|
||||
ADD `me_send_id` INT(11) NOT NULL DEFAULT '0',
|
||||
ADD `me_type` ENUM('send','recv') NOT NULL DEFAULT 'recv',
|
||||
ADD `me_send_ip` VARCHAR(100) NOT NULL DEFAULT '',
|
||||
CHANGE COLUMN `me_id` `me_id` INT(11) NOT NULL AUTO_INCREMENT;
|
||||
", false);
|
||||
|
||||
$is_check = true;
|
||||
}
|
||||
|
||||
// 읽지 않은 메모 수 칼럼
|
||||
if(!isset($member['mb_memo_cnt'])) {
|
||||
sql_query(" ALTER TABLE `{$g5['member_table']}`
|
||||
ADD `mb_memo_cnt` int(11) NOT NULL DEFAULT '0' AFTER `mb_memo_call`", true);
|
||||
|
||||
$is_check = true;
|
||||
}
|
||||
|
||||
// 스크랩 읽은 수 추가
|
||||
if(!isset($member['mb_scrap_cnt'])) {
|
||||
sql_query(" ALTER TABLE `{$g5['member_table']}`
|
||||
ADD `mb_scrap_cnt` int(11) NOT NULL DEFAULT '0' AFTER `mb_memo_cnt`", true);
|
||||
|
||||
$is_check = true;
|
||||
}
|
||||
|
||||
// 짧은 URL 주소를 사용 여부 필드 추가
|
||||
if (!isset($config['cf_bbs_rewrite'])) {
|
||||
sql_query(" ALTER TABLE `{$g5['config_table']}`
|
||||
ADD `cf_bbs_rewrite` tinyint(4) NOT NULL DEFAULT '0' AFTER `cf_link_target` ", true);
|
||||
|
||||
$is_check = true;
|
||||
}
|
||||
|
||||
// 파일테이블에 추가 칼럼
|
||||
|
||||
$sql = " SHOW COLUMNS FROM `{$g5['board_file_table']}` LIKE 'bf_fileurl' ";
|
||||
$row = sql_fetch($sql);
|
||||
|
||||
if( !$row ) {
|
||||
sql_query(" ALTER TABLE `{$g5['board_file_table']}`
|
||||
ADD COLUMN `bf_fileurl` VARCHAR(255) NOT NULL DEFAULT '' AFTER `bf_content`,
|
||||
ADD COLUMN `bf_thumburl` VARCHAR(255) NOT NULL DEFAULT '' AFTER `bf_fileurl`,
|
||||
ADD COLUMN `bf_storage` VARCHAR(50) NOT NULL DEFAULT '' AFTER `bf_thumburl`", true);
|
||||
|
||||
$is_check = true;
|
||||
}
|
||||
|
||||
if (defined('G5_USE_SHOP') && G5_USE_SHOP) {
|
||||
// 임시저장 테이블이 없을 경우 생성
|
||||
if(!sql_query(" DESC {$g5['g5_shop_post_log_table']} ", false)) {
|
||||
sql_query(" CREATE TABLE IF NOT EXISTS `{$g5['g5_shop_post_log_table']}` (
|
||||
`log_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`oid` bigint(20) unsigned NOT NULL,
|
||||
`mb_id` varchar(255) NOT NULL DEFAULT '',
|
||||
`post_data` text NOT NULL,
|
||||
`ol_code` varchar(255) NOT NULL DEFAULT '',
|
||||
`ol_msg` text NOT NULL,
|
||||
`ol_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`ol_ip` varchar(25) NOT NULL DEFAULT '',
|
||||
PRIMARY KEY (`log_id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ", true);
|
||||
|
||||
$is_check = true;
|
||||
}
|
||||
|
||||
$result = sql_query("describe `{$g5['g5_shop_post_log_table']}`");
|
||||
while ($row = sql_fetch_array($result)){
|
||||
if( isset($row['Field']) && $row['Field'] === 'ol_msg' && $row['Type'] === 'varchar(255)' ){
|
||||
sql_query("ALTER TABLE `{$g5['g5_shop_post_log_table']}` MODIFY ol_msg TEXT NOT NULL;", false);
|
||||
sql_query("ALTER TABLE `{$g5['g5_shop_post_log_table']}` DROP PRIMARY KEY;", false);
|
||||
sql_query("ALTER TABLE `{$g5['g5_shop_post_log_table']}` ADD `log_id` int(11) NOT NULL AUTO_INCREMENT, ADD PRIMARY KEY (`log_id`);", false);
|
||||
$is_check = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isset($default['de_id'])) {
|
||||
sql_query(" ALTER TABLE `{$g5['g5_shop_default_table']}`
|
||||
ADD COLUMN `de_id` INT(11) NOT NULL AUTO_INCREMENT FIRST,
|
||||
ADD PRIMARY KEY (`de_id`); ", true);
|
||||
|
||||
$is_check = true;
|
||||
}
|
||||
}
|
||||
|
||||
// auth.au_menu 컬럼 크기 조정
|
||||
$sql = " SHOW COLUMNS FROM `{$g5['auth_table']}` LIKE 'au_menu' ";
|
||||
$row = sql_fetch($sql);
|
||||
if (
|
||||
stripos($row['Type'], 'varchar') !== false
|
||||
&& (int) preg_replace('/[^0-9]/', '', $row['Type']) < 50
|
||||
) {
|
||||
sql_query(" ALTER TABLE `{$g5['auth_table']}` CHANGE `au_menu` `au_menu` VARCHAR(50) NOT NULL; ", true);
|
||||
|
||||
$is_check = true;
|
||||
}
|
||||
|
||||
// qa config 테이블 auto id key 추가
|
||||
$row = sql_fetch("select * from `{$g5['qa_config_table']}` limit 1");
|
||||
if (!isset($row['qa_id'])) {
|
||||
sql_query(" ALTER TABLE `{$g5['qa_config_table']}` ADD COLUMN `qa_id` INT(11) NOT NULL AUTO_INCREMENT FIRST,
|
||||
ADD PRIMARY KEY (`qa_id`); ", true);
|
||||
|
||||
$is_check = true;
|
||||
}
|
||||
|
||||
// config 기본 테이블 auto id key 추가
|
||||
if (!isset($config['cf_id'])) {
|
||||
sql_query(" ALTER TABLE `{$g5['config_table']}`
|
||||
ADD COLUMN `cf_id` INT(11) NOT NULL AUTO_INCREMENT FIRST,
|
||||
ADD PRIMARY KEY (`cf_id`); ", true);
|
||||
|
||||
$is_check = true;
|
||||
}
|
||||
|
||||
// login 테이블 auto id key 추가
|
||||
$row = sql_fetch("select * from `{$g5['login_table']}` limit 1");
|
||||
if (!isset($row['lo_id'])) {
|
||||
sql_query(" ALTER TABLE `{$g5['login_table']}`
|
||||
ADD COLUMN `lo_id` INT(11) NOT NULL AUTO_INCREMENT FIRST,
|
||||
DROP PRIMARY KEY,
|
||||
ADD PRIMARY KEY (`lo_id`),
|
||||
ADD UNIQUE KEY `lo_ip_unique` (`lo_ip`) ", true);
|
||||
|
||||
$is_check = true;
|
||||
}
|
||||
|
||||
// visit 테이블 auto id key 로 변경
|
||||
$result = sql_query("describe `{$g5['visit_table']}`");
|
||||
while ($row = sql_fetch_array($result)){
|
||||
if (isset($row['Field']) && $row['Field'] === 'vi_id' && (isset($row['Default']) && $row['Default'] == 0)){
|
||||
sql_query("ALTER TABLE `{$g5['visit_table']}`
|
||||
CHANGE COLUMN `vi_id` `vi_id` INT(11) NOT NULL AUTO_INCREMENT;
|
||||
", false);
|
||||
|
||||
$is_check = true;
|
||||
}
|
||||
}
|
||||
|
||||
// SMS5 테이블 G5_TABLE_PREFIX 적용
|
||||
if($g5['sms5_prefix'] != 'sms5_' && sql_num_rows(sql_query("show tables like 'sms5_config'")))
|
||||
{
|
||||
$tables = array('config','write','history','book','book_group','form','form_group');
|
||||
|
||||
foreach($tables as $name){
|
||||
$old_table = 'sms5_' . $name;
|
||||
$new_table = $g5['sms5_prefix'] . $name;
|
||||
|
||||
// 기존 테이블이 있고, G5_TABLE_PREFIX 적용 테이블이 없을 경우 → 테이블명 변경
|
||||
if(sql_num_rows(sql_query("SHOW TABLES LIKE '{$old_table}' "))){
|
||||
if(!sql_num_rows(sql_query("SHOW TABLES LIKE '{$new_table}' "))){
|
||||
sql_query("RENAME TABLE {$old_table} TO {$new_table}", false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$is_check = true;
|
||||
}
|
||||
|
||||
// 광고성 정보 수신 동의 사용 필드 추가
|
||||
if (!isset($config['cf_use_promotion'])) {
|
||||
sql_query(
|
||||
" ALTER TABLE `{$g5['config_table']}`
|
||||
ADD `cf_use_promotion` tinyint(1) NOT NULL DEFAULT '0' AFTER `cf_privacy` ",
|
||||
true
|
||||
);
|
||||
|
||||
$is_check = true;
|
||||
}
|
||||
|
||||
// 광고성 정보 수신 동의 여부 필드 추가 + 메일 / SMS 수신 일자 추가
|
||||
if (!isset($member['mb_marketing_agree'])) {
|
||||
sql_query(
|
||||
" ALTER TABLE `{$g5['member_table']}`
|
||||
ADD `mb_marketing_agree` tinyint(1) NOT NULL DEFAULT '0' AFTER `mb_scrap_cnt`,
|
||||
ADD `mb_marketing_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER `mb_marketing_agree`,
|
||||
ADD `mb_thirdparty_agree` tinyint(1) NOT NULL DEFAULT '0' AFTER `mb_marketing_date`,
|
||||
ADD `mb_thirdparty_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER `mb_thirdparty_agree`,
|
||||
ADD `mb_agree_log` TEXT NOT NULL AFTER `mb_thirdparty_date`,
|
||||
ADD `mb_mailling_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER `mb_mailling`,
|
||||
ADD `mb_sms_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER `mb_sms` ",
|
||||
true
|
||||
);
|
||||
|
||||
$is_check = true;
|
||||
}
|
||||
|
||||
// 쿠폰 로그 테이블에 UNIQUE 인덱스 추가 (쿠폰 이중사용 방지)
|
||||
if (defined('G5_USE_SHOP') && G5_USE_SHOP) {
|
||||
$result = sql_query("SHOW INDEX FROM `{$g5['g5_shop_coupon_log_table']}` WHERE Key_name = 'idx_coupon_use'", false);
|
||||
if (!$result || !sql_num_rows($result)) {
|
||||
// 기존에 동일 쿠폰이 중복 사용된 데이터가 있으면 UNIQUE 인덱스 생성 실패하므로 중복 데이터 정리
|
||||
$dup_sql = " SELECT cp_id, mb_id, MIN(cl_id) as keep_id
|
||||
FROM `{$g5['g5_shop_coupon_log_table']}`
|
||||
GROUP BY cp_id, mb_id
|
||||
HAVING COUNT(*) > 1 ";
|
||||
|
||||
$dup_result = sql_query($dup_sql, false);
|
||||
if ($dup_result && sql_num_rows($dup_result)) {
|
||||
while ($dup_row = sql_fetch_array($dup_result)) {
|
||||
|
||||
echo $dup_row['cp_id']." 의 동일 쿠폰이 중복 사용된 데이터가 있으므로 인덱스 생성이 불가합니다. <br>";
|
||||
|
||||
$sql = " DELETE FROM `{$g5['g5_shop_coupon_log_table']}`
|
||||
WHERE cp_id = '{$dup_row['cp_id']}'
|
||||
AND mb_id = '{$dup_row['mb_id']}'
|
||||
AND cl_id != '{$dup_row['keep_id']}' ";
|
||||
if ($is_admin === 'super') {
|
||||
echo "데이터베이스에서 검토후에 이 쿼리문을 실행해 주세요.<br>$sql<br>";
|
||||
}
|
||||
// sql_query($sql);
|
||||
}
|
||||
}
|
||||
|
||||
// MyISAM + utf8mb4 환경에서 키 길이 초과 방지: cp_id varchar(100), mb_id varchar(100)으로 조정
|
||||
sql_query("ALTER TABLE `{$g5['g5_shop_coupon_log_table']}` MODIFY `cp_id` varchar(100) NOT NULL DEFAULT '', MODIFY `mb_id` varchar(100) NOT NULL DEFAULT ''", false);
|
||||
sql_query("ALTER TABLE `{$g5['g5_shop_coupon_log_table']}` ADD UNIQUE KEY `idx_coupon_use` (`cp_id`, `mb_id`)", false);
|
||||
$is_check = true;
|
||||
}
|
||||
}
|
||||
|
||||
$is_check = run_replace('admin_dbupgrade', $is_check);
|
||||
|
||||
$db_upgrade_msg = $is_check ? 'DB 업그레이드가 완료되었습니다.' : '더 이상 업그레이드 할 내용이 없습니다.<br>현재 DB 업그레이드가 완료된 상태입니다.';
|
||||
$dbupgrade_token = get_admin_token();
|
||||
?>
|
||||
|
||||
<div class="local_desc01 local_desc">
|
||||
<p>
|
||||
<?php echo $db_upgrade_msg; ?>
|
||||
</p>
|
||||
<p><?php echo $db_upgrade_msg; ?></p>
|
||||
<?php if ($unrecorded_count) { ?>
|
||||
<p>실행 불필요 <?php echo (int) $unrecorded_count; ?>건: 현재 실행 조건상 건너뛰는 항목입니다. 과거 실행 성공을 의미하지 않으며, 선행 작업 후에는 결과가 달라질 수 있습니다. 기존 상태 등록은 처음부터 연속해서 실행 불필요한 항목만 기록합니다.</p>
|
||||
<?php } ?>
|
||||
<p>대기 항목에는 데이터 보정 등 조회만으로 완료를 판단할 수 없는 작업도 포함됩니다. 조회 시 DB 변경이나 이력 등록은 수행하지 않습니다.</p>
|
||||
</div>
|
||||
|
||||
<?php if ($shop_install_result !== null && !$shop_install_result['success']) { ?>
|
||||
<div class="local_desc01 local_desc" style="color:#d00">
|
||||
<p><?php echo htmlspecialchars($shop_install_result['error'], ENT_QUOTES, 'UTF-8'); ?></p>
|
||||
</div>
|
||||
<?php } elseif ($migration_result['errors']) { ?>
|
||||
<div class="local_desc01 local_desc" style="color:#d00">
|
||||
<?php foreach ($migration_result['errors'] as $migration_error) { ?>
|
||||
<p><?php echo htmlspecialchars($migration_error, ENT_QUOTES, 'UTF-8'); ?></p>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<div class="dbupgrade_all_actions">
|
||||
<?php if ($unrecorded_count) { ?>
|
||||
<form class="dbupgrade_existing_action" method="post" action="<?php echo G5_ADMIN_URL; ?>/dbupgrade.php">
|
||||
<input type="hidden" name="token" value="<?php echo $dbupgrade_token; ?>">
|
||||
<input type="hidden" name="action" value="record_existing">
|
||||
<button type="submit" class="btn_submit">기존 상태 확인 이력 등록</button>
|
||||
</form>
|
||||
<?php } ?>
|
||||
<?php if (!defined('G5_USE_SHOP') || !G5_USE_SHOP) { ?>
|
||||
<form method="post" action="<?php echo G5_ADMIN_URL; ?>/dbupgrade.php" onsubmit="return confirm('쇼핑몰을 설치하시겠습니까? 설치 전 데이터베이스와 data/dbconfig.php 백업을 권장합니다.');">
|
||||
<input type="hidden" name="token" value="<?php echo $dbupgrade_token; ?>">
|
||||
<input type="hidden" name="action" value="install_shop">
|
||||
<button type="submit" class="btn_submit">쇼핑몰 설치</button>
|
||||
</form>
|
||||
<?php } ?>
|
||||
<form method="post" action="<?php echo G5_ADMIN_URL; ?>/dbupgrade.php" onsubmit="return confirm('선택한 DB 마이그레이션을 실행하시겠습니까? 실행 전 데이터베이스 백업을 권장합니다.');">
|
||||
<input type="hidden" name="token" value="<?php echo $dbupgrade_token; ?>">
|
||||
<input type="hidden" name="action" value="migrate">
|
||||
<button type="submit" name="migration_id" value="" class="btn_submit">전체 마이그레이션 실행</button>
|
||||
</form>
|
||||
</div>
|
||||
<form method="post" action="<?php echo G5_ADMIN_URL; ?>/dbupgrade.php" onsubmit="return confirm('선택한 DB 마이그레이션을 실행하시겠습니까? 실행 전 데이터베이스 백업을 권장합니다.');">
|
||||
<input type="hidden" name="token" value="<?php echo $dbupgrade_token; ?>">
|
||||
<input type="hidden" name="action" value="migrate">
|
||||
<div class="tbl_head01 tbl_wrap">
|
||||
<table id="dbupgrade_migration_table">
|
||||
<caption>버전형 DB 마이그레이션 목록</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" aria-sort="none"><button type="button" class="dbupgrade_sort" data-column="0">마이그레이션 <span aria-hidden="true"></span></button></th>
|
||||
<th scope="col" class="dbupgrade_description" aria-sort="none"><button type="button" class="dbupgrade_sort" data-column="1">설명 <span aria-hidden="true"></span></button></th>
|
||||
<th scope="col" aria-sort="none"><button type="button" class="dbupgrade_sort" data-column="2">상태 <span aria-hidden="true"></span></button></th>
|
||||
<th scope="col" aria-sort="none"><button type="button" class="dbupgrade_sort" data-column="3">적용 시각 <span aria-hidden="true"></span></button></th>
|
||||
<th scope="col" aria-sort="none"><button type="button" class="dbupgrade_sort" data-column="4">실행 <span aria-hidden="true"></span></button></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php $previous_migrations_ready = true; ?>
|
||||
<?php foreach ($migration_statuses as $migration_status) { ?>
|
||||
<?php
|
||||
$current_migration_status = isset($migration_status['status']) ? $migration_status['status'] : 'error';
|
||||
$migration_succeeded = $current_migration_status === 'success' && !$migration_status['checksum_changed'];
|
||||
$migration_can_run = in_array($current_migration_status, array('pending', 'failed'), true) && $previous_migrations_ready;
|
||||
$migration_button_title = $current_migration_status === 'unrecorded' ? '기존 상태 확인 이력을 등록해 주십시오.' : ($current_migration_status === 'success' ? '이미 성공한 마이그레이션입니다.' : ($previous_migrations_ready ? '' : '선행 마이그레이션을 먼저 실행해야 합니다.'));
|
||||
?>
|
||||
<tr>
|
||||
<?php if (isset($migration_status['error'])) { ?>
|
||||
<td colspan="5"><?php echo htmlspecialchars($migration_status['error'], ENT_QUOTES, 'UTF-8'); ?></td>
|
||||
<?php } else { ?>
|
||||
<td><?php echo htmlspecialchars($migration_status['id'], ENT_QUOTES, 'UTF-8'); ?></td>
|
||||
<td class="dbupgrade_description"><?php echo htmlspecialchars($migration_status['description'], ENT_QUOTES, 'UTF-8'); ?></td>
|
||||
<td><?php echo g5_migration_status_label($migration_status['status'], $migration_status['checksum_changed']); ?></td>
|
||||
<td><?php echo htmlspecialchars($migration_status['applied_at'], ENT_QUOTES, 'UTF-8'); ?></td>
|
||||
<td>
|
||||
<button type="submit" name="migration_id" value="<?php echo htmlspecialchars($migration_status['id'], ENT_QUOTES, 'UTF-8'); ?>" class="btn_frmline"<?php echo $migration_can_run ? '' : ' disabled'; ?><?php echo $migration_button_title !== '' ? ' title="' . htmlspecialchars($migration_button_title, ENT_QUOTES, 'UTF-8') . '"' : ''; ?>>실행</button>
|
||||
</td>
|
||||
<?php } ?>
|
||||
</tr>
|
||||
<?php $previous_migrations_ready = $previous_migrations_ready && $migration_succeeded; ?>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<style>
|
||||
.dbupgrade_all_actions {display:flex;width:100%;margin:0 0 20px;justify-content:flex-end;gap:5px}
|
||||
.dbupgrade_all_actions form {margin:0}
|
||||
.dbupgrade_all_actions .dbupgrade_existing_action {margin-right:auto}
|
||||
.dbupgrade_all_actions .btn_submit {display:inline-block;float:none;position:static;width:auto;height:30px;margin:0;padding:0 15px;border:0}
|
||||
.dbupgrade_sort {width:100%; border:0; background:transparent; color:inherit; font:inherit; cursor:pointer}
|
||||
#dbupgrade_migration_table td.dbupgrade_description {text-align:left}
|
||||
#dbupgrade_migration_table th.dbupgrade_description, #dbupgrade_migration_table th.dbupgrade_description .dbupgrade_sort {text-align:center}
|
||||
.btn_frmline:disabled {background:#b7b7b7;color:#fff;cursor:not-allowed}
|
||||
</style>
|
||||
<script>
|
||||
(function () {
|
||||
var table = document.getElementById('dbupgrade_migration_table');
|
||||
if (!table || !table.tBodies.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
var buttons = table.querySelectorAll('.dbupgrade_sort');
|
||||
var tbody = table.tBodies[0];
|
||||
|
||||
function getCellText(row, column) {
|
||||
return row.cells[column] ? row.cells[column].textContent.replace(/^\s+|\s+$/g, '') : '';
|
||||
}
|
||||
|
||||
function sortRows(button, initialAscending) {
|
||||
var column = parseInt(button.getAttribute('data-column'), 10);
|
||||
var header = button.parentNode;
|
||||
var ascending = typeof initialAscending === 'boolean' ? initialAscending : header.getAttribute('aria-sort') !== 'ascending';
|
||||
var rows = Array.prototype.slice.call(tbody.rows);
|
||||
|
||||
rows.sort(function (left, right) {
|
||||
var leftText = getCellText(left, column);
|
||||
var rightText = getCellText(right, column);
|
||||
var compared = leftText.localeCompare(rightText, undefined, {numeric: true, sensitivity: 'base'});
|
||||
|
||||
return ascending ? compared : -compared;
|
||||
});
|
||||
|
||||
for (var i = 0; i < buttons.length; i++) {
|
||||
buttons[i].parentNode.setAttribute('aria-sort', 'none');
|
||||
buttons[i].getElementsByTagName('span')[0].textContent = '';
|
||||
}
|
||||
header.setAttribute('aria-sort', ascending ? 'ascending' : 'descending');
|
||||
button.getElementsByTagName('span')[0].textContent = ascending ? '▲' : '▼';
|
||||
|
||||
for (var j = 0; j < rows.length; j++) {
|
||||
tbody.appendChild(rows[j]);
|
||||
}
|
||||
}
|
||||
|
||||
for (var i = 0; i < buttons.length; i++) {
|
||||
buttons[i].onclick = function () {
|
||||
sortRows(this);
|
||||
};
|
||||
}
|
||||
|
||||
if (buttons.length) {
|
||||
sortRows(buttons[0], false);
|
||||
}
|
||||
}());
|
||||
</script>
|
||||
|
||||
<?php
|
||||
include_once ('./admin.tail.php');
|
||||
include_once('./admin.tail.php');
|
||||
|
||||
@@ -26,14 +26,6 @@ if ($w == "u") {
|
||||
$g5['title'] = $html_title . ' 관리';
|
||||
|
||||
// 모바일 상하단 내용 필드추가
|
||||
if (!sql_query(" select fm_mobile_head_html from {$g5['faq_master_table']} limit 1 ", false)) {
|
||||
sql_query(
|
||||
" ALTER TABLE `{$g5['faq_master_table']}`
|
||||
ADD `fm_mobile_head_html` text NOT NULL AFTER `fm_tail_html`,
|
||||
ADD `fm_mobile_tail_html` text NOT NULL AFTER `fm_mobile_head_html` ",
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
require_once G5_ADMIN_PATH . '/admin.head.php';
|
||||
?>
|
||||
|
||||
@@ -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'] : '';
|
||||
@@ -42,9 +42,6 @@ $sql_common = " set fm_subject = '$fm_subject',
|
||||
fm_order = '$fm_order' ";
|
||||
|
||||
if ($w == "") {
|
||||
$sql = " alter table {$g5['faq_master_table']} auto_increment=1 ";
|
||||
sql_query($sql);
|
||||
|
||||
$sql = " insert {$g5['faq_master_table']} $sql_common ";
|
||||
sql_query($sql);
|
||||
|
||||
|
||||
@@ -10,45 +10,8 @@ if (!isset($g5['faq_table']) || !isset($g5['faq_master_table'])) {
|
||||
}
|
||||
|
||||
//자주하시는 질문 마스터 테이블이 있는지 검사한다.
|
||||
if (!sql_query(" DESCRIBE {$g5['faq_master_table']} ", false)) {
|
||||
if (sql_query(" DESCRIBE {$g5['g5_shop_faq_master_table']} ", false)) {
|
||||
sql_query(" ALTER TABLE {$g5['g5_shop_faq_master_table']} RENAME TO `{$g5['faq_master_table']}` ;", false);
|
||||
} else {
|
||||
$query_cp = sql_query(
|
||||
" CREATE TABLE IF NOT EXISTS `{$g5['faq_master_table']}` (
|
||||
`fm_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`fm_subject` varchar(255) NOT NULL DEFAULT '',
|
||||
`fm_head_html` text NOT NULL,
|
||||
`fm_tail_html` text NOT NULL,
|
||||
`fm_order` int(11) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`fm_id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ",
|
||||
true
|
||||
);
|
||||
}
|
||||
// FAQ Master
|
||||
sql_query(" insert into `{$g5['faq_master_table']}` set fm_id = '1', fm_subject = '자주하시는 질문' ", false);
|
||||
}
|
||||
|
||||
//자주하시는 질문 테이블이 있는지 검사한다.
|
||||
if (!sql_query(" DESCRIBE {$g5['faq_table']} ", false)) {
|
||||
if (sql_query(" DESCRIBE {$g5['g5_shop_faq_table']} ", false)) {
|
||||
sql_query(" ALTER TABLE {$g5['g5_shop_faq_table']} RENAME TO `{$g5['faq_table']}` ;", false);
|
||||
} else {
|
||||
$query_cp = sql_query(
|
||||
" CREATE TABLE IF NOT EXISTS `{$g5['faq_table']}` (
|
||||
`fa_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`fm_id` int(11) NOT NULL DEFAULT '0',
|
||||
`fa_subject` text NOT NULL,
|
||||
`fa_content` text NOT NULL,
|
||||
`fa_order` int(11) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`fa_id`),
|
||||
KEY `fm_id` (`fm_id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ",
|
||||
true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$g5['title'] = 'FAQ관리';
|
||||
require_once G5_ADMIN_PATH . '/admin.head.php';
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 4.7 KiB |
@@ -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} ";
|
||||
|
||||
@@ -80,7 +80,7 @@ require_once './admin.head.php';
|
||||
<tr>
|
||||
<th scope="row"><label for="mb_email">E-mail</label></th>
|
||||
<td>
|
||||
<?php echo help("메일 주소에 단어 포함 (예 : @" . preg_replace('#^(www[^\.]*\.){1}#', '', $_SERVER['HTTP_HOST']) . ")") ?>
|
||||
<?php echo help("메일 주소에 단어 포함 (예 : @" . htmlspecialchars(preg_replace('#^(www[^\.]*\.){1}#', '', $_SERVER['HTTP_HOST'])) . ")") ?>
|
||||
<input type="text" name="mb_email" value="<?php echo get_sanitize_input($mb_email); ?>" id="mb_email" class="frm_input" size="50">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -12,10 +12,10 @@ $sql_common = " from {$g5['member_table']} ";
|
||||
$sql_where = " where (1) ";
|
||||
|
||||
$mb_id1 = isset($_POST['mb_id1']) ? (int) $_POST['mb_id1'] : 1;
|
||||
$mb_id1_from = isset($_POST['mb_id1_from']) ? clean_xss_tags($_POST['mb_id1_from'], 1, 1, 30) : '';
|
||||
$mb_id1_to = isset($_POST['mb_id1_to']) ? clean_xss_tags($_POST['mb_id1_to'], 1, 1, 30) : '';
|
||||
$mb_email = isset($_POST['mb_email']) ? clean_xss_tags($_POST['mb_email'], 1, 1, 100) : '';
|
||||
$mb_mailling = isset($_POST['mb_mailling']) ? clean_xss_tags($_POST['mb_mailling'], 1, 1, 100) : '';
|
||||
$mb_id1_from = isset($_POST['mb_id1_from']) ? addslashes(clean_xss_tags(stripslashes($_POST['mb_id1_from']), 1, 1, 30)) : '';
|
||||
$mb_id1_to = isset($_POST['mb_id1_to']) ? addslashes(clean_xss_tags(stripslashes($_POST['mb_id1_to']), 1, 1, 30)) : '';
|
||||
$mb_email = isset($_POST['mb_email']) ? addslashes(clean_xss_tags(stripslashes($_POST['mb_email']), 1, 1, 100)) : '';
|
||||
$mb_mailling = isset($_POST['mb_mailling']) ? addslashes(clean_xss_tags(stripslashes($_POST['mb_mailling']), 1, 1, 100)) : '';
|
||||
$mb_level_from = isset($_POST['mb_level_from'])? (int) $_POST['mb_level_from'] : 1;
|
||||
$mb_level_to = isset($_POST['mb_level_to']) ? (int) $_POST['mb_level_to'] : 10;
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@ $html_title = '회원메일 발송';
|
||||
|
||||
check_demo();
|
||||
|
||||
$security_mail_url = g5_require_security_mail_url();
|
||||
|
||||
check_admin_token();
|
||||
|
||||
require_once './admin.head.php';
|
||||
@@ -59,7 +61,7 @@ for ($i = 0; $i < count($member_list); $i++) {
|
||||
$content = preg_replace("/{회원아이디}/", $mb_id, (string)$content);
|
||||
$content = preg_replace("/{이메일}/", $to_email, (string)$content);
|
||||
|
||||
$content = $content . "<hr size=0><p><span style='font-size:9pt; font-family:굴림'>▶ 더 이상 정보 수신을 원치 않으시면 [<a href='" . G5_BBS_URL . "/email_stop.php?mb_id={$mb_id}&mb_md5={$mb_md5}' target='_blank'>수신거부</a>] 해 주십시오.</span></p>";
|
||||
$content = $content . "<hr size=0><p><span style='font-size:9pt; font-family:굴림'>▶ 더 이상 정보 수신을 원치 않으시면 [<a href='" . ($security_mail_url . '/' . G5_BBS_DIR) . "/email_stop.php?mb_id={$mb_id}&mb_md5={$mb_md5}' target='_blank'>수신거부</a>] 해 주십시오.</span></p>";
|
||||
|
||||
mailer($config['cf_admin_email_name'], $config['cf_admin_email'], $to_email, $subject, $content, 1);
|
||||
|
||||
|
||||
+3
-1
@@ -12,6 +12,8 @@ auth_check_menu($auth, $sub_menu, 'w');
|
||||
|
||||
check_demo();
|
||||
|
||||
$security_mail_url = g5_require_security_mail_url();
|
||||
|
||||
$g5['title'] = '회원메일 테스트';
|
||||
|
||||
$name = get_text($member['mb_name']);
|
||||
@@ -33,7 +35,7 @@ $content = preg_replace("/{이메일}/", $email, (string)$content);
|
||||
|
||||
$mb_md5 = md5($member['mb_id'] . $member['mb_email'] . $member['mb_datetime']);
|
||||
|
||||
$content = $content . '<p>더 이상 정보 수신을 원치 않으시면 [<a href="' . G5_BBS_URL . '/email_stop.php?mb_id=' . $mb_id . '&mb_md5=' . $mb_md5 . '" target="_blank">수신거부</a>] 해 주십시오.</p>';
|
||||
$content = $content . '<p>더 이상 정보 수신을 원치 않으시면 [<a href="' . ($security_mail_url . '/' . G5_BBS_DIR) . '/email_stop.php?mb_id=' . $mb_id . '&mb_md5=' . $mb_md5 . '" target="_blank">수신거부</a>] 해 주십시오.</p>';
|
||||
|
||||
mailer($config['cf_title'], $member['mb_email'], $member['mb_email'], $subject, $content, 1);
|
||||
|
||||
|
||||
+1
-1
@@ -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 == '') {
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
$sub_menu = '200100';
|
||||
require_once './_common.php';
|
||||
|
||||
check_demo();
|
||||
auth_check_menu($auth, $sub_menu, 'w');
|
||||
auth_check_menu($auth, $sub_menu, 'd');
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
|
||||
alert('올바른 방법으로 이용해 주십시오.');
|
||||
}
|
||||
|
||||
check_admin_token();
|
||||
admin_referer_check();
|
||||
|
||||
$mb_id = isset($_POST['mb_id']) && is_string($_POST['mb_id']) ? trim($_POST['mb_id']) : '';
|
||||
$mb = get_member($mb_id);
|
||||
if (empty($mb['mb_id'])) {
|
||||
alert('존재하지 않는 회원자료입니다.');
|
||||
}
|
||||
|
||||
if ($is_admin !== 'super' && ($mb['mb_level'] >= $member['mb_level'] || is_admin($mb['mb_id']) === 'super')) {
|
||||
alert('자신보다 권한이 높거나 같은 회원의 본인확인 정보는 삭제할 수 없습니다.');
|
||||
}
|
||||
|
||||
if (!admin_clear_member_certification($mb['mb_id'])) {
|
||||
alert('본인확인 정보를 모두 삭제하지 못했습니다. DB 상태를 확인한 뒤 다시 시도해 주십시오.');
|
||||
}
|
||||
|
||||
alert('본인확인 정보와 인증 내역을 삭제했습니다.', './member_form.php?w=u&mb_id='.urlencode($mb['mb_id']));
|
||||
+26
-46
@@ -150,62 +150,21 @@ $mb_marketing_agree_no = !$mb['mb_marketing_agree'] ? 'checked="checked"' :
|
||||
$mb_thirdparty_agree_yes = $mb['mb_thirdparty_agree'] ? 'checked="checked"' : '';
|
||||
$mb_thirdparty_agree_no = !$mb['mb_thirdparty_agree'] ? 'checked="checked"' : '';
|
||||
|
||||
if (isset($mb['mb_certify'])) {
|
||||
// 날짜시간형이라면 drop 시킴
|
||||
if (preg_match("/-/", $mb['mb_certify'])) {
|
||||
sql_query(" ALTER TABLE `{$g5['member_table']}` DROP `mb_certify` ", false);
|
||||
}
|
||||
} else {
|
||||
sql_query(" ALTER TABLE `{$g5['member_table']}` ADD `mb_certify` TINYINT(4) NOT NULL DEFAULT '0' AFTER `mb_hp` ", false);
|
||||
}
|
||||
|
||||
if (isset($mb['mb_adult'])) {
|
||||
sql_query(" ALTER TABLE `{$g5['member_table']}` CHANGE `mb_adult` `mb_adult` TINYINT(4) NOT NULL DEFAULT '0' ", false);
|
||||
} else {
|
||||
sql_query(" ALTER TABLE `{$g5['member_table']}` ADD `mb_adult` TINYINT NOT NULL DEFAULT '0' AFTER `mb_certify` ", false);
|
||||
}
|
||||
|
||||
// 지번주소 필드추가
|
||||
if (!isset($mb['mb_addr_jibeon'])) {
|
||||
sql_query(" ALTER TABLE {$g5['member_table']} ADD `mb_addr_jibeon` varchar(255) NOT NULL DEFAULT '' AFTER `mb_addr2` ", false);
|
||||
}
|
||||
|
||||
// 건물명필드추가
|
||||
if (!isset($mb['mb_addr3'])) {
|
||||
sql_query(" ALTER TABLE {$g5['member_table']} ADD `mb_addr3` varchar(255) NOT NULL DEFAULT '' AFTER `mb_addr2` ", false);
|
||||
}
|
||||
|
||||
// 중복가입 확인필드 추가
|
||||
if (!isset($mb['mb_dupinfo'])) {
|
||||
sql_query(" ALTER TABLE {$g5['member_table']} ADD `mb_dupinfo` varchar(255) NOT NULL DEFAULT '' AFTER `mb_adult` ", false);
|
||||
}
|
||||
|
||||
// 이메일인증 체크 필드추가
|
||||
if (!isset($mb['mb_email_certify2'])) {
|
||||
sql_query(" ALTER TABLE {$g5['member_table']} ADD `mb_email_certify2` varchar(255) NOT NULL DEFAULT '' AFTER `mb_email_certify` ", false);
|
||||
}
|
||||
|
||||
// 본인인증 내역 테이블 정보가 dbconfig에 없으면 소셜 테이블 정의
|
||||
if (!isset($g5['member_cert_history'])) {
|
||||
$g5['member_cert_history_table'] = G5_TABLE_PREFIX . 'member_cert_history';
|
||||
}
|
||||
// 멤버 본인인증 정보 변경 내역 테이블 없을 경우 생성
|
||||
if (isset($g5['member_cert_history_table']) && !sql_query(" DESC {$g5['member_cert_history_table']} ", false)) {
|
||||
sql_query(
|
||||
" CREATE TABLE IF NOT EXISTS `{$g5['member_cert_history_table']}` (
|
||||
`ch_id` int(11) NOT NULL auto_increment,
|
||||
`mb_id` varchar(20) NOT NULL DEFAULT '',
|
||||
`ch_name` varchar(255) NOT NULL DEFAULT '',
|
||||
`ch_hp` varchar(255) NOT NULL DEFAULT '',
|
||||
`ch_birth` varchar(255) NOT NULL DEFAULT '',
|
||||
`ch_type` varchar(20) NOT NULL DEFAULT '',
|
||||
`ch_datetime` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
PRIMARY KEY (`ch_id`),
|
||||
KEY `mb_id` (`mb_id`)
|
||||
) ",
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
$mb_cert_history = '';
|
||||
if (isset($mb_id) && $mb_id) {
|
||||
@@ -275,7 +234,7 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
|
||||
<th scope="row"><label for="mb_level">회원 권한</label></th>
|
||||
<td><?php echo get_member_level_select('mb_level', 1, $member['mb_level'], $mb['mb_level']) ?></td>
|
||||
<th scope="row">포인트</th>
|
||||
<td><a href="./point_list.php?sfl=mb_id&stx=<?php echo $mb['mb_id'] ?>" target="_blank"><?php echo number_format($mb['mb_point']) ?></a> 점</td>
|
||||
<td><a href="./point_list.php?sfl=mb_id&stx=<?php echo $mb['mb_id'] ?>" target="_blank"><?php echo number_format(isset($mb['mb_point']) ? $mb['mb_point'] : 0) ?></a> 점</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="mb_email">E-mail<strong class="sound_only">필수</strong></label></th>
|
||||
@@ -338,7 +297,7 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
|
||||
<?php echo help('이미지 크기는 <strong>넓이 ' . $config['cf_member_icon_width'] . '픽셀 높이 ' . $config['cf_member_icon_height'] . '픽셀</strong>로 해주세요.') ?>
|
||||
<input type="file" name="mb_icon" id="mb_icon">
|
||||
<?php
|
||||
$mb_dir = substr($mb['mb_id'], 0, 2);
|
||||
$mb_dir = substr(isset($mb['mb_id']) ? $mb['mb_id'] : '', 0, 2);
|
||||
$icon_file = G5_DATA_PATH . '/member/' . $mb_dir . '/' . get_mb_icon_name($mb['mb_id']) . '.gif';
|
||||
if (file_exists($icon_file)) {
|
||||
$icon_url = str_replace(G5_DATA_PATH, G5_DATA_URL, $icon_file);
|
||||
@@ -355,7 +314,7 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
|
||||
<?php echo help('이미지 크기는 <strong>넓이 ' . $config['cf_member_img_width'] . '픽셀 높이 ' . $config['cf_member_img_height'] . '픽셀</strong>로 해주세요.') ?>
|
||||
<input type="file" name="mb_img" id="mb_img">
|
||||
<?php
|
||||
$mb_dir = substr($mb['mb_id'], 0, 2);
|
||||
$mb_dir = substr(isset($mb['mb_id']) ? $mb['mb_id'] : '', 0, 2);
|
||||
$icon_file = G5_DATA_PATH . '/member_image/' . $mb_dir . '/' . get_mb_icon_name($mb['mb_id']) . '.gif';
|
||||
if (file_exists($icon_file)) {
|
||||
echo get_member_profile_img($mb['mb_id']);
|
||||
@@ -479,6 +438,20 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
|
||||
<?php if ($cnt == 0) { ?>
|
||||
본인인증 내역이 없습니다.
|
||||
<?php } ?>
|
||||
<?php
|
||||
$has_certification_data = $cnt > 0 || !empty($mb['mb_dupinfo']) || !empty($mb['mb_certify'])
|
||||
|| !empty($mb['mb_adult']) || !empty($mb['mb_birth']) || !empty($mb['mb_sex']);
|
||||
if ($w === 'u' && !$has_certification_data) {
|
||||
$cert_request = sql_fetch("select count(*) as cnt from {$g5['cert_history_table']} where mb_id = '".sql_real_escape_string($mb['mb_id'])."'");
|
||||
$has_certification_data = !empty($cert_request['cnt']);
|
||||
}
|
||||
$can_cleanup_certification = $w === 'u' && $has_certification_data
|
||||
&& ($is_admin === 'super' || (isset($auth[$sub_menu]) && strpos($auth[$sub_menu], 'd') !== false));
|
||||
?>
|
||||
<?php if ($can_cleanup_certification) { ?>
|
||||
<p>본인확인 ‘아니오’는 인증 상태만 변경합니다. 정보 삭제는 CI/DI 관련 식별값, 본인확인·성인인증 상태, 생년월일·성별 및 본인인증 내역을 삭제합니다. 회원 이름과 연락처는 유지합니다.</p>
|
||||
<button type="submit" form="fmembercertcleanup" class="btn btn_02">본인확인 정보 삭제</button>
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -559,7 +532,7 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
|
||||
<span class="provider_name"><?php echo $provider_name; //서비스이름 ?> ( <?php echo $account['displayname']; ?> )</span>
|
||||
<span class="account_hidden" style="display:none"><?php echo $account['mb_id']; ?></span>
|
||||
</div>
|
||||
<div class="btn_info"><a href="<?php echo G5_SOCIAL_LOGIN_URL . '/unlink.php?mp_no=' . $account['mp_no'] ?>" class="social_unlink" data-provider="<?php echo $account['mp_no']; ?>">연동해제</a> <span class="sound_only"><?php echo substr($account['mp_register_day'], 2, 14); ?></span></div>
|
||||
<div class="btn_info"><a href="<?php echo G5_SOCIAL_LOGIN_URL . '/unlink.php?mp_no=' . $account['mp_no'] ?>" class="social_unlink" data-provider="<?php echo $account['mp_no']; ?>">연동해제</a> <span class="sound_only"><?php echo substr(isset($account['mp_register_day']) ? $account['mp_register_day'] : '', 2, 14); ?></span></div>
|
||||
</div>
|
||||
<?php } //end foreach ?>
|
||||
</li>
|
||||
@@ -625,7 +598,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 } ?>
|
||||
|
||||
@@ -639,6 +612,13 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<?php if ($can_cleanup_certification) { ?>
|
||||
<form id="fmembercertcleanup" method="post" action="./member_cert_cleanup.php" onsubmit="return confirm('본인확인 정보와 인증 내역을 삭제하시겠습니까? 삭제 후 복구할 수 없으며, 회원정보의 다른 수정사항은 저장하지 않습니다.');">
|
||||
<input type="hidden" name="mb_id" value="<?php echo get_text($mb['mb_id']); ?>">
|
||||
<input type="hidden" name="token" value="">
|
||||
</form>
|
||||
<?php } ?>
|
||||
|
||||
<script>
|
||||
function fmember_submit(f) {
|
||||
if (!f.mb_icon.value.match(/\.(gif|jpe?g|png)$/i) && f.mb_icon.value) {
|
||||
|
||||
@@ -19,8 +19,8 @@ $mb_certify = isset($_POST['mb_certify']) ? preg_replace('/[^0-9a-z_]/i', ''
|
||||
$mb_zip = isset($_POST['mb_zip']) ? preg_replace('/[^0-9a-z_]/i', '', $_POST['mb_zip']) : '';
|
||||
|
||||
// 광고성 정보 수신
|
||||
$mb_marketing_agree = isset($_POST['mb_marketing_agree']) ? clean_xss_tags($_POST['mb_marketing_agree'], 1, 1) : '0';
|
||||
$mb_thirdparty_agree = isset($_POST['mb_thirdparty_agree']) ? clean_xss_tags($_POST['mb_thirdparty_agree'], 1, 1) : '0';
|
||||
$mb_marketing_agree = isset($_POST['mb_marketing_agree']) ? addslashes(clean_xss_tags(stripslashes($_POST['mb_marketing_agree']), 1, 1)) : '0';
|
||||
$mb_thirdparty_agree = isset($_POST['mb_thirdparty_agree']) ? addslashes(clean_xss_tags(stripslashes($_POST['mb_thirdparty_agree']), 1, 1)) : '0';
|
||||
|
||||
// 관리자가 자동등록방지를 사용해야 할 경우 ( 회원의 비밀번호 변경시 캡챠를 체크한다 )
|
||||
if ($mb_password) {
|
||||
@@ -84,9 +84,9 @@ for ($i = 1; $i <= 10; $i++) {
|
||||
|
||||
foreach ($check_keys as $key) {
|
||||
if( in_array($key, array('mb_signature', 'mb_profile')) ){
|
||||
$posts[$key] = isset($_POST[$key]) ? clean_xss_tags($_POST[$key], 1, 1, 0, 0) : '';
|
||||
$posts[$key] = isset($_POST[$key]) ? addslashes(clean_xss_tags(stripslashes($_POST[$key]), 1, 1, 0, 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)) : '';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -127,6 +127,11 @@ $sql_common = " mb_name = '{$posts['mb_name']}',
|
||||
mb_9 = '{$posts['mb_9']}',
|
||||
mb_10 = '{$posts['mb_10']}' ";
|
||||
|
||||
// 부여하려는 mb_level 상한 검증 (자기보다 높은 권한 부여 차단)
|
||||
if ($is_admin !== 'super' && (int) $posts['mb_level'] >= (int) $member['mb_level']) {
|
||||
alert('자신보다 권한이 높거나 같은 등급은 부여할 수 없습니다.');
|
||||
}
|
||||
|
||||
if ($w == '') {
|
||||
$mb = get_member($mb_id);
|
||||
if (isset($mb['mb_id']) && $mb['mb_id']) {
|
||||
@@ -147,7 +152,7 @@ if ($w == '') {
|
||||
alert('이미 존재하는 이메일입니다.\\nID : ' . $row['mb_id'] . '\\n이름 : ' . $row['mb_name'] . '\\n닉네임 : ' . $row['mb_nick'] . '\\n메일 : ' . $row['mb_email']);
|
||||
}
|
||||
|
||||
$agree_items = [];
|
||||
$agree_items = array();
|
||||
// 마케팅 목적의 개인정보 수집 및 이용
|
||||
if ($mb_marketing_agree == 1) {
|
||||
$sql_common .= " , mb_marketing_date = '".G5_TIME_YMDHIS."' ";
|
||||
@@ -230,7 +235,7 @@ if ($w == '') {
|
||||
|
||||
// 현재 데이터 조회
|
||||
$row = sql_fetch("select * from {$g5['member_table']} where mb_id = '{$mb_id}' ");
|
||||
$agree_items = [];
|
||||
$agree_items = array();
|
||||
|
||||
// 마케팅 목적의 개인정보 수집 및 이용
|
||||
$sql_marketing_date = "";
|
||||
|
||||
+6
-1
@@ -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} ";
|
||||
@@ -272,6 +275,8 @@ $colspan = 16;
|
||||
<?php
|
||||
if ($leave_msg || $intercept_msg) {
|
||||
echo $leave_msg . ' ' . $intercept_msg;
|
||||
} else if ($config['cf_use_email_certify'] && !preg_match('/[1-9]/', $row['mb_email_certify'])) {
|
||||
echo '<span class="txt_false">메일 미인증</span>';
|
||||
} else {
|
||||
echo "정상";
|
||||
}
|
||||
|
||||
@@ -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"); // 로그 파일 저장 경로
|
||||
|
||||
@@ -21,8 +23,8 @@ define('MEMBER_LOG_DIR', G5_DATA_PATH . "/" . MEMBER_BASE_DIR . "/" . "log");
|
||||
*/
|
||||
function get_export_config($type = null)
|
||||
{
|
||||
$config = [
|
||||
'sfl_list' => [
|
||||
$config = array(
|
||||
'sfl_list' => array(
|
||||
'mb_id'=>'아이디',
|
||||
'mb_name'=>'이름',
|
||||
'mb_nick'=>'닉네임',
|
||||
@@ -30,26 +32,26 @@ function get_export_config($type = null)
|
||||
'mb_tel'=>'전화번호',
|
||||
'mb_hp'=>'휴대폰번호',
|
||||
'mb_addr1'=>'주소'
|
||||
],
|
||||
'point_cond_map' => [
|
||||
),
|
||||
'point_cond_map' => array(
|
||||
'gte'=>'≥',
|
||||
'lte'=>'≤',
|
||||
'eq'=>'='
|
||||
],
|
||||
'intercept_list' => [
|
||||
),
|
||||
'intercept_list' => array(
|
||||
'exclude'=>'차단회원 제외',
|
||||
'only'=>'차단회원만'
|
||||
],
|
||||
'ad_range_list' => [
|
||||
),
|
||||
'ad_range_list' => array(
|
||||
'all' => '수신동의 회원 전체',
|
||||
'mailling_only' => '이메일 수신동의 회원만',
|
||||
'sms_only' => 'SMS/카카오톡 수신동의 회원만',
|
||||
'month_confirm' => date('m월').' 수신동의 확인 대상만',
|
||||
'custom_period' => '수신동의 기간 직접 입력'
|
||||
],
|
||||
];
|
||||
),
|
||||
);
|
||||
|
||||
return $type ? (isset($config[$type]) ? $config[$type] : []) : $config;
|
||||
return $type ? (isset($config[$type]) ? $config[$type] : array()) : $config;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -57,18 +59,8 @@ function get_export_config($type = null)
|
||||
*/
|
||||
function get_member_export_params()
|
||||
{
|
||||
// 친구톡 양식 - 엑셀 양식에 포함할 항목
|
||||
$fieldArray = array_map('trim', explode(',', isset($_GET['fields']) ? $_GET['fields'] : ''));
|
||||
$vars = [];
|
||||
foreach ($fieldArray as $index => $field) {
|
||||
if(!empty($field)){
|
||||
$vars['var' . ($index + 1)] = $field;
|
||||
}
|
||||
}
|
||||
|
||||
$params = [
|
||||
$params = array(
|
||||
'page' => 1,
|
||||
'formatType' => (int)(isset($_GET['formatType']) ? $_GET['formatType'] : 1),
|
||||
'use_stx' => isset($_GET['use_stx']) ? $_GET['use_stx'] : 0,
|
||||
'stx_cond' => clean_xss_tags(isset($_GET['stx_cond']) ? $_GET['stx_cond'] : 'like'),
|
||||
'sfl' => clean_xss_tags(isset($_GET['sfl']) ? $_GET['sfl'] : ''),
|
||||
@@ -91,25 +83,30 @@ function get_member_export_params()
|
||||
'agree_date_end' => clean_xss_tags(isset($_GET['agree_date_end']) ? $_GET['agree_date_end'] : ''),
|
||||
'use_intercept' => isset($_GET['use_intercept']) ? $_GET['use_intercept'] : 0,
|
||||
'intercept' => clean_xss_tags(isset($_GET['intercept']) ? $_GET['intercept'] : 'exclude'),
|
||||
'vars' => $vars,
|
||||
];
|
||||
);
|
||||
|
||||
// 레벨 범위 검증
|
||||
if ($params['level_start'] > $params['level_end']) {
|
||||
[$params['level_start'] , $params['level_end']] = [$params['level_end'], $params['level_start']];
|
||||
$tmp_level = $params['level_start'];
|
||||
$params['level_start'] = $params['level_end'];
|
||||
$params['level_end'] = $tmp_level;
|
||||
}
|
||||
|
||||
// 가입기간 - 날짜 범위 검증
|
||||
if ($params['use_date'] && $params['date_start'] && $params['date_end']) {
|
||||
if ($params['date_start'] > $params['date_end']) {
|
||||
[$params['date_start'] , $params['date_end']] = [$params['date_end'], $params['date_start']];
|
||||
$tmp_date = $params['date_start'];
|
||||
$params['date_start'] = $params['date_end'];
|
||||
$params['date_end'] = $tmp_date;
|
||||
}
|
||||
}
|
||||
|
||||
// 수신동의기간 - 날짜 범위 검증
|
||||
if ($params['ad_range_type'] == 'custom_period' && $params['agree_date_start'] && $params['agree_date_end']) {
|
||||
if ($params['agree_date_start'] > $params['agree_date_end']) {
|
||||
[$params['agree_date_start'] , $params['agree_date_end']] = [$params['agree_date_end'], $params['agree_date_start']];
|
||||
$tmp_agree_date = $params['agree_date_start'];
|
||||
$params['agree_date_start'] = $params['agree_date_end'];
|
||||
$params['agree_date_end'] = $tmp_agree_date;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,7 +138,7 @@ function member_export_get_total_count($params)
|
||||
function member_export_build_where($params)
|
||||
{
|
||||
global $config;
|
||||
$conditions = [];
|
||||
$conditions = array();
|
||||
|
||||
// 기본 조건 - 탈퇴하지 않은 사용자
|
||||
$conditions[] = "mb_leave_date = ''";
|
||||
@@ -241,8 +238,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'";
|
||||
@@ -263,7 +260,7 @@ function member_export_build_where($params)
|
||||
$conditions[] = "0=1"; // 둘 다 해제 ⇒ 결과 0건
|
||||
} else {
|
||||
// 조건 조립
|
||||
$parts = [];
|
||||
$parts = array();
|
||||
if ($useEmail) $parts[] = "(mb_mailling = 1 AND {$emailDateCond})";
|
||||
if ($useSms) $parts[] = "(mb_sms = 1 AND {$smsDateCond})";
|
||||
|
||||
|
||||
@@ -191,12 +191,12 @@ $colspan = 14;
|
||||
<?php
|
||||
$thirdpartyLbl = (!empty($config['cf_sms_use'])) ? ' / <b>개인정보 제3자 제공</b>' : '';
|
||||
|
||||
$ad_range_text = [
|
||||
$ad_range_text = array(
|
||||
'all' => "* <b>광고성 정보 수신(이메일 또는 SMS/카카오톡)</b> / <b>마케팅 목적의 개인정보 수집 및 이용</b>{$thirdpartyLbl}에 모두 동의한 회원을 선택합니다.",
|
||||
'mailling_only' => "* <b>광고성 이메일 수신</b> / <b>마케팅 목적의 개인정보 수집 및 이용</b>{$thirdpartyLbl}에 모두 동의한 회원을 선택합니다.",
|
||||
'sms_only' => "* <b>광고성 SMS/카카오톡 수신</b> / <b>마케팅 목적의 개인정보 수집 및 이용</b>{$thirdpartyLbl}에 모두 동의한 회원을 선택합니다.",
|
||||
'month_confirm' => "* 23개월 전(" . date('Y년 m월', strtotime('-23 month')) . ") <b>광고성 정보 수신 동의(이메일 또는 SMS/카카오톡)</b>한 회원을 선택합니다."
|
||||
];
|
||||
);
|
||||
|
||||
if (isset($_GET['ad_range_only'], $_GET['ad_range_type']) && isset($ad_range_text[$_GET['ad_range_type']])) {
|
||||
echo '<div class="ad_range_box"><p>' . $ad_range_text[$_GET['ad_range_type']] . '</p></div>';
|
||||
@@ -210,7 +210,7 @@ $colspan = 14;
|
||||
</div>
|
||||
|
||||
<!-- 채널 체크박스 -->
|
||||
<div class="sch_row <?php echo isset($_GET['ad_range_only']) && in_array($_GET['ad_range_type'], ['month_confirm', 'custom_period']) ? '' : 'is-hidden'; ?>">
|
||||
<div class="sch_row <?php echo isset($_GET['ad_range_only']) && in_array($_GET['ad_range_type'], array('month_confirm', 'custom_period')) ? '' : 'is-hidden'; ?>">
|
||||
<div class="ad_range_wrap">
|
||||
<div class="ad_range_box">
|
||||
<div class="label">
|
||||
@@ -271,7 +271,7 @@ function closePreviousEventSource() {
|
||||
}
|
||||
|
||||
// 2. FormData QueryString 변환
|
||||
function buildDownloadParams(selectedFields = []) {
|
||||
function buildDownloadParams() {
|
||||
const formData = new FormData(document.getElementById('fsearch'));
|
||||
const params = new URLSearchParams(formData);
|
||||
|
||||
@@ -281,10 +281,10 @@ function buildDownloadParams(selectedFields = []) {
|
||||
}
|
||||
|
||||
// 3. 메인 함수
|
||||
function startExcelDownload(selectedFields = []) {
|
||||
function startExcelDownload() {
|
||||
closePreviousEventSource();
|
||||
|
||||
const query = buildDownloadParams(selectedFields);
|
||||
const query = buildDownloadParams();
|
||||
showDownloadPopup();
|
||||
|
||||
eventSource = new EventSource(`member_list_exel_export.php?${query}`);
|
||||
@@ -340,32 +340,6 @@ function handlePopupCloseWithConfirm(e) {
|
||||
PopupManager.close('popupOverlay');
|
||||
}
|
||||
|
||||
// 체크박스 선택 시 최대 3개 제한 및 선택된 항목 미리보기 표시
|
||||
function bindFieldSelectEvents() {
|
||||
const fieldSelectForm = document.getElementById('fieldSelectForm');
|
||||
if (!fieldSelectForm) return;
|
||||
|
||||
fieldSelectForm.addEventListener('change', function (e) {
|
||||
if (e.target.name === 'fields') {
|
||||
const selected = fieldSelectForm.querySelectorAll('input[name="fields"]:checked');
|
||||
if (selected.length > 3) {
|
||||
alert("최대 3개까지 선택 가능합니다.");
|
||||
e.target.checked = false;
|
||||
return;
|
||||
}
|
||||
|
||||
// 선택된 항목 표시
|
||||
const previewContainer = document.getElementById('selectedFieldsPreview');
|
||||
let spans = '<strong>선택된 항목:</strong>';
|
||||
selected.forEach(field => {
|
||||
const label = field.parentElement.textContent.trim();
|
||||
spans += `<span class="field-tag">${label}</span>`;
|
||||
});
|
||||
previewContainer.innerHTML = spans;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 엑셀 생성 및 다운로드 실행
|
||||
function handleProgressUpdate() {
|
||||
return function(e) {
|
||||
@@ -480,4 +454,4 @@ function triggerAutoDownload(url, filename) {
|
||||
</script>
|
||||
|
||||
<?php
|
||||
require_once './admin.tail.php';
|
||||
require_once './admin.tail.php';
|
||||
|
||||
@@ -14,7 +14,7 @@ session_write_close(); // 세션 종료 및 잠금 해제 (백그라운드 작
|
||||
$params = get_member_export_params();
|
||||
if (!$params || !is_array($params)) {
|
||||
member_export_send_progress("error", "데이터가 올바르게 전달되지 않아 작업에 실패하였습니다.");
|
||||
member_export_write_log([], ['success' => false, 'error' => '데이터가 올바르게 전달되지 않아 작업에 실패하였습니다.']);
|
||||
member_export_write_log(array(), array('success' => false, 'error' => '데이터가 올바르게 전달되지 않아 작업에 실패하였습니다.'));
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ member_export_set_sse_headers();
|
||||
$mode = isset($_GET['mode']) ? $_GET['mode'] : '';
|
||||
if ($mode !== 'start') {
|
||||
member_export_send_progress("error", "잘못된 요청 입니다.");
|
||||
member_export_write_log($params, ['success' => false, 'error' => '잘못된 요청 입니다.']);
|
||||
member_export_write_log($params, array('success' => false, 'error' => '잘못된 요청 입니다.'));
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ catch (Exception $e)
|
||||
// 에러 로그 저장 및 SSE 에러 전송
|
||||
error_log("[Member Export Error] " . $e->getMessage());
|
||||
member_export_send_progress("error", $e->getMessage());
|
||||
member_export_write_log($params, ['success' => false, 'error' => $e->getMessage()]);
|
||||
member_export_write_log($params, array('success' => false, 'error' => $e->getMessage()));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -62,7 +62,7 @@ function main_member_export($params)
|
||||
}
|
||||
|
||||
$fileName = 'member_'.MEMBER_BASE_DATE;
|
||||
$fileList = [];
|
||||
$fileList = array();
|
||||
$zipFileName = '';
|
||||
|
||||
if ($total > MEMBER_EXPORT_PAGE_SIZE) {
|
||||
@@ -88,7 +88,7 @@ function main_member_export($params)
|
||||
$zipResult = member_export_create_zip($fileList, $fileName); // 압축 파일 생성
|
||||
|
||||
if($zipResult['error']){
|
||||
member_export_write_log($params, ['success' => false, 'error' => $zipResult['error']]);
|
||||
member_export_write_log($params, array('success' => false, 'error' => $zipResult['error']));
|
||||
member_export_send_progress("zippingError", $zipResult['error']);
|
||||
}
|
||||
|
||||
@@ -107,19 +107,19 @@ function main_member_export($params)
|
||||
member_export_send_progress("progress", "", 1, $total, $total);
|
||||
}
|
||||
|
||||
member_export_write_log($params, ['success' => true, 'total' => $total, 'files' => $fileList, 'zip' => isset($zipFileName) ? $zipFileName : null]);
|
||||
member_export_write_log($params, array('success' => true, 'total' => $total, 'files' => $fileList, 'zip' => isset($zipFileName) ? $zipFileName : null));
|
||||
member_export_send_progress("done", "", 2, $total, $total, $pages, $pages, $fileList, $zipFileName);
|
||||
}
|
||||
|
||||
/**
|
||||
* 진행률 전송
|
||||
*/
|
||||
function member_export_send_progress($status, $message = "", $downloadType = 1, $total = 1, $current = 1, $totalChunks = 1, $currentChunk = 1, $files = [], $zipFile = '')
|
||||
function member_export_send_progress($status, $message = "", $downloadType = 1, $total = 1, $current = 1, $totalChunks = 1, $currentChunk = 1, $files = array(), $zipFile = '')
|
||||
{
|
||||
// 연결 상태 확인
|
||||
if (connection_aborted()) return;
|
||||
|
||||
$data = [
|
||||
$data = array(
|
||||
'status' => $status,
|
||||
'message' => $message,
|
||||
'downloadType' => $downloadType,
|
||||
@@ -130,9 +130,10 @@ function member_export_send_progress($status, $message = "", $downloadType = 1,
|
||||
'files' => $files,
|
||||
'zipFile' => $zipFile,
|
||||
'filePath' => G5_DATA_URL . "/" . MEMBER_BASE_DIR . "/" . MEMBER_BASE_DATE,
|
||||
];
|
||||
);
|
||||
|
||||
echo "data: " . json_encode($data, JSON_UNESCAPED_UNICODE) . "\n\n";
|
||||
$json_options = defined('JSON_UNESCAPED_UNICODE') ? JSON_UNESCAPED_UNICODE : 0;
|
||||
echo "data: " . json_encode($data, $json_options) . "\n\n";
|
||||
|
||||
// 더 안정적인 플러시
|
||||
if (ob_get_level()) ob_end_flush();
|
||||
@@ -145,18 +146,18 @@ function member_export_send_progress($status, $message = "", $downloadType = 1,
|
||||
function member_export_get_config()
|
||||
{
|
||||
$type = 1;
|
||||
$configs = [
|
||||
1 => [
|
||||
'title' => ["회원관리파일(일반)"],
|
||||
'headers' => ['아이디', '이름', '닉네임', '휴대폰번호', '전화번호', '이메일', '주소', '회원권한', '포인트', '가입일', '차단',
|
||||
$configs = array(
|
||||
1 => array(
|
||||
'title' => array("회원관리파일(일반)"),
|
||||
'headers' => array('아이디', '이름', '닉네임', '휴대폰번호', '전화번호', '이메일', '주소', '회원권한', '포인트', '가입일', '차단',
|
||||
'광고성 이메일 수신동의', '광고성 이메일 동의일자', '광고성 SMS/카카오톡 수신동의', '광고성 SMS/카카오톡 동의일자',
|
||||
'마케팅목적의개인정보수집및이용동의', '마케팅목적의개인정보수집및이용동의일자', '개인정보제3자제공동의', '개인정보제3자제공동의일자'],
|
||||
'fields' => ['mb_id', 'mb_name', 'mb_nick', 'mb_hp', 'mb_tel', 'mb_email', 'mb_addr1', 'mb_level', 'mb_point', 'mb_datetime', 'mb_intercept_date',
|
||||
'마케팅목적의개인정보수집및이용동의', '마케팅목적의개인정보수집및이용동의일자', '개인정보제3자제공동의', '개인정보제3자제공동의일자'),
|
||||
'fields' => array('mb_id', 'mb_name', 'mb_nick', 'mb_hp', 'mb_tel', 'mb_email', 'mb_addr1', 'mb_level', 'mb_point', 'mb_datetime', 'mb_intercept_date',
|
||||
'mb_mailling','mb_mailling_date', 'mb_sms','mb_sms_date', 'mb_marketing_agree',
|
||||
'mb_marketing_date', 'mb_thirdparty_agree', 'mb_thirdparty_date'],
|
||||
'widths' => [20, 20, 20, 20, 20, 30, 30, 10, 15, 25, 10, 20, 25, 20, 25, 20, 25, 20, 25],
|
||||
],
|
||||
];
|
||||
'mb_marketing_date', 'mb_thirdparty_agree', 'mb_thirdparty_date'),
|
||||
'widths' => array(20, 20, 20, 20, 20, 30, 30, 10, 15, 25, 10, 20, 25, 20, 25, 20, 25, 20, 25),
|
||||
),
|
||||
);
|
||||
|
||||
return isset($configs[$type]) ? $configs[$type] : $configs[1];
|
||||
}
|
||||
@@ -195,7 +196,7 @@ function member_export_get_data($params)
|
||||
$fields = array_unique($fields);
|
||||
|
||||
// SQL 변환 맵 (가공이 필요한 필드만 정의)
|
||||
$sqlTransformMap = [
|
||||
$sqlTransformMap = array(
|
||||
'mb_datetime' => "IF(mb_datetime = '0000-00-00 00:00:00', '', mb_datetime) AS mb_datetime",
|
||||
'mb_intercept_date' => "IF(mb_intercept_date != '', '차단됨', '정상') AS mb_intercept_date",
|
||||
'mb_sms' => "IF(mb_sms = '1', '동의', '미동의') AS mb_sms",
|
||||
@@ -206,10 +207,10 @@ function member_export_get_data($params)
|
||||
'mb_marketing_date' => "IF(mb_marketing_agree != '1' OR mb_marketing_date = '0000-00-00 00:00:00', '', mb_marketing_date) AS mb_marketing_date",
|
||||
'mb_thirdparty_agree' => "IF(mb_thirdparty_agree = '1', '동의', '미동의') AS mb_thirdparty_agree",
|
||||
'mb_thirdparty_date' => "IF(mb_thirdparty_agree != '1' OR mb_thirdparty_date = '0000-00-00 00:00:00', '', mb_thirdparty_date) AS mb_thirdparty_date",
|
||||
];
|
||||
);
|
||||
|
||||
// SQL 필드 생성
|
||||
$sqlFields = [];
|
||||
$sqlFields = array();
|
||||
foreach ($fields as $field) {
|
||||
$sqlFields[] = isset($sqlTransformMap[$field]) ? $sqlTransformMap[$field] : $field;
|
||||
}
|
||||
@@ -228,12 +229,16 @@ function member_export_get_data($params)
|
||||
throw new Exception("데이터 조회에 실패하였습니다");
|
||||
}
|
||||
|
||||
$excelData = [$config['title'], $config['headers']];
|
||||
$excelData = array($config['title'], $config['headers']);
|
||||
|
||||
while ($row = sql_fetch_array($result)) {
|
||||
$rowData = [];
|
||||
$rowData = array();
|
||||
foreach ($fields as $field) {
|
||||
$rowData[] = isset($row[$field]) ? $row[$field] : '';
|
||||
if (isset($row[$field])) {
|
||||
$rowData[] = function_exists('csv_safe_cell') ? csv_safe_cell($row[$field]) : $row[$field];
|
||||
} else {
|
||||
$rowData[] = '';
|
||||
}
|
||||
}
|
||||
$excelData[] = $rowData;
|
||||
}
|
||||
@@ -257,10 +262,10 @@ function member_export_create_excel($data, $fileName, $index = 0)
|
||||
$currentCache = PHPExcel_Settings::getCacheStorageMethod();
|
||||
|
||||
// 캐싱 모드 설정 (엑셀 생성 전용)
|
||||
$cacheMethods = [
|
||||
$cacheMethods = array(
|
||||
PHPExcel_CachedObjectStorageFactory::cache_to_discISAM,
|
||||
PHPExcel_CachedObjectStorageFactory::cache_in_memory_serialized
|
||||
];
|
||||
);
|
||||
|
||||
foreach ($cacheMethods as $method) {
|
||||
if (PHPExcel_Settings::setCacheStorageMethod($method)) {
|
||||
@@ -274,12 +279,12 @@ function member_export_create_excel($data, $fileName, $index = 0)
|
||||
|
||||
// 헤더 스타일 적용
|
||||
$last_char = member_export_column_char(count($config['headers']) - 1);
|
||||
$sheet->getStyle("A2:{$last_char}2")->applyFromArray([
|
||||
'fill' => [
|
||||
$sheet->getStyle("A2:{$last_char}2")->applyFromArray(array(
|
||||
'fill' => array(
|
||||
'type' => PHPExcel_Style_Fill::FILL_SOLID,
|
||||
'startcolor' => ['rgb' => 'D9E1F2'], // 연파랑 배경
|
||||
],
|
||||
]);
|
||||
'startcolor' => array('rgb' => 'D9E1F2'), // 연파랑 배경
|
||||
),
|
||||
));
|
||||
|
||||
// 셀 정렬 및 줄바꿈 설정
|
||||
$sheet->getStyle("A:{$last_char}")->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER)->setWrapText(true);
|
||||
@@ -309,14 +314,15 @@ function member_export_create_excel($data, $fileName, $index = 0)
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
throw new Exception("엑셀 파일 생성에 실패하였습니다: " . $e->getMessage());
|
||||
}
|
||||
finally
|
||||
{
|
||||
// 캐싱 모드 원래 상태로 복원
|
||||
if ($currentCache) {
|
||||
PHPExcel_Settings::setCacheStorageMethod($currentCache);
|
||||
}
|
||||
throw new Exception("엑셀 파일 생성에 실패하였습니다: " . $e->getMessage());
|
||||
}
|
||||
|
||||
// 캐싱 모드 원래 상태로 복원
|
||||
if ($currentCache) {
|
||||
PHPExcel_Settings::setCacheStorageMethod($currentCache);
|
||||
}
|
||||
|
||||
return $filename;
|
||||
@@ -329,7 +335,7 @@ function member_export_create_zip($files, $zipFileName)
|
||||
{
|
||||
if (!class_exists('ZipArchive')) {
|
||||
error_log('[Member Export Error] ZipArchive 클래스를 사용할 수 없습니다.');
|
||||
return ['error' => '파일을 압축하는 중 문제가 발생했습니다. 개별 파일로 제공됩니다.<br>: ZipArchive 클래스를 사용할 수 없습니다.'];
|
||||
return array('error' => '파일을 압축하는 중 문제가 발생했습니다. 개별 파일로 제공됩니다.<br>: ZipArchive 클래스를 사용할 수 없습니다.');
|
||||
}
|
||||
|
||||
member_export_ensure_directory(MEMBER_EXPORT_DIR);
|
||||
@@ -337,7 +343,7 @@ function member_export_create_zip($files, $zipFileName)
|
||||
|
||||
$zip = new ZipArchive();
|
||||
if ($zip->open($destinationZipPath, ZipArchive::CREATE | ZipArchive::OVERWRITE) !== TRUE) {
|
||||
return ['error' => "파일을 압축하는 중 문제가 발생했습니다. 개별 파일로 제공됩니다."];
|
||||
return array('error' => "파일을 압축하는 중 문제가 발생했습니다. 개별 파일로 제공됩니다.");
|
||||
}
|
||||
|
||||
foreach ($files as $file) {
|
||||
@@ -349,11 +355,11 @@ function member_export_create_zip($files, $zipFileName)
|
||||
|
||||
$result = $zip->close();
|
||||
|
||||
return [
|
||||
return array(
|
||||
'result' => $result,
|
||||
'zipFile' => $zipFileName . ".zip",
|
||||
'zipPath' => $destinationZipPath,
|
||||
];
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -378,7 +384,7 @@ function member_export_ensure_directory($dir)
|
||||
* - 알집 생성 완료 시 엑셀 파일 제거
|
||||
* - 작업 전 오늘 날짜 폴더 및 log 폴더를 제외한 나머지 파일 모두 제거
|
||||
*/
|
||||
function member_export_delete($fileList = [])
|
||||
function member_export_delete($fileList = array())
|
||||
{
|
||||
$cnt = 0;
|
||||
|
||||
@@ -397,7 +403,7 @@ function member_export_delete($fileList = [])
|
||||
|
||||
function deleteFolder($dir) {
|
||||
foreach (glob($dir . '/{.,}*', GLOB_BRACE) as $item) {
|
||||
if (in_array(basename($item), ['.', '..'])) continue;
|
||||
if (in_array(basename($item), array('.', '..'))) continue;
|
||||
is_dir($item) ? deleteFolder($item) : unlink($item);
|
||||
}
|
||||
rmdir($dir);
|
||||
@@ -407,7 +413,7 @@ function member_export_delete($fileList = [])
|
||||
$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++;
|
||||
@@ -424,7 +430,7 @@ function member_export_delete($fileList = [])
|
||||
/**
|
||||
* 로그 작성
|
||||
*/
|
||||
function member_export_write_log($params, $result = [])
|
||||
function member_export_write_log($params, $result = array())
|
||||
{
|
||||
global $member;
|
||||
|
||||
@@ -438,10 +444,13 @@ function member_export_write_log($params, $result = [])
|
||||
@chmod(MEMBER_LOG_DIR, G5_DIR_PERMISSION);
|
||||
}
|
||||
|
||||
$logFiles = glob(MEMBER_LOG_DIR . "/export_log_*.log") ?: [];
|
||||
$logFiles = glob(MEMBER_LOG_DIR . "/export_log_*.log");
|
||||
if (!$logFiles) {
|
||||
$logFiles = array();
|
||||
}
|
||||
|
||||
// 최신 파일 기준 정렬 (최신 → 오래된)
|
||||
usort($logFiles, fn($a, $b) => filemtime($b) - filemtime($a));
|
||||
usort($logFiles, 'member_export_compare_log_mtime');
|
||||
|
||||
$latestLogFile = isset($logFiles[0]) ? $logFiles[0] : null;
|
||||
|
||||
@@ -464,7 +473,7 @@ function member_export_write_log($params, $result = [])
|
||||
$status = $success ? '성공' : '실패';
|
||||
|
||||
// 조건 정리
|
||||
$condition = [];
|
||||
$condition = array();
|
||||
|
||||
// 검색 조건
|
||||
if ($params['use_stx'] == 1 && !empty($params['stx'])) {
|
||||
@@ -506,11 +515,11 @@ function member_export_write_log($params, $result = [])
|
||||
$condition[] = "수신동의일: {$params['agree_date_start']}~{$params['agree_date_end']}";
|
||||
}
|
||||
|
||||
if (in_array($params['ad_range_type'], ["month_confirm", "custom_period"])){
|
||||
$channels = array_filter([
|
||||
if (in_array($params['ad_range_type'], array("month_confirm", "custom_period"))){
|
||||
$channels = array_filter(array(
|
||||
!empty($params['ad_mailling']) && (int)$params['ad_mailling'] === 1 ? '이메일' : null,
|
||||
!empty($params['ad_sms']) && (int)$params['ad_sms'] === 1 ? 'SMS/카카오톡' : null,
|
||||
]);
|
||||
));
|
||||
|
||||
if ($channels) {
|
||||
$condition[] = '수신채널: ' . implode(', ', $channels);
|
||||
@@ -531,7 +540,7 @@ function member_export_write_log($params, $result = [])
|
||||
// 성공일 경우 추가 정보
|
||||
if ($success) {
|
||||
$total = isset($result['total']) ? $result['total'] : 0;
|
||||
$fileCount = isset($result['zip']) ? 1 : count(isset($result['files']) ? $result['files'] : []);
|
||||
$fileCount = isset($result['zip']) ? 1 : count(isset($result['files']) ? $result['files'] : array());
|
||||
$line1 .= " | 총 {$total}건 | 파일: {$fileCount}개";
|
||||
}
|
||||
|
||||
@@ -548,4 +557,9 @@ function member_export_write_log($params, $result = [])
|
||||
if (@file_put_contents($latestLogFile, $logEntry, FILE_APPEND | LOCK_EX) === false) {
|
||||
error_log("[Member Export Error] 로그 파일 기록 실패: {$latestLogFile}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function member_export_compare_log_mtime($a, $b)
|
||||
{
|
||||
return filemtime($b) - filemtime($a);
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ if ($_POST['act_button'] == "선택수정") {
|
||||
$post_mb_sms = isset($_POST['mb_sms'][$k]) ? (int) $_POST['mb_sms'][$k] : 0;
|
||||
$post_mb_open = isset($_POST['mb_open'][$k]) ? (int) $_POST['mb_open'][$k] : 0;
|
||||
|
||||
$agree_items = [];
|
||||
$agree_items = array();
|
||||
// 광고성 이메일 수신동의 일자 추가
|
||||
$post_mb_mailling_default = isset($_POST['mb_mailling_default'][$k]) ? (int) $_POST['mb_mailling_default'][$k] : 0;
|
||||
$sql_mailling_date = "";
|
||||
@@ -57,6 +57,8 @@ if ($_POST['act_button'] == "선택수정") {
|
||||
$msg .= $mb['mb_id'] . ' : 회원자료가 존재하지 않습니다.\\n';
|
||||
} elseif ($is_admin != 'super' && $mb['mb_level'] >= $member['mb_level']) {
|
||||
$msg .= $mb['mb_id'] . ' : 자신보다 권한이 높거나 같은 회원은 수정할 수 없습니다.\\n';
|
||||
} elseif ($is_admin != 'super' && $post_mb_level >= (int) $member['mb_level']) {
|
||||
$msg .= $mb['mb_id'] . ' : 자신보다 권한이 높거나 같은 등급은 부여할 수 없습니다.\\n';
|
||||
} elseif ($member['mb_id'] == $mb['mb_id']) {
|
||||
$msg .= $mb['mb_id'] . ' : 로그인 중인 관리자는 수정 할 수 없습니다.\\n';
|
||||
} else {
|
||||
|
||||
@@ -11,22 +11,6 @@ if (!isset($g5['menu_table'])) {
|
||||
die('<meta charset="utf-8">dbconfig.php 파일에 <strong>$g5[\'menu_table\'] = G5_TABLE_PREFIX.\'menu\';</strong> 를 추가해 주세요.');
|
||||
}
|
||||
|
||||
if (!sql_query(" DESCRIBE {$g5['menu_table']} ", false)) {
|
||||
sql_query(
|
||||
" CREATE TABLE IF NOT EXISTS `{$g5['menu_table']}` (
|
||||
`me_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`me_code` varchar(255) NOT NULL DEFAULT '',
|
||||
`me_name` varchar(255) NOT NULL DEFAULT '',
|
||||
`me_link` varchar(255) NOT NULL DEFAULT '',
|
||||
`me_target` varchar(255) NOT NULL DEFAULT '0',
|
||||
`me_order` int(11) NOT NULL DEFAULT '0',
|
||||
`me_use` tinyint(4) NOT NULL DEFAULT '0',
|
||||
`me_mobile_use` tinyint(4) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`me_id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ",
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
$sql = " select * from {$g5['menu_table']} order by me_id ";
|
||||
$result = sql_query($sql);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -17,8 +17,6 @@ $nw = array(
|
||||
$html_title = "팝업레이어";
|
||||
|
||||
// 팝업레이어 테이블에 쇼핑몰, 커뮤니티 인지 구분하는 여부 필드 추가
|
||||
$sql = " ALTER TABLE `{$g5['new_win_table']}` ADD `nw_division` VARCHAR(10) NOT NULL DEFAULT 'both' ";
|
||||
sql_query($sql, false);
|
||||
|
||||
if ($w == "u") {
|
||||
$html_title .= " 수정";
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -8,31 +8,6 @@ if (!isset($g5['new_win_table'])) {
|
||||
die('<meta charset="utf-8">/data/dbconfig.php 파일에 <strong>$g5[\'new_win_table\'] = G5_TABLE_PREFIX.\'new_win\';</strong> 를 추가해 주세요.');
|
||||
}
|
||||
//내용(컨텐츠)정보 테이블이 있는지 검사한다.
|
||||
if (!sql_query(" DESCRIBE {$g5['new_win_table']} ", false)) {
|
||||
if (sql_query(" DESCRIBE {$g5['g5_shop_new_win_table']} ", false)) {
|
||||
sql_query(" ALTER TABLE {$g5['g5_shop_new_win_table']} RENAME TO `{$g5['new_win_table']}` ;", false);
|
||||
} else {
|
||||
$query_cp = sql_query(
|
||||
" CREATE TABLE IF NOT EXISTS `{$g5['new_win_table']}` (
|
||||
`nw_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`nw_division` varchar(10) NOT NULL DEFAULT 'both',
|
||||
`nw_device` varchar(10) NOT NULL DEFAULT 'both',
|
||||
`nw_begin_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`nw_end_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`nw_disable_hours` int(11) NOT NULL DEFAULT '0',
|
||||
`nw_left` int(11) NOT NULL DEFAULT '0',
|
||||
`nw_top` int(11) NOT NULL DEFAULT '0',
|
||||
`nw_height` int(11) NOT NULL DEFAULT '0',
|
||||
`nw_width` int(11) NOT NULL DEFAULT '0',
|
||||
`nw_subject` text NOT NULL,
|
||||
`nw_content` text NOT NULL,
|
||||
`nw_content_html` tinyint(4) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`nw_id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ",
|
||||
true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$g5['title'] = '팝업레이어 관리';
|
||||
require_once G5_ADMIN_PATH . '/admin.head.php';
|
||||
|
||||
+6
-1
@@ -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) {
|
||||
@@ -69,7 +74,7 @@ if ($config['cf_point_term'] > 0) {
|
||||
$po_expire_term = $config['cf_point_term'];
|
||||
}
|
||||
|
||||
if (strstr($sfl, "mb_id")) {
|
||||
if (strpos($sfl, "mb_id") !== false) {
|
||||
$mb_id = $stx;
|
||||
} else {
|
||||
$mb_id = "";
|
||||
|
||||
@@ -23,10 +23,6 @@ if ($w == '') {
|
||||
alert('w 값이 제대로 넘어오지 않았습니다.');
|
||||
}
|
||||
|
||||
if (!isset($po['po_use'])) {
|
||||
sql_query(" alter table `{$g5['poll_table']}` add `po_use` tinyint not null default '0' after `mb_ids` ", false);
|
||||
}
|
||||
|
||||
$g5['title'] = $html_title;
|
||||
require_once './admin.head.php';
|
||||
?>
|
||||
|
||||
@@ -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']}
|
||||
|
||||
@@ -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 ( ";
|
||||
|
||||
@@ -6,6 +6,8 @@ auth_check_menu($auth, $sub_menu, 'r');
|
||||
|
||||
// 체크된 자료 삭제
|
||||
if (isset($_POST['chk']) && is_array($_POST['chk'])) {
|
||||
check_admin_token();
|
||||
|
||||
for ($i = 0; $i < count($_POST['chk']); $i++) {
|
||||
$pp_id = (int) $_POST['chk'][$i];
|
||||
|
||||
@@ -14,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) {
|
||||
|
||||
@@ -8,92 +8,6 @@ auth_check_menu($auth, $sub_menu, 'r');
|
||||
$g5['title'] = '1:1문의 설정';
|
||||
require_once './admin.head.php';
|
||||
|
||||
// DB 테이블 생성
|
||||
if (!sql_query(" DESCRIBE `{$g5['qa_config_table']}` ", false)) {
|
||||
sql_query(
|
||||
" CREATE TABLE IF NOT EXISTS `{$g5['qa_config_table']}` (
|
||||
`qa_id` int(11) NOT NULL auto_increment,
|
||||
`qa_title` varchar(255) NOT NULL DEFAULT'',
|
||||
`qa_category` varchar(255) NOT NULL DEFAULT'',
|
||||
`qa_skin` varchar(255) NOT NULL DEFAULT '',
|
||||
`qa_mobile_skin` varchar(255) NOT NULL DEFAULT '',
|
||||
`qa_use_email` tinyint(4) NOT NULL DEFAULT '0',
|
||||
`qa_req_email` tinyint(4) NOT NULL DEFAULT '0',
|
||||
`qa_use_hp` tinyint(4) NOT NULL DEFAULT '0',
|
||||
`qa_req_hp` tinyint(4) NOT NULL DEFAULT '0',
|
||||
`qa_use_sms` tinyint(4) NOT NULL DEFAULT '0',
|
||||
`qa_send_number` varchar(255) NOT NULL DEFAULT '',
|
||||
`qa_admin_hp` varchar(255) NOT NULL DEFAULT '',
|
||||
`qa_use_editor` tinyint(4) NOT NULL DEFAULT '0',
|
||||
`qa_subject_len` int(11) NOT NULL DEFAULT '0',
|
||||
`qa_mobile_subject_len` int(11) NOT NULL DEFAULT '0',
|
||||
`qa_page_rows` int(11) NOT NULL DEFAULT '0',
|
||||
`qa_mobile_page_rows` int(11) NOT NULL DEFAULT '0',
|
||||
`qa_image_width` int(11) NOT NULL DEFAULT '0',
|
||||
`qa_upload_size` int(11) NOT NULL DEFAULT '0',
|
||||
`qa_insert_content` text NOT NULL,
|
||||
`qa_include_head` varchar(255) NOT NULL DEFAULT '',
|
||||
`qa_include_tail` varchar(255) NOT NULL DEFAULT '',
|
||||
`qa_content_head` text NOT NULL,
|
||||
`qa_content_tail` text NOT NULL,
|
||||
`qa_mobile_content_head` text NOT NULL,
|
||||
`qa_mobile_content_tail` text NOT NULL,
|
||||
`qa_1_subj` varchar(255) NOT NULL DEFAULT '',
|
||||
`qa_2_subj` varchar(255) NOT NULL DEFAULT '',
|
||||
`qa_3_subj` varchar(255) NOT NULL DEFAULT '',
|
||||
`qa_4_subj` varchar(255) NOT NULL DEFAULT '',
|
||||
`qa_5_subj` varchar(255) NOT NULL DEFAULT '',
|
||||
`qa_1` varchar(255) NOT NULL DEFAULT '',
|
||||
`qa_2` varchar(255) NOT NULL DEFAULT '',
|
||||
`qa_3` varchar(255) NOT NULL DEFAULT '',
|
||||
`qa_4` varchar(255) NOT NULL DEFAULT '',
|
||||
`qa_5` varchar(255) NOT NULL DEFAULT '',
|
||||
PRIMARY KEY (`qa_id`)
|
||||
)",
|
||||
true
|
||||
);
|
||||
sql_query(
|
||||
" CREATE TABLE IF NOT EXISTS `{$g5['qa_content_table']}` (
|
||||
`qa_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`qa_num` int(11) NOT NULL DEFAULT '0',
|
||||
`qa_parent` int(11) NOT NULL DEFAULT '0',
|
||||
`qa_related` int(11) NOT NULL DEFAULT '0',
|
||||
`mb_id` varchar(20) NOT NULL DEFAULT '',
|
||||
`qa_name` varchar(255) NOT NULL DEFAULT '',
|
||||
`qa_email` varchar(255) NOT NULL DEFAULT '',
|
||||
`qa_hp` varchar(255) NOT NULL DEFAULT '',
|
||||
`qa_type` tinyint(4) NOT NULL DEFAULT '0',
|
||||
`qa_category` varchar(255) NOT NULL DEFAULT '',
|
||||
`qa_email_recv` tinyint(4) NOT NULL DEFAULT '0',
|
||||
`qa_sms_recv` tinyint(4) NOT NULL DEFAULT '0',
|
||||
`qa_html` tinyint(4) NOT NULL DEFAULT '0',
|
||||
`qa_subject` varchar(255) NOT NULL DEFAULT '',
|
||||
`qa_content` text NOT NULL,
|
||||
`qa_status` tinyint(4) NOT NULL DEFAULT '0',
|
||||
`qa_file1` varchar(255) NOT NULL DEFAULT '',
|
||||
`qa_source1` varchar(255) NOT NULL DEFAULT '',
|
||||
`qa_file2` varchar(255) NOT NULL DEFAULT '',
|
||||
`qa_source2` varchar(255) NOT NULL DEFAULT '',
|
||||
`qa_ip` varchar(255) NOT NULL DEFAULT '',
|
||||
`qa_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`qa_1` varchar(255) NOT NULL DEFAULT '',
|
||||
`qa_2` varchar(255) NOT NULL DEFAULT '',
|
||||
`qa_3` varchar(255) NOT NULL DEFAULT '',
|
||||
`qa_4` varchar(255) NOT NULL DEFAULT '',
|
||||
`qa_5` varchar(255) NOT NULL DEFAULT '',
|
||||
PRIMARY KEY (`qa_id`),
|
||||
KEY `qa_num_parent` (`qa_num`,`qa_parent`)
|
||||
)",
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
$sql = " SHOW COLUMNS FROM `{$g5['qa_content_table']}` LIKE 'qa_content' ";
|
||||
$row = sql_fetch($sql);
|
||||
if (strpos($row['Type'], 'text') === false) {
|
||||
sql_query(" ALTER TABLE `{$g5['qa_content_table']}` CHANGE `qa_content` `qa_content` text NOT NULL ", true);
|
||||
}
|
||||
|
||||
$qaconfig = get_qa_config();
|
||||
|
||||
if (empty($qaconfig)) {
|
||||
@@ -106,28 +20,6 @@ if (empty($qaconfig)) {
|
||||
$qaconfig = get_qa_config();
|
||||
}
|
||||
|
||||
// 관리자 이메일필드 추가
|
||||
if (!isset($qaconfig['qa_admin_email'])) {
|
||||
sql_query(
|
||||
" ALTER TABLE `{$g5['qa_config_table']}`
|
||||
ADD `qa_admin_email` varchar(255) NOT NULL DEFAULT '' AFTER `qa_admin_hp` ",
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
// 상단 하단 설정 필드 추가
|
||||
if (!isset($qaconfig['qa_include_head'])) {
|
||||
sql_query(
|
||||
" ALTER TABLE `{$g5['qa_config_table']}`
|
||||
ADD `qa_include_head` varchar(255) NOT NULL DEFAULT '' AFTER `qa_insert_content`,
|
||||
ADD `qa_include_tail` varchar(255) NOT NULL DEFAULT '' AFTER `qa_include_head`,
|
||||
ADD `qa_content_head` text NOT NULL AFTER `qa_include_tail`,
|
||||
ADD `qa_content_tail` text NOT NULL AFTER `qa_content_head`,
|
||||
ADD `qa_mobile_content_head` text NOT NULL AFTER `qa_content_tail`,
|
||||
ADD `qa_mobile_content_tail` text NOT NULL AFTER `qa_mobile_content_head` ",
|
||||
true
|
||||
);
|
||||
}
|
||||
?>
|
||||
|
||||
<form name="fqaconfigform" id="fqaconfigform" method="post" onsubmit="return fqaconfigform_submit(this);" autocomplete="off">
|
||||
|
||||
@@ -15,12 +15,18 @@ $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)) : '';
|
||||
$qa_include_tail = isset($qa_include_tail) ? preg_replace(array("#[\\\]+$#", "#(<\?php|<\?)#i"), "", substr($qa_include_tail, 0, 255)) : '';
|
||||
|
||||
// 최고 관리자가 아니면 include 경로 변경 불가 (board_form_update.php 와 동일 정책)
|
||||
if ($is_admin !== 'super') {
|
||||
$qa_include_head = isset($qaconfig['qa_include_head']) ? $qaconfig['qa_include_head'] : '';
|
||||
$qa_include_tail = isset($qaconfig['qa_include_tail']) ? $qaconfig['qa_include_tail'] : '';
|
||||
}
|
||||
|
||||
// 관리자가 자동등록방지를 사용해야 할 경우
|
||||
if ($board && ($qaconfig['qa_include_head'] !== $qa_include_head || $qaconfig['qa_include_tail'] !== $qa_include_tail) && function_exists('get_admin_captcha_by') && get_admin_captcha_by()) {
|
||||
include_once G5_CAPTCHA_PATH . '/captcha.lib.php';
|
||||
@@ -30,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);
|
||||
|
||||
@@ -56,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바이트로 바꾼다.
|
||||
|
||||
+61
-24
@@ -9,40 +9,76 @@ if (!$config['cf_email_use'])
|
||||
|
||||
include_once(G5_LIB_PATH.'/mailer.lib.php');
|
||||
|
||||
$token = get_token();
|
||||
|
||||
$g5['title'] = '메일 테스트';
|
||||
include_once('./admin.head.php');
|
||||
|
||||
if (isset($_POST['email'])) {
|
||||
check_admin_token();
|
||||
|
||||
$_POST['email'] = strip_tags($_POST['email']);
|
||||
$email = explode(',', $_POST['email']);
|
||||
|
||||
$real_email = array();
|
||||
$sent_email = array(); // 발송 요청 성공
|
||||
$failed_email = array(); // 발송 실패 (메일 서버에서 거부/오류)
|
||||
|
||||
for ($i=0; $i<count($email); $i++){
|
||||
|
||||
if (!preg_match("/([0-9a-zA-Z_-]+)@([0-9a-zA-Z_-]+)\.([0-9a-zA-Z_-]+)/", $email[$i])) continue;
|
||||
|
||||
$real_email[] = $email[$i];
|
||||
mailer($config['cf_admin_email_name'], $config['cf_admin_email'], trim($email[$i]), '[메일검사] 제목', '<span style="font-size:9pt;">[메일검사] 내용<p>이 내용이 제대로 보인다면 보내는 메일 서버에는 이상이 없는것입니다.<p>'.G5_TIME_YMDHIS.'<p>이 메일 주소로는 회신되지 않습니다.</span>', 1);
|
||||
|
||||
$to = trim($email[$i]);
|
||||
$send_result = mailer($config['cf_admin_email_name'], $config['cf_admin_email'], $to, '[메일검사] 제목', '<span style="font-size:9pt;">[메일검사] 내용<p>이 내용이 제대로 보인다면 보내는 메일 서버에는 이상이 없는것입니다.<p>'.G5_TIME_YMDHIS.'<p>이 메일 주소로는 회신되지 않습니다.</span>', 1);
|
||||
|
||||
if ($send_result) {
|
||||
$sent_email[] = $to;
|
||||
} else {
|
||||
$failed_email[] = $to;
|
||||
}
|
||||
}
|
||||
|
||||
if( $real_email ){
|
||||
if( $sent_email || $failed_email ){
|
||||
echo '<section>';
|
||||
echo '<h2>결과메세지</h2>';
|
||||
echo '<div class="local_desc01 local_desc"><p>';
|
||||
echo '다음 '.count($real_email).'개의 메일 주소로 테스트 메일 발송이 완료되었습니다.';
|
||||
echo '</p></div>';
|
||||
echo '<ul>';
|
||||
for ($i=0;$i<count($real_email);$i++) {
|
||||
echo '<li>'.$real_email[$i].'</li>';
|
||||
echo '<h2>결과 메시지</h2>';
|
||||
|
||||
if( $sent_email ){
|
||||
echo '<div class="local_desc01 local_desc"><p>';
|
||||
echo '다음 '.count($sent_email).'개의 메일 주소로 테스트 메일 <strong>발송 요청이 성공</strong>했습니다. <strong>수신함 도착 여부는 별도 확인이 필요합니다.</strong>';
|
||||
echo '</p></div>';
|
||||
echo '<ul>';
|
||||
for ($i=0;$i<count($sent_email);$i++) {
|
||||
echo '<li>'.get_text($sent_email[$i]).'</li>';
|
||||
}
|
||||
echo '</ul>';
|
||||
echo '<div class="local_desc02 local_desc"><p>';
|
||||
echo '<strong>발송 요청 성공은 사이트가 메일 서버에 메일을 넘겼다는 의미이며, 받은편지함 도착을 보장하지는 않습니다.</strong><br>';
|
||||
echo '메일이 보이지 않는다면 아래 항목을 순서대로 확인해 주십시오.';
|
||||
echo '</p></div>';
|
||||
echo '<ol>';
|
||||
echo '<li>받은편지함뿐 아니라 <strong>스팸함, 정크메일함, 프로모션함</strong>을 확인합니다.</li>';
|
||||
echo '<li>네이버, 지메일, 회사메일 등 <strong>서로 다른 메일 주소</strong>로 다시 테스트합니다.</li>';
|
||||
echo '<li>관리자 메일 주소가 사이트 도메인과 같은지 확인합니다. 도메인이 다르면 스팸으로 분류될 가능성이 높습니다.</li>';
|
||||
echo '<li>도메인 메일을 사용한다면 <strong>SPF, DKIM, DMARC</strong> 설정을 확인합니다.</li>';
|
||||
echo '<li>계속 도착하지 않으면 서버 개발자에게 메일 발송 로그를 확인해주세요.</li>';
|
||||
echo '</ol>';
|
||||
}
|
||||
echo '</ul>';
|
||||
echo '<div class="local_desc02 local_desc"><p>';
|
||||
echo '해당 주소로 테스트 메일이 도착했는지 확인해 주십시오.<br>';
|
||||
echo '만약, 테스트 메일이 오지 않는다면 더 다양한 계정의 메일 주소로 메일을 보내 보십시오.<br>';
|
||||
echo '그래도 메일이 하나도 도착하지 않는다면 메일 서버(sendmail server)의 오류일 가능성이 높으니, 웹 서버관리자에게 문의하여 주십시오.<br>';
|
||||
echo '도메인을 소유하고 있을시 SPF, DKIM 설정이 필요할수 있습니다.<br>';
|
||||
echo '</p></div>';
|
||||
|
||||
if( $failed_email ){
|
||||
echo '<div class="local_desc01 local_desc" style="color:#d9534f"><p>';
|
||||
echo '다음 '.count($failed_email).'개의 메일 주소는 <strong>발송에 실패</strong>했습니다.';
|
||||
echo '</p></div>';
|
||||
echo '<ul>';
|
||||
for ($i=0;$i<count($failed_email);$i++) {
|
||||
echo '<li>'.get_text($failed_email[$i]).'</li>';
|
||||
}
|
||||
echo '</ul>';
|
||||
echo '<div class="local_desc02 local_desc"><p>';
|
||||
echo '발송 실패는 받는 사람의 문제가 아니라 <strong>보내는 서버(메일 발송) 설정 문제</strong>일 가능성이 높습니다.<br>';
|
||||
echo 'SMTP 정보(주소/포트/인증)가 올바른지, 서버에서 메일 발송(sendmail/mail 함수)이 허용되어 있는지 확인하시고, 웹 서버 관리자(호스팅 업체)에게 문의해 주십시오.<br>';
|
||||
echo '자세한 오류 내용은 서버의 PHP error_log 에 기록됩니다.<br>';
|
||||
echo '</p></div>';
|
||||
}
|
||||
|
||||
echo '</section>';
|
||||
}
|
||||
}
|
||||
@@ -52,15 +88,16 @@ if (isset($_POST['email'])) {
|
||||
<h2>테스트 메일 발송</h2>
|
||||
<div class="local_desc02 local_desc">
|
||||
<p>
|
||||
메일서버가 정상적으로 동작 중인지 확인할 수 있습니다.<br>
|
||||
사이트에서 메일 서버로 메일을 전달할 수 있는지 확인합니다. 이 테스트는 받은편지함 도착을 보장하지 않습니다.<br>
|
||||
아래 입력칸에 테스트 메일을 발송하실 메일 주소를 입력하시면, [메일검사] 라는 제목으로 테스트 메일을 발송합니다.<br>
|
||||
보내는 메일주소 : <?php echo get_sanitize_input($config['cf_admin_email']); ?><br>
|
||||
<?php if (function_exists('domain_mail_host') && $config['cf_admin_email'] && stripos($config['cf_admin_email'], domain_mail_host()) === false) { ?>
|
||||
<?php echo '외부메일설정이나 기타 설정을 하지 않았다면, 도메인과 다른 헤더로 여겨 스팸이나 차단될 가능성이 있습니다.<br>기본환경설정에서 관리자 메일 주소를 name'.domain_mail_host().' 과 같은 도메인 형식으로 설정할것을 권장합니다.'; ?>
|
||||
<?php echo '외부메일설정이나 기타 설정을 하지 않았다면, 도메인과 다른 헤더로 여겨 스팸이나 차단될 가능성이 있습니다.<br>외부메일설정이나 기타 설정을 하지 않았다면, 기본환경설정에서 관리자 메일 주소를 name'.domain_mail_host().' 과 같은 도메인 형식으로 설정할것을 권장합니다.'; ?>
|
||||
<?php } ?>
|
||||
</p>
|
||||
</div>
|
||||
<form name="fsendmailtest" method="post">
|
||||
<input type="hidden" name="token" value="<?php echo $token; ?>">
|
||||
<fieldset id="fsendmailtest">
|
||||
<legend>테스트메일 발송</legend>
|
||||
<label for="email">받는 메일주소<strong class="sound_only"> 필수</strong></label>
|
||||
@@ -70,11 +107,11 @@ if (isset($_POST['email'])) {
|
||||
</form>
|
||||
<div class="local_desc02 local_desc">
|
||||
<p>
|
||||
만약 [메일검사] 라는 내용으로 테스트 메일이 도착하지 않는다면 보내는 메일서버 혹은 받는 메일서버 중 문제가 발생했을 가능성이 있습니다.<br>
|
||||
따라서 보다 정확한 테스트를 원하신다면 여러 곳으로 테스트 메일을 발송하시기 바랍니다.<br>
|
||||
테스트 결과가 발송 요청 성공으로 표시되어도 수신 메일 서버의 스팸 정책에 따라 도착하지 않을 수 있습니다.<br>
|
||||
정확한 확인을 위해 여러 메일 서비스로 테스트하고, 도착하지 않으면 스팸함과 도메인 인증(SPF, DKIM, DMARC)을 확인해 주십시오.<br>
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<?php
|
||||
include_once('./admin.tail.php');
|
||||
include_once('./admin.tail.php');
|
||||
|
||||
+7
-6
@@ -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>
|
||||
|
||||
@@ -31,7 +31,7 @@ include_once("./admin.head.php");
|
||||
echo $list_tag_st;
|
||||
while($file=readdir($dir)) {
|
||||
|
||||
if (!strstr($file,'sess_')) continue;
|
||||
if (strpos($file,'sess_') === false) continue;
|
||||
if (strpos($file,'sess_')!=0) continue;
|
||||
|
||||
$session_file = G5_DATA_PATH.'/session/'.$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)
|
||||
{
|
||||
@@ -49,7 +88,8 @@ function change_status($od_id, $current_status, $change_status)
|
||||
$sql = " update {$g5['g5_shop_order_table']} set od_status = '{$change_status}' where od_id = '{$od_id}' and od_status = '{$current_status}' ";
|
||||
sql_query($sql, true);
|
||||
|
||||
$sql = " update {$g5['g5_shop_cart_table']} set ct_status = '{$change_status}' where od_id = '{$od_id}' and ct_status = '{$current_status}' ";
|
||||
$complete_time_sql = get_cart_complete_time_sql($change_status);
|
||||
$sql = " update {$g5['g5_shop_cart_table']} set ct_complete_time = $complete_time_sql, ct_status = '{$change_status}' where od_id = '{$od_id}' and ct_status = '{$current_status}' ";
|
||||
sql_query($sql, true);
|
||||
}
|
||||
|
||||
@@ -131,7 +171,7 @@ function pg_setting_check($is_print=false){
|
||||
if( $default['de_pg_service'] === 'kcp' && $default['de_kcp_mid'] && $default['de_kcp_site_key'] ){
|
||||
$pg_msg = 'NHN KCP';
|
||||
} else if ( $default['de_pg_service'] === 'lg' && $config['cf_lg_mid'] && $config['cf_lg_mert_key'] ){
|
||||
$pg_msg = 'LG유플러스';
|
||||
$msg .= '<div class="admin_pg_notice od_test_caution">(주의!) 토스페이먼츠(구버전) 결제의 결제 설정이 현재 테스트결제로 되어 있습니다.<br>반드시 <a href="#lg_info_anchor">MERT KEY</a>를 <u>[테스트]키</u>로 설정한 후 테스트결제를 진행해야합니다.<br>쇼핑몰 운영 시에는 실결제로 전환하여 <u>[라이브]키</u>로 설정해 주시기 바랍니다.<br>아래 링크를 클릭하여 실결제로 설정하여 운영해 주세요.<br><a href="'.$pg_test_conf_link.'" class="pg_test_conf_link">'.$pg_test_conf_link.'</a></div>';
|
||||
} else if ( $default['de_pg_service'] === 'toss' && $config['cf_lg_mid'] && $config['cf_toss_client_key'] && $config['cf_toss_secret_key'] ){
|
||||
$msg .= '<div class="admin_pg_notice od_test_caution">(주의!) 토스페이먼츠 결제의 결제 설정이 현재 테스트결제로 되어 있습니다.<br>반드시 <a href="#lg_info_anchor">상점 API키</a>를 <u>[테스트]키</u>로 설정한 후 테스트결제를 진행해야합니다.<br>쇼핑몰 운영 시에는 실결제로 전환하여 <u>[라이브]키</u>로 설정해 주시기 바랍니다.<br>아래 링크를 클릭하여 실결제로 설정하여 운영해 주세요.<br><a href="'.$pg_test_conf_link.'" class="pg_test_conf_link">'.$pg_test_conf_link.'</a></div>';
|
||||
} else if ( $default['de_pg_service'] === 'inicis' && $default['de_inicis_mid'] && $default['de_inicis_sign_key'] ){
|
||||
@@ -161,6 +201,7 @@ function pg_setting_check($is_print=false){
|
||||
}
|
||||
|
||||
function is_cancel_shop_pg_order($od){
|
||||
global $default;
|
||||
|
||||
$is_od_pg_cancel = false;
|
||||
|
||||
@@ -168,7 +209,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 +217,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 +419,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 +436,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 +476,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;
|
||||
|
||||
@@ -33,11 +33,6 @@ else
|
||||
}
|
||||
|
||||
// 접속기기 필드 추가
|
||||
if(!sql_query(" select bn_device from {$g5['g5_shop_banner_table']} limit 0, 1 ")) {
|
||||
sql_query(" ALTER TABLE `{$g5['g5_shop_banner_table']}`
|
||||
ADD `bn_device` varchar(10) not null default '' AFTER `bn_url` ", true);
|
||||
sql_query(" update {$g5['g5_shop_banner_table']} set bn_device = 'pc' ", true);
|
||||
}
|
||||
|
||||
include_once (G5_ADMIN_PATH.'/admin.head.php');
|
||||
?>
|
||||
@@ -171,4 +166,4 @@ include_once (G5_ADMIN_PATH.'/admin.head.php');
|
||||
</form>
|
||||
|
||||
<?php
|
||||
include_once (G5_ADMIN_PATH.'/admin.tail.php');
|
||||
include_once (G5_ADMIN_PATH.'/admin.tail.php');
|
||||
|
||||
@@ -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");
|
||||
@@ -49,8 +49,6 @@ if ($w=="")
|
||||
{
|
||||
if (!$bn_bimg_name) alert('배너 이미지를 업로드 하세요.');
|
||||
|
||||
sql_query(" alter table {$g5['g5_shop_banner_table']} auto_increment=1 ");
|
||||
|
||||
$sql = " insert into {$g5['g5_shop_banner_table']}
|
||||
set bn_alt = '$bn_alt',
|
||||
bn_url = '$bn_url',
|
||||
@@ -99,4 +97,4 @@ if ($w == "" || $w == "u")
|
||||
goto_url("./bannerform.php?w=u&bn_id=$bn_id");
|
||||
} else {
|
||||
goto_url("./bannerlist.php");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,30 +109,12 @@ if ($w == 'u') $pg_anchor .= '<li><a href="#frm_etc">기타설정</a></li>';
|
||||
$pg_anchor .= '</ul>';
|
||||
|
||||
// 쿠폰 적용 불가 설정 필드 추가
|
||||
if(!sql_query(" select ca_nocoupon from {$g5['g5_shop_category_table']} limit 1 ", false)) {
|
||||
sql_query(" ALTER TABLE `{$g5['g5_shop_category_table']}`
|
||||
ADD `ca_nocoupon` tinyint(4) NOT NULL DEFAULT '0' AFTER `ca_adult_use` ", true);
|
||||
}
|
||||
|
||||
// 스킨 디렉토리 필드 추가
|
||||
if(!sql_query(" select ca_skin_dir from {$g5['g5_shop_category_table']} limit 1 ", false)) {
|
||||
sql_query(" ALTER TABLE `{$g5['g5_shop_category_table']}`
|
||||
ADD `ca_skin_dir` varchar(255) NOT NULL DEFAULT '' AFTER `ca_name`,
|
||||
ADD `ca_mobile_skin_dir` varchar(255) NOT NULL DEFAULT '' AFTER `ca_skin_dir` ", true);
|
||||
}
|
||||
|
||||
// 분류 출력순서 필드 추가
|
||||
if(!sql_query(" select ca_order from {$g5['g5_shop_category_table']} limit 1 ", false)) {
|
||||
sql_query(" ALTER TABLE `{$g5['g5_shop_category_table']}`
|
||||
ADD `ca_order` int(11) NOT NULL DEFAULT '0' AFTER `ca_name` ", true);
|
||||
sql_query(" ALTER TABLE `{$g5['g5_shop_category_table']}` ADD INDEX(`ca_order`) ", true);
|
||||
}
|
||||
|
||||
// 모바일 상품 출력줄수 필드 추가
|
||||
if(!sql_query(" select ca_mobile_list_row from {$g5['g5_shop_category_table']} limit 1 ", false)) {
|
||||
sql_query(" ALTER TABLE `{$g5['g5_shop_category_table']}`
|
||||
ADD `ca_mobile_list_row` int(11) NOT NULL DEFAULT '0' AFTER `ca_mobile_list_mod` ", true);
|
||||
}
|
||||
|
||||
// 스킨 Path
|
||||
if(!$ca['ca_skin_dir'])
|
||||
@@ -636,4 +618,4 @@ jQuery(function($){
|
||||
</script>
|
||||
|
||||
<?php
|
||||
include_once (G5_ADMIN_PATH.'/admin.tail.php');
|
||||
include_once (G5_ADMIN_PATH.'/admin.tail.php');
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -123,7 +131,7 @@ if ($w == "" || $w == "u")
|
||||
$sql = " select mb_id from {$g5['member_table']} where mb_id = '$ca_mb_id' ";
|
||||
$row = sql_fetch($sql);
|
||||
if (!$row['mb_id'])
|
||||
alert("\'$ca_mb_id\' 은(는) 존재하는 회원아이디가 아닙니다.");
|
||||
alert("'$ca_mb_id' 은(는) 존재하는 회원아이디가 아닙니다.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -256,4 +264,4 @@ if ($w == "" || $w == "u")
|
||||
goto_url("./categoryform.php?w=u&ca_id=$ca_id&$qstr");
|
||||
} else {
|
||||
goto_url("./categorylist.php?$qstr");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ for ($i=0; $i<$post_ca_id_count; $i++)
|
||||
$sql = " select mb_id from {$g5['member_table']} where mb_id = '".sql_real_escape_string($str_ca_mb_id)."' ";
|
||||
$row = sql_fetch($sql);
|
||||
if (!$row['mb_id'])
|
||||
alert("\'{$str_ca_mb_id}\' 은(는) 존재하는 회원아이디가 아닙니다.", "./categorylist.php?$qstr");
|
||||
alert("'{$str_ca_mb_id}' 은(는) 존재하는 회원아이디가 아닙니다.", "./categorylist.php?$qstr");
|
||||
}
|
||||
|
||||
$check_files = array();
|
||||
@@ -51,7 +51,7 @@ for ($i=0; $i<$post_ca_id_count; $i++)
|
||||
alert('스킨파일명에 포함될수 없는 문자가 들어있습니다.');
|
||||
}
|
||||
|
||||
if( ! is_include_path_check($file) ){
|
||||
if( ! is_include_path_check($file, 1) ){
|
||||
alert('오류 : 데이터폴더가 포함된 path 또는 잘못된 path 를 포함할수 없습니다.');
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ for ($i=0; $i<$post_ca_id_count; $i++)
|
||||
}
|
||||
}
|
||||
|
||||
$p_ca_name = is_array($_POST['ca_name']) ? strip_tags(clean_xss_attributes($_POST['ca_name'][$i])) : '';
|
||||
$p_ca_name = is_array($_POST['ca_name']) ? addslashes(strip_tags(clean_xss_attributes(stripslashes($_POST['ca_name'][$i])))) : '';
|
||||
|
||||
$posts = array();
|
||||
|
||||
@@ -94,4 +94,4 @@ for ($i=0; $i<$post_ca_id_count; $i++)
|
||||
|
||||
}
|
||||
|
||||
goto_url("./categorylist.php?$qstr");
|
||||
goto_url("./categorylist.php?$qstr");
|
||||
|
||||
+110
-299
@@ -27,211 +27,19 @@ $pg_anchor = '<ul class="anchor">
|
||||
<li><a href="#anc_scf_sms">SMS설정</a></li>
|
||||
</ul>';
|
||||
|
||||
// 무이자 할부 사용설정 필드 추가
|
||||
if(!isset($default['de_card_noint_use'])) {
|
||||
sql_query(" ALTER TABLE `{$g5['g5_shop_default_table']}`
|
||||
ADD `de_card_noint_use` tinyint(4) NOT NULL DEFAULT '0' AFTER `de_card_use` ", true);
|
||||
}
|
||||
|
||||
// 모바일 관련상품 설정 필드추가
|
||||
if(!isset($default['de_mobile_rel_list_use'])) {
|
||||
sql_query(" ALTER TABLE `{$g5['g5_shop_default_table']}`
|
||||
ADD `de_mobile_rel_list_use` tinyint(4) NOT NULL DEFAULT '0' AFTER `de_rel_img_height`,
|
||||
ADD `de_mobile_rel_list_skin` varchar(255) NOT NULL DEFAULT '' AFTER `de_mobile_rel_list_use`,
|
||||
ADD `de_mobile_rel_img_width` int(11) NOT NULL DEFAULT '0' AFTER `de_mobile_rel_list_skin`,
|
||||
ADD `de_mobile_rel_img_height` int(11) NOT NULL DEFAULT ' 0' AFTER `de_mobile_rel_img_width`", true);
|
||||
}
|
||||
|
||||
// 신규회원 쿠폰 설정 필드 추가
|
||||
if(!isset($default['de_member_reg_coupon_use'])) {
|
||||
sql_query(" ALTER TABLE `{$g5['g5_shop_default_table']}`
|
||||
ADD `de_member_reg_coupon_use` tinyint(4) NOT NULL DEFAULT '0' AFTER `de_tax_flag_use`,
|
||||
ADD `de_member_reg_coupon_term` int(11) NOT NULL DEFAULT '0' AFTER `de_member_reg_coupon_use`,
|
||||
ADD `de_member_reg_coupon_price` int(11) NOT NULL DEFAULT '0' AFTER `de_member_reg_coupon_term` ", true);
|
||||
}
|
||||
|
||||
// 신규회원 쿠폰 주문 최소금액 필드추가
|
||||
if(!isset($default['de_member_reg_coupon_minimum'])) {
|
||||
sql_query(" ALTER TABLE `{$g5['g5_shop_default_table']}`
|
||||
ADD `de_member_reg_coupon_minimum` int(11) NOT NULL DEFAULT '0' AFTER `de_member_reg_coupon_price` ", true);
|
||||
}
|
||||
|
||||
// lg 결제관련 필드 추가
|
||||
if(!isset($default['de_pg_service'])) {
|
||||
sql_query(" ALTER TABLE `{$g5['g5_shop_default_table']}`
|
||||
ADD `de_pg_service` varchar(255) NOT NULL DEFAULT '' AFTER `de_sms_hp` ", true);
|
||||
}
|
||||
|
||||
|
||||
// inicis 필드 추가
|
||||
if(!isset($default['de_inicis_mid'])) {
|
||||
sql_query(" ALTER TABLE `{$g5['g5_shop_default_table']}`
|
||||
ADD `de_inicis_mid` varchar(255) NOT NULL DEFAULT '' AFTER `de_kcp_site_key` ", true);
|
||||
}
|
||||
|
||||
// 모바일 초기화면 이미지 줄 수 필드 추가
|
||||
if(!isset($default['de_mobile_type1_list_row'])) {
|
||||
sql_query(" ALTER TABLE `{$g5['g5_shop_default_table']}`
|
||||
ADD `de_mobile_type1_list_row` int(11) NOT NULL DEFAULT '0' AFTER `de_mobile_type1_list_mod`,
|
||||
ADD `de_mobile_type2_list_row` int(11) NOT NULL DEFAULT '0' AFTER `de_mobile_type2_list_mod`,
|
||||
ADD `de_mobile_type3_list_row` int(11) NOT NULL DEFAULT '0' AFTER `de_mobile_type3_list_mod`,
|
||||
ADD `de_mobile_type4_list_row` int(11) NOT NULL DEFAULT '0' AFTER `de_mobile_type4_list_mod`,
|
||||
ADD `de_mobile_type5_list_row` int(11) NOT NULL DEFAULT '0' AFTER `de_mobile_type5_list_mod` ", true);
|
||||
}
|
||||
|
||||
// 모바일 관련상품 이미지 줄 수 필드 추가
|
||||
if(!isset($default['de_mobile_rel_list_mod'])) {
|
||||
sql_query(" ALTER TABLE `{$g5['g5_shop_default_table']}`
|
||||
ADD `de_mobile_rel_list_mod` int(11) NOT NULL DEFAULT '0' AFTER `de_mobile_rel_list_skin` ", true);
|
||||
}
|
||||
|
||||
// 모바일 검색상품 이미지 줄 수 필드 추가
|
||||
if(!isset($default['de_mobile_search_list_row'])) {
|
||||
sql_query(" ALTER TABLE `{$g5['g5_shop_default_table']}`
|
||||
ADD `de_mobile_search_list_row` int(11) NOT NULL DEFAULT '0' AFTER `de_mobile_search_list_mod` ", true);
|
||||
}
|
||||
|
||||
// PG 간펼결제 사용여부 필드 추가
|
||||
if(!isset($default['de_easy_pay_use'])) {
|
||||
sql_query(" ALTER TABLE `{$g5['g5_shop_default_table']}`
|
||||
ADD `de_easy_pay_use` tinyint(4) NOT NULL DEFAULT '0' AFTER `de_iche_use` ", true);
|
||||
}
|
||||
|
||||
// 이니시스 삼성페이 사용여부 필드 추가
|
||||
if(!isset($default['de_samsung_pay_use'])) {
|
||||
sql_query(" ALTER TABLE `{$g5['g5_shop_default_table']}`
|
||||
ADD `de_samsung_pay_use` tinyint(4) NOT NULL DEFAULT '0' AFTER `de_easy_pay_use` ", true);
|
||||
}
|
||||
|
||||
// 이니시스
|
||||
if(!isset($default['de_inicis_cartpoint_use'])) {
|
||||
sql_query(" ALTER TABLE `{$g5['g5_shop_default_table']}`
|
||||
ADD `de_inicis_cartpoint_use` tinyint(4) NOT NULL DEFAULT '0' AFTER `de_samsung_pay_use` ", true);
|
||||
}
|
||||
|
||||
// 이니시스 lpay 사용여부 필드 추가
|
||||
if(!isset($default['de_inicis_lpay_use'])) {
|
||||
sql_query(" ALTER TABLE `{$g5['g5_shop_default_table']}`
|
||||
ADD `de_inicis_lpay_use` tinyint(4) NOT NULL DEFAULT '0' AFTER `de_samsung_pay_use` ", true);
|
||||
}
|
||||
|
||||
// 이니시스 kakaopay 사용여부 필드 추가
|
||||
if(!isset($default['de_inicis_kakaopay_use'])) {
|
||||
sql_query(" ALTER TABLE `{$g5['g5_shop_default_table']}`
|
||||
ADD `de_inicis_kakaopay_use` tinyint(4) NOT NULL DEFAULT '0' AFTER `de_inicis_lpay_use` ", true);
|
||||
}
|
||||
|
||||
// 카카오페이 필드 추가
|
||||
if(!isset($default['de_kakaopay_mid'])) {
|
||||
sql_query(" ALTER TABLE `{$g5['g5_shop_default_table']}`
|
||||
ADD `de_kakaopay_mid` varchar(255) NOT NULL DEFAULT '' AFTER `de_tax_flag_use`,
|
||||
ADD `de_kakaopay_key` varchar(255) NOT NULL DEFAULT '' AFTER `de_kakaopay_mid`,
|
||||
ADD `de_kakaopay_enckey` varchar(255) NOT NULL DEFAULT '' AFTER `de_kakaopay_key`,
|
||||
ADD `de_kakaopay_hashkey` varchar(255) NOT NULL DEFAULT '' AFTER `de_kakaopay_enckey`,
|
||||
ADD `de_kakaopay_cancelpwd` varchar(255) NOT NULL DEFAULT '' AFTER `de_kakaopay_hashkey` ", true);
|
||||
}
|
||||
|
||||
// 이니시스 웹결제 사인키 필드 추가
|
||||
if(!isset($default['de_inicis_sign_key'])) {
|
||||
sql_query(" ALTER TABLE `{$g5['g5_shop_default_table']}`
|
||||
ADD `de_inicis_sign_key` varchar(255) NOT NULL DEFAULT '' ", true);
|
||||
}
|
||||
|
||||
// 네이버페이 필드추가
|
||||
if(!isset($default['de_naverpay_mid'])) {
|
||||
sql_query(" ALTER TABLE `{$g5['g5_shop_default_table']}`
|
||||
ADD `de_naverpay_mid` varchar(255) NOT NULL DEFAULT '' AFTER `de_kakaopay_cancelpwd`,
|
||||
ADD `de_naverpay_cert_key` varchar(255) NOT NULL DEFAULT '' AFTER `de_naverpay_mid`,
|
||||
ADD `de_naverpay_button_key` varchar(255) NOT NULL DEFAULT '' AFTER `de_naverpay_cert_key`,
|
||||
ADD `de_naverpay_test` tinyint(4) NOT NULL DEFAULT '0' AFTER `de_naverpay_button_key`,
|
||||
ADD `de_naverpay_mb_id` varchar(255) NOT NULL DEFAULT '' AFTER `de_naverpay_test`,
|
||||
ADD `de_naverpay_sendcost` varchar(255) NOT NULL DEFAULT '' AFTER `de_naverpay_mb_id`", true);
|
||||
}
|
||||
|
||||
// 유형별상품리스트 설정필드 추가
|
||||
if(!isset($default['de_listtype_list_skin'])) {
|
||||
sql_query(" ALTER TABLE `{$g5['g5_shop_default_table']}`
|
||||
ADD `de_listtype_list_skin` varchar(255) NOT NULL DEFAULT '' AFTER `de_mobile_search_img_height`,
|
||||
ADD `de_listtype_list_mod` int(11) NOT NULL DEFAULT '0' AFTER `de_listtype_list_skin`,
|
||||
ADD `de_listtype_list_row` int(11) NOT NULL DEFAULT '0' AFTER `de_listtype_list_mod`,
|
||||
ADD `de_listtype_img_width` int(11) NOT NULL DEFAULT '0' AFTER `de_listtype_list_row`,
|
||||
ADD `de_listtype_img_height` int(11) NOT NULL DEFAULT '0' AFTER `de_listtype_img_width`,
|
||||
ADD `de_mobile_listtype_list_skin` varchar(255) NOT NULL DEFAULT '' AFTER `de_listtype_img_height`,
|
||||
ADD `de_mobile_listtype_list_mod` int(11) NOT NULL DEFAULT '0' AFTER `de_mobile_listtype_list_skin`,
|
||||
ADD `de_mobile_listtype_list_row` int(11) NOT NULL DEFAULT '0' AFTER `de_mobile_listtype_list_mod`,
|
||||
ADD `de_mobile_listtype_img_width` int(11) NOT NULL DEFAULT '0' AFTER `de_mobile_listtype_list_row`,
|
||||
ADD `de_mobile_listtype_img_height` int(11) NOT NULL DEFAULT '0' AFTER `de_mobile_listtype_img_width` ", true);
|
||||
}
|
||||
|
||||
// 임시저장 테이블이 없을 경우 생성
|
||||
if(!sql_query(" DESC {$g5['g5_shop_post_log_table']} ", false)) {
|
||||
sql_query(" CREATE TABLE IF NOT EXISTS `{$g5['g5_shop_post_log_table']}` (
|
||||
`log_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`oid` bigint(20) unsigned NOT NULL,
|
||||
`mb_id` varchar(255) NOT NULL DEFAULT '',
|
||||
`post_data` text NOT NULL,
|
||||
`ol_code` varchar(255) NOT NULL DEFAULT '',
|
||||
`ol_msg` text NOT NULL,
|
||||
`ol_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`ol_ip` varchar(25) NOT NULL DEFAULT '',
|
||||
PRIMARY KEY (`log_id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ", false);
|
||||
}
|
||||
|
||||
|
||||
// 현금영수증 발급 조건 추가
|
||||
if(!isset($default['de_taxsave_types'])) {
|
||||
sql_query(" ALTER TABLE `{$g5['g5_shop_default_table']}`
|
||||
ADD `de_taxsave_types` set('account','vbank','transfer') NOT NULL DEFAULT 'account' AFTER `de_taxsave_use` ", true);
|
||||
}
|
||||
|
||||
// 아이코드 토큰키 추가
|
||||
if( ! isset($config['cf_icode_token_key']) ){
|
||||
$sql = "ALTER TABLE `{$g5['config_table']}`
|
||||
ADD COLUMN `cf_icode_token_key` VARCHAR(100) NOT NULL DEFAULT '' AFTER `cf_icode_server_port`; ";
|
||||
sql_query($sql, false);
|
||||
}
|
||||
|
||||
// PG 간편결제 추가 ( NHN_KCP 네이버페이, 카카오페이 )
|
||||
if( ! isset($default['de_easy_pay_services']) ){
|
||||
$sql = "ALTER TABLE `{$g5['g5_shop_default_table']}`
|
||||
ADD COLUMN `de_easy_pay_services` VARCHAR(255) NOT NULL DEFAULT '' AFTER `de_easy_pay_use`; ";
|
||||
sql_query($sql, false);
|
||||
}
|
||||
|
||||
// KG 이니시스 iniapi_key 추가
|
||||
if( ! isset($default['de_inicis_iniapi_key']) ){
|
||||
$sql = "ALTER TABLE `{$g5['g5_shop_default_table']}`
|
||||
ADD COLUMN `de_inicis_iniapi_key` VARCHAR(30) NOT NULL DEFAULT '' AFTER `de_inicis_sign_key`,
|
||||
ADD COLUMN `de_inicis_iniapi_iv` VARCHAR(30) NOT NULL DEFAULT '' AFTER `de_inicis_iniapi_key`; ";
|
||||
sql_query($sql, false);
|
||||
}
|
||||
|
||||
// NICEPAY mid, key 추가
|
||||
if (! isset($default['de_nicepay_mid'])) {
|
||||
$sql = "ALTER TABLE `{$g5['g5_shop_default_table']}`
|
||||
ADD COLUMN `de_nicepay_mid` VARCHAR(20) NOT NULL DEFAULT '' AFTER `de_inicis_cartpoint_use`,
|
||||
ADD COLUMN `de_nicepay_key` VARCHAR(150) NOT NULL DEFAULT '' AFTER `de_nicepay_mid`; ";
|
||||
sql_query($sql, false);
|
||||
}
|
||||
|
||||
// 토스페이먼츠 client, secret key 추가
|
||||
if( ! isset($config['cf_toss_client_key']) ){
|
||||
$sql = "ALTER TABLE `{$g5['config_table']}`
|
||||
ADD COLUMN `cf_toss_client_key` VARCHAR(100) NOT NULL DEFAULT '' AFTER `cf_lg_mert_key`,
|
||||
ADD COLUMN `cf_toss_secret_key` VARCHAR(100) NOT NULL DEFAULT '' AFTER `cf_toss_client_key`; ";
|
||||
sql_query($sql, false);
|
||||
}
|
||||
|
||||
if( function_exists('pg_setting_check') ){
|
||||
pg_setting_check(true);
|
||||
}
|
||||
|
||||
if(!$default['de_kakaopay_cancelpwd']){
|
||||
$default['de_kakaopay_cancelpwd'] = '1111';
|
||||
}
|
||||
?>
|
||||
|
||||
<?php if (!empty($default['de_kakaopay_mid']) || !empty($default['de_kakaopay_enckey'])) { ?>
|
||||
<div class="local_desc01 local_desc">
|
||||
<p>5.6.37부터 SIRK 전용 카카오페이 연동을 지원하지 않습니다. 기존 거래는 이니시스 상점관리자에서 승인·취소 내역을 확인해 주십시오.</p>
|
||||
<p>기존 이용 고객 지원: 김민섭 <a href="mailto:minsup@sir.kr">minsup@sir.kr</a></p>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<form name="fconfig" action="./configformupdate.php" onsubmit="return fconfig_check(this)" method="post" enctype="MULTIPART/FORM-DATA">
|
||||
<input type="hidden" name="token" value="">
|
||||
<section id="anc_scf_info">
|
||||
@@ -694,7 +502,7 @@ if(!$default['de_kakaopay_cancelpwd']){
|
||||
<tr>
|
||||
<th scope="row"><label for="de_easy_pay_use">PG사 간편결제 버튼 사용</label></th>
|
||||
<td>
|
||||
<?php echo help("주문서 작성 페이지에 PG사 간편결제(PAYCO, 토스, KPAY...) 버튼의 별도 사용 여부를 설정합니다.", 50); ?>
|
||||
<?php echo help("주문서에 선택한 PG사의 사용 설정된 간편결제 수단을 개별 표시합니다. 아래 PG별 항목에서 계약된 수단을 선택하세요.", 50); ?>
|
||||
<select id="de_easy_pay_use" name="de_easy_pay_use">
|
||||
<option value="0" <?php echo get_selected($default['de_easy_pay_use'], 0); ?>>노출안함</option>
|
||||
<option value="1" <?php echo get_selected($default['de_easy_pay_use'], 1); ?>>노출함</option>
|
||||
@@ -715,13 +523,13 @@ if(!$default['de_kakaopay_cancelpwd']){
|
||||
<?php
|
||||
$account_checked = $vbank_checked = $transfer_checked = '';
|
||||
|
||||
if (strstr($default['de_taxsave_types'], 'account')) {
|
||||
if (strpos($default['de_taxsave_types'], 'account') !== false) {
|
||||
$account_checked = 'checked="checked"';
|
||||
}
|
||||
if (strstr($default['de_taxsave_types'], 'vbank')) {
|
||||
if (strpos($default['de_taxsave_types'], 'vbank') !== false) {
|
||||
$vbank_checked = 'checked="checked"';
|
||||
}
|
||||
if (strstr($default['de_taxsave_types'], 'transfer')) {
|
||||
if (strpos($default['de_taxsave_types'], 'transfer') !== false) {
|
||||
$transfer_checked = 'checked="checked"';
|
||||
}
|
||||
?>
|
||||
@@ -779,8 +587,8 @@ if(!$default['de_kakaopay_cancelpwd']){
|
||||
<tr>
|
||||
<th scope="row"><label for="de_point_days">주문완료 포인트</label></th>
|
||||
<td>
|
||||
<?php echo help("주문자가 회원일 경우에만 주문완료시 포인트를 지급합니다. 주문취소, 반품 등을 고려하여 포인트를 지급할 적당한 기간을 입력하십시오. (기본값은 7일)\n0일로 설정하는 경우에는 주문완료와 동시에 포인트를 지급합니다."); ?>
|
||||
주문 완료 <input type="text" name="de_point_days" value="<?php echo get_sanitize_input($default['de_point_days']); ?>" id="de_point_days" class="frm_input" size="2"> 일 이후에 포인트를 지급
|
||||
<?php echo help("주문자가 회원일 경우에만 상품별 배송완료 시각부터 설정한 기간이 지난 후 포인트를 지급합니다. 주문취소, 반품 등을 고려하여 포인트를 지급할 적당한 기간을 입력하십시오. (기본값은 7일)\n0일로 설정하면 배송완료 처리 시 지급합니다. 그 외에는 기간 경과 후 관리자 주문 상세 조회 또는 완료 처리 시 지급합니다."); ?>
|
||||
배송 완료 <input type="text" name="de_point_days" value="<?php echo get_sanitize_input($default['de_point_days']); ?>" id="de_point_days" class="frm_input" size="2"> 일 이후에 포인트를 지급
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -818,16 +626,16 @@ if(!$default['de_kakaopay_cancelpwd']){
|
||||
<th scope="row"><label for="de_kcp_easy_pays">NHN KCP 간편결제</label></th>
|
||||
<td>
|
||||
<?php echo help("체크시 NHN KCP 간편결제들을 활성화 합니다.\nNHN_KCP > 네이버페이, 카카오페이는 테스트결제가 되지 않습니다.\n애플페이는 IOS 기기에 모바일결제만 가능합니다."); ?>
|
||||
<input type="checkbox" id="de_easy_nhnkcp_payco" name="de_easy_pays[]" value="nhnkcp_payco" <?php if(stripos($default['de_easy_pay_services'], 'nhnkcp_payco') !== false){ echo 'checked="checked"'; } ?> > <label for="de_easy_nhnkcp_payco" disabled>PAYCO (페이코)</label><br>
|
||||
<input type="checkbox" id="de_easy_nhnkcp_naverpay" name="de_easy_pays[]" value="nhnkcp_naverpay" <?php if(stripos($default['de_easy_pay_services'], 'nhnkcp_naverpay') !== false){ echo 'checked="checked"'; } ?> > <label for="de_easy_nhnkcp_naverpay">NAVERPAY (네이버페이)</label><br>
|
||||
<input type="checkbox" id="de_easy_nhnkcp_kakaopay" name="de_easy_pays[]" value="nhnkcp_kakaopay" <?php if(stripos($default['de_easy_pay_services'], 'nhnkcp_kakaopay') !== false){ echo 'checked="checked"'; } ?> > <label for="de_easy_nhnkcp_kakaopay">KAKAOPAY (카카오페이)</label><br>
|
||||
<input type="checkbox" id="de_easy_nhnkcp_applepay" name="de_easy_pays[]" value="nhnkcp_applepay" <?php if(stripos($default['de_easy_pay_services'], 'nhnkcp_applepay') !== false){ echo 'checked="checked"'; } ?> > <label for="de_easy_nhnkcp_applepay">APPLEPAY (애플페이)</label>
|
||||
<?php foreach (shop_easypay_catalog('kcp') as $easy_key => $easy_provider) { ?>
|
||||
<input type="checkbox" name="de_easy_pays[]" id="de_easy_<?php echo $easy_key; ?>" value="<?php echo $easy_key; ?>"<?php echo in_array($easy_key, explode(',', $default['de_easy_pay_services']), true) ? ' checked' : ''; ?>>
|
||||
<label for="de_easy_<?php echo $easy_key; ?>"><?php echo $easy_provider[0]; ?></label><br>
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="pg_info_fld kcp_info_fld">
|
||||
<th scope="row"><label for="de_global_nhnkcp_naverpay">NHN KCP 네이버페이 사용</label></th>
|
||||
<td>
|
||||
<?php echo help("체크시 타 PG (토스페이먼츠, KG 이니시스) 사용중일때도 NHN_KCP 를 통한 네이버페이 간편결제를 사용할수 있습니다.\n실결제시 반드시 결제대행사 NHN_KCP 항목에 KCP SITE CODE와 NHN KCP SITE KEY를 입력해야 합니다."); ?>
|
||||
<?php echo help("선택한 PG에서 네이버페이를 지원하지 않거나 사용 설정하지 않은 경우에만 NHN KCP 네이버페이를 보조 결제로 제공합니다. 기본 PG의 네이버페이가 활성화되어 있으면 병용 버튼과 요청 경로를 사용하지 않습니다. 기존 KCP 주문의 조회·취소는 유지됩니다.\n실결제시 반드시 결제대행사 NHN_KCP 항목에 KCP SITE CODE와 NHN KCP SITE KEY를 입력해야 합니다."); ?>
|
||||
<input type="checkbox" id="de_global_nhnkcp_naverpay" name="de_easy_pays[]" value="global_nhnkcp_naverpay" <?php if(stripos($default['de_easy_pay_services'], 'global_nhnkcp_naverpay') !== false){ echo 'checked="checked"'; } ?> > <label for="de_global_nhnkcp_naverpay">NAVERPAY (네이버페이)</label><br>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -851,7 +659,7 @@ if(!$default['de_kakaopay_cancelpwd']){
|
||||
<tr class="pg_info_fld lg_info_fld">
|
||||
<th scope="row"><label for="cf_lg_mert_key">토스페이먼츠(구버전) MERT KEY</label></th>
|
||||
<td>
|
||||
<?php echo help("토스페이먼츠(구버전) 상점 MertKey는 상점관리자 -> 개발자센터 -> API키 -> 머트 키에서 확인하실 수 있습니다.\n예) 95160cce09854ef44d2edb2bfb05f9f3"); ?>
|
||||
<?php echo help("토스페이먼츠(구버전) 상점 MertKey는 상점관리자 -> 개발자센터 -> API키 -> 머트 키에서 확인하실 수 있습니다. 예) 95160cce09854ef44d2edb2bfb05f9f3\n실결제용 [라이브] 키와 테스트용 [테스트] 키는 서로 다르므로, <b>테스트로 결제시에는 [테스트] 키</b>로 변경하여 사용해주시기 바랍니다."); ?>
|
||||
<input type="text" name="cf_lg_mert_key" value="<?php echo get_sanitize_input($config['cf_lg_mert_key']); ?>" id="cf_lg_mert_key" class="frm_input " size="36" maxlength="50">
|
||||
</td>
|
||||
</tr>
|
||||
@@ -879,104 +687,87 @@ 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">
|
||||
<label for="de_samsung_pay_use">KG이니시스 삼성페이 사용</label>
|
||||
<a href="http://sir.kr/main/service/samsungpay.php" target="_blank" class="kg_btn">삼성페이 서비스신청하기</a>
|
||||
</th>
|
||||
<th scope="row">KG이니시스 PRO 운영 감시</th>
|
||||
<td>
|
||||
<?php echo help("KG이니시스와 별도로 <strong>삼성페이 사용 계약을 하신 경우</strong>에만 체크해주세요. (모바일 주문서 결제수단에 삼성페이가 노출됩니다.) <br >실결제시 반드시 결제대행사 KG이니시스 항목에 상점 아이디와 웹결제 사인키를 입력해 주세요.", 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>
|
||||
<?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>
|
||||
|
||||
<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_lpay_use">KG이니시스 L.pay 사용</label>
|
||||
</th>
|
||||
<th scope="row"><label for="de_inicis_pro_log_days">PRO 상세 이력 보존기간</label></th>
|
||||
<td>
|
||||
<?php echo help("체크시 KG이니시스 L.pay를 사용합니다. <br >실결제시 반드시 결제대행사 KG이니시스 항목의 상점 정보( 아이디, 웹결제 사인키 )를 입력해 주세요.", 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>
|
||||
<?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_kakaopay_use">KG이니시스 카카오페이 사용</label>
|
||||
</th>
|
||||
<th scope="row"><label for="de_inicis_pro_summary_days">PRO 결제 요약 보존기간</label></th>
|
||||
<td>
|
||||
<?php echo help("체크시 KG이니시스 결제의 카카오페이를 사용합니다. 주문서 결제수단에 카카오페이가 노출됩니다. <br>실결제시 반드시 결제대행사 KG이니시스 항목의 상점 정보( 아이디, 웹결제 사인키 )를 입력해 주세요.", 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>
|
||||
<?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>
|
||||
<?php foreach (array('inicis' => 'KG이니시스', 'toss' => '토스페이먼츠 API') as $easy_pg => $easy_title) { ?>
|
||||
<tr class="pg_info_fld <?php echo $easy_pg; ?>_info_fld">
|
||||
<th scope="row"><?php echo $easy_title; ?> 간편결제</th>
|
||||
<td>
|
||||
<?php echo help("PG사 간편결제 버튼 사용을 '노출함'으로 설정하고, 해당 PG와 계약하여 사용할 수 있는 수단만 선택하세요. 계약 상태는 PG사에 확인해야 하며 이 화면에서 자동 조회하지 않습니다. 자체창 호출에 별도 계약이 필요할 수 있고 일부 수단은 테스트 결제를 지원하지 않습니다. 실제 MID에서 승인·취소를 확인한 후 제공하세요.\n애플페이는 iOS 모바일에서만 표시합니다. 삼성페이는 PC에서 휴대폰으로 연결하며 구 INIpay에서는 모바일에서만 표시합니다.\nKG이니시스는 삼성페이·L.pay·카카오페이를 지원하며 INIpay PRO는 HashKey, 구버전은 웹결제 사인키가 필요합니다."); ?>
|
||||
<?php foreach (shop_easypay_catalog($easy_pg) as $easy_key => $easy_provider) { ?>
|
||||
<input type="checkbox" name="de_easy_pays[]" id="de_easy_<?php echo $easy_key; ?>" value="<?php echo $easy_key; ?>"<?php echo in_array($easy_key, explode(',', $default['de_easy_pay_services']), true) ? ' checked' : ''; ?>>
|
||||
<label for="de_easy_<?php echo $easy_key; ?>"><?php echo $easy_provider[0]; ?></label><br>
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<tr class="pg_info_fld inicis_info_fld">
|
||||
<th scope="row">
|
||||
<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>
|
||||
<tr class="kakao_info_fld">
|
||||
<th scope="row">
|
||||
<label for="de_kakaopay_mid">카카오페이 상점아이디<br>( KG이니시스 )</label>
|
||||
<a href="http://sir.kr/main/service/kakaopay.php?kk=yc5" target="_blank" class="kakao_btn">카카오페이 서비스신청하기</a>
|
||||
</th>
|
||||
<td>
|
||||
<?php echo help("KG이니시스로 부터 카카오페이 간편결제만 사용용도로 발급 받으신 상점아이디(MID) 10자리 중 SIRK 을 제외한 나머지 6자리를 입력 합니다."); ?>
|
||||
<span class="sitecode">SIRK</span> <input type="text" name="de_kakaopay_mid" value="<?php echo get_sanitize_input($default['de_kakaopay_mid']); ?>" id="de_kakaopay_mid" class="frm_input code_input" size="10" maxlength="7">
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="kakao_info_fld">
|
||||
<th scope="row"><label for="de_kakaopay_key">카카오페이 상점키<br>( KG이니시스 )</label></th>
|
||||
<td>
|
||||
<?php echo help("SIRK****** 아이디로 KG이니시스에서 발급받은 웹결제 사인키를 입력합니다.\nKG이니시스 상점관리자 > 상점정보 > 계약정보 > 부가정보의 웹결제 signkey생성 조회 버튼 클릭, 팝업창에서 생성 버튼 클릭 후 해당 값을 입력합니다."); ?>
|
||||
<input type="text" name="de_kakaopay_key" value="<?php echo get_sanitize_input($default['de_kakaopay_key']); ?>" id="de_kakaopay_key" class="frm_input" size="100">
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="kakao_info_fld">
|
||||
<th scope="row"><label for="de_kakaopay_cancelpwd">카카오페이 키패스워드<br>( KG이니시스 )</label></th>
|
||||
<td>
|
||||
<?php echo help("SIRK****** 아이디로 KG이니시스에서 발급받은 4자리 상점 키패스워드를 입력합니다.\nKG이니시스 상점관리자 패스워드와 관련이 없습니다.\n키패스워드 값을 확인하시려면 상점측에 발급된 키파일 안의 readme.txt 파일을 참조해 주십시오"); ?>
|
||||
<input type="text" name="de_kakaopay_cancelpwd" value="<?php echo get_sanitize_input($default['de_kakaopay_cancelpwd']); ?>" id="de_kakaopay_cancelpwd" class="frm_input" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="kakao_info_fld">
|
||||
<th scope="row">
|
||||
<label for="de_kakaopay_enckey">KG이니시스<br>카카오페이 사용</label>
|
||||
</th>
|
||||
<td>
|
||||
<?php echo help("체크시 카카오페이 (KG 이니시스)를 사용합니다. <br >KG 이니시스의 SIRK****** 아이디를 받은 상점만 해당됩니다.", 50); ?>
|
||||
<input type="checkbox" name="de_kakaopay_enckey" value="1" id="de_kakaopay_enckey"<?php echo $default['de_kakaopay_enckey']?' checked':''; ?>> <label for="de_kakaopay_enckey">사용</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="kakao_info_fld" style="display:none">
|
||||
<th scope="row"><label for="de_kakaopay_hashkey">카카오페이 상점 HashKey</label></th>
|
||||
<td>
|
||||
<?php echo help("카카오페이로 부터 발급 받으신 상점 인증 전용 HashKey를 입력합니다."); ?>
|
||||
<input type="text" name="de_kakaopay_hashkey" value="<?php echo get_sanitize_input($default['de_kakaopay_hashkey']); ?>" id="de_kakaopay_hashkey" class="frm_input" size="20">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="pg_info_fld nicepay_info_fld" id="nicepay_info_anchor">
|
||||
<th scope="row"><label for="de_nicepay_mid">NICEPAY MID</label><br><a href="http://sir.kr/main/service/nicepayments_pg.php" target="_blank" id="scf_nicepay_reg" class="nicepay_btn">NICEPAY 신청하기</a></th>
|
||||
@@ -998,14 +789,10 @@ if(!$default['de_kakaopay_cancelpwd']){
|
||||
<th scope="row"><label for="de_nicepay_easy_pays">NICEPAY 간편결제</label></th>
|
||||
<td>
|
||||
<?php echo help("체크시 NICEPAY 간편결제들을 활성화 합니다.\nNICEPAY > 간편결제는 테스트결제가 되지 않습니다. 실결제에만 정상작동 합니다.\n애플페이는 IOS 기기에 모바일결제만 가능합니다."); ?>
|
||||
<input type="checkbox" id="de_easy_nicepay_samsungpay" name="de_easy_pays[]" value="nicepay_samsungpay" <?php if(stripos($default['de_easy_pay_services'], 'nicepay_samsungpay') !== false){ echo 'checked="checked"'; } ?> > <label for="de_easy_nicepay_samsungpay" disabled>삼성페이</label><br>
|
||||
<input type="checkbox" id="de_easy_nicepay_naverpay" name="de_easy_pays[]" value="nicepay_naverpay" <?php if(stripos($default['de_easy_pay_services'], 'nicepay_naverpay') !== false){ echo 'checked="checked"'; } ?> > <label for="de_easy_nicepay_naverpay">NAVERPAY (네이버페이)</label><br>
|
||||
<input type="checkbox" id="de_easy_nicepay_kakaopay" name="de_easy_pays[]" value="nicepay_kakaopay" <?php if(stripos($default['de_easy_pay_services'], 'nicepay_kakaopay') !== false){ echo 'checked="checked"'; } ?> > <label for="de_easy_nicepay_kakaopay">KAKAOPAY (카카오페이)</label><br>
|
||||
<input type="checkbox" id="de_easy_nicepay_applepay" name="de_easy_pays[]" value="nicepay_applepay" <?php if(stripos($default['de_easy_pay_services'], 'nicepay_applepay') !== false){ echo 'checked="checked"'; } ?> > <label for="de_easy_nicepay_applepay">APPLEPAY (애플페이)</label><br>
|
||||
<input type="checkbox" id="de_easy_nicepay_paycopay" name="de_easy_pays[]" value="nicepay_paycopay" <?php if(stripos($default['de_easy_pay_services'], 'nicepay_paycopay') !== false){ echo 'checked="checked"'; } ?> > <label for="de_easy_nicepay_paycopay">페이코</label><br>
|
||||
<input type="checkbox" id="de_easy_nicepay_skpay" name="de_easy_pays[]" value="nicepay_skpay" <?php if(stripos($default['de_easy_pay_services'], 'nicepay_skpay') !== false){ echo 'checked="checked"'; } ?> > <label for="de_easy_nicepay_skpay">SK페이</label><br>
|
||||
<input type="checkbox" id="de_easy_nicepay_ssgpay" name="de_easy_pays[]" value="nicepay_ssgpay" <?php if(stripos($default['de_easy_pay_services'], 'nicepay_ssgpay') !== false){ echo 'checked="checked"'; } ?> > <label for="de_easy_nicepay_ssgpay">SSG페이</label><br>
|
||||
<input type="checkbox" id="de_easy_nicepay_lpay" name="de_easy_pays[]" value="nicepay_lpay" <?php if(stripos($default['de_easy_pay_services'], 'nicepay_lpay') !== false){ echo 'checked="checked"'; } ?> > <label for="de_easy_nicepay_lpay">LPAY</label>
|
||||
<?php foreach (shop_easypay_catalog('nicepay') as $easy_key => $easy_provider) { ?>
|
||||
<input type="checkbox" name="de_easy_pays[]" id="de_easy_<?php echo $easy_key; ?>" value="<?php echo $easy_key; ?>"<?php echo in_array($easy_key, explode(',', $default['de_easy_pay_services']), true) ? ' checked' : ''; ?>>
|
||||
<label for="de_easy_<?php echo $easy_key; ?>"><?php echo $easy_provider[0]; ?></label><br>
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -1789,6 +1576,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,13 +1605,36 @@ 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";
|
||||
}
|
||||
} else if ( f.de_pg_service.value == "lg" ) {
|
||||
if( f.cf_lg_mid.value && f.cf_lg_mert_key.value && parseInt(f.de_card_test.value) > 0 ){
|
||||
pg_msg = "토스페이먼츠(구버전)";
|
||||
msg += "(주의!) 토스페이먼츠(구버전) 결제의 결제 설정이 현재 테스트결제로 되어 있습니다.\nMERT KEY를 [테스트]키로 설정한 후 테스트결제를 진행해주세요.\n쇼핑몰 운영중이면 반드시 실결제 전환 및 [라이브]키로 설정하여 운영하셔야 합니다.\n실결제로 변경하려면 결제설정 탭 -> 결제 테스트에서 실결제를 선택해 주세요.\n정말로 테스트결제로 설정하시겠습니까?";
|
||||
}
|
||||
} else if ( f.de_pg_service.value == "toss" ) {
|
||||
if( f.cf_lg_mid.value && f.cf_toss_client_key.value && f.cf_toss_secret_key.value && parseInt(f.de_card_test.value) > 0 ){
|
||||
@@ -2119,26 +1949,7 @@ if($default['de_iche_use'] || $default['de_vbank_use'] || $default['de_hp_use']
|
||||
}
|
||||
}
|
||||
|
||||
// 카카오페이의 경우 log 디렉토리 체크
|
||||
if($default['de_kakaopay_mid'] && $default['de_kakaopay_key'] && $default['de_kakaopay_enckey'] && $default['de_kakaopay_hashkey'] && $default['de_kakaopay_cancelpwd']) {
|
||||
$log_path = G5_SHOP_PATH.'/kakaopay/log';
|
||||
|
||||
if(!is_dir($log_path)) {
|
||||
echo '<script>'.PHP_EOL;
|
||||
echo 'alert("'.str_replace(G5_PATH.'/', '', G5_SHOP_PATH).'/kakaopay 폴더 안에 log 폴더를 생성하신 후 쓰기권한을 부여해 주십시오.\n> mkdir log\n> chmod 707 log");'.PHP_EOL;
|
||||
echo '</script>'.PHP_EOL;
|
||||
} else {
|
||||
if(!is_writable($log_path)) {
|
||||
echo '<script>'.PHP_EOL;
|
||||
echo 'alert("'.str_replace(G5_PATH.'/', '',$log_path).' 폴더에 쓰기권한을 부여해 주십시오.\n> chmod 707 log");'.PHP_EOL;
|
||||
echo '</script>'.PHP_EOL;
|
||||
} else {
|
||||
if( function_exists('check_log_folder') && is_writable($log_path) ){
|
||||
check_log_folder($log_path);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -15,6 +15,16 @@ if(! (isset($_POST['de_admin_company_tel']) && check_vaild_callback($_POST['de_a
|
||||
// 로그인을 바로 이 주소로 하는 경우 쇼핑몰설정값이 사라지는 현상을 방지
|
||||
if (!$_POST['de_admin_company_owner']) goto_url("./configform.php");
|
||||
|
||||
$logo_img_fields = array('logo_img', 'logo_img2', 'mobile_logo_img', 'mobile_logo_img2');
|
||||
foreach ($logo_img_fields as $logo_img_field) {
|
||||
if (isset($_FILES[$logo_img_field]['name']) && $_FILES[$logo_img_field]['name']) {
|
||||
$filename = get_safe_filename($_FILES[$logo_img_field]['name']);
|
||||
if (is_disallowed_active_filename($filename)) {
|
||||
alert('허용되지 않는 파일 확장자입니다.');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (! empty($_POST['logo_img_del'])) @unlink(G5_DATA_PATH."/common/logo_img");
|
||||
if (! empty($_POST['logo_img_del2'])) @unlink(G5_DATA_PATH."/common/logo_img2");
|
||||
if (! empty($_POST['mobile_logo_img_del'])) @unlink(G5_DATA_PATH."/common/mobile_logo_img");
|
||||
@@ -78,15 +88,16 @@ if(isset($_POST['de_taxsave_types_transfer']) && $_POST['de_taxsave_types_transf
|
||||
$de_taxsave_types .= ',transfer';
|
||||
}
|
||||
|
||||
// NHN_KCP 간편결제 체크
|
||||
$de_easy_pay_services = '';
|
||||
if(isset($_POST['de_easy_pays'])){
|
||||
$tmps = array();
|
||||
foreach( (array) $_POST['de_easy_pays'] as $v ){
|
||||
$tmps[] = preg_replace('/[^0-9a-z_\-]/i', '', $v);
|
||||
}
|
||||
$de_easy_pay_services = implode(",", $tmps);
|
||||
// 알려진 PG별 간편결제 설정만 저장한다. 선택 해제도 명시적으로 보존한다.
|
||||
$easy_allowed = array('global_nhnkcp_naverpay', 'used_nhnkcp_naverpay_point');
|
||||
foreach (array('kcp', 'inicis', 'toss', 'nicepay') as $easy_pg) {
|
||||
$easy_allowed = array_merge($easy_allowed, array_keys(shop_easypay_catalog($easy_pg)));
|
||||
}
|
||||
$easy_selected = array();
|
||||
foreach (isset($_POST['de_easy_pays']) ? (array) $_POST['de_easy_pays'] : array() as $easy_key) {
|
||||
if (is_string($easy_key) && in_array($easy_key, $easy_allowed, true)) $easy_selected[] = $easy_key;
|
||||
}
|
||||
$de_easy_pay_services = implode(',', array_unique(array_merge($easy_selected, array('inicis_configured', 'toss_configured'))));
|
||||
|
||||
//KVE-2019-0689, KVE-2019-0691, KVE-2019-0694
|
||||
$check_sanitize_keys = array(
|
||||
@@ -167,17 +178,18 @@ $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이니시스 카카오페이 사용
|
||||
'de_inicis_cartpoint_use', //KG이니시스 신용카드 포인트 결제
|
||||
'de_nicepay_mid', //NICEPAY 상점아이디
|
||||
'de_nicepay_key', //NICEPAY 상점키
|
||||
'de_kakaopay_mid', //카카오페이 상점MID
|
||||
'de_kakaopay_key', //카카오페이 상점키
|
||||
'de_kakaopay_enckey', //카카오페이 상점 EncKey
|
||||
'de_kakaopay_hashkey', //카카오페이 상점 HashKey
|
||||
'de_kakaopay_cancelpwd', //카카오페이 결제취소 비밀번호
|
||||
'de_naverpay_mid', //네이버페이 가맹점 아이디
|
||||
'de_naverpay_cert_key', //네이버페이 가맹점 인증키
|
||||
'de_naverpay_button_key', //네이버페이 버튼 인증키
|
||||
@@ -247,12 +259,40 @@ $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)) : '';
|
||||
}
|
||||
}
|
||||
|
||||
// 구버전 결제 코드 및 기존 스킨과의 호환을 위해 개별 컬럼도 동기화한다.
|
||||
foreach (shop_easypay_legacy_keys() as $easy_key => $legacy_key) {
|
||||
$$legacy_key = (int) in_array($easy_key, $easy_selected, true);
|
||||
}
|
||||
|
||||
$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 입력체크
|
||||
@@ -261,11 +301,6 @@ if($de_pg_service == 'kcp' && ! $de_card_test && ($de_iche_use || $de_vbank_use
|
||||
alert('NHN KCP SITE KEY를 입력해 주십시오.');
|
||||
}
|
||||
|
||||
if( $de_kakaopay_enckey && ($de_pg_service === 'inicis' || $de_inicis_lpay_use || $de_inicis_kakaopay_use) ){
|
||||
|
||||
$warning_msg = 'KG 이니시스 결제 또는 L.pay 또는 KG이니시스 카카오페이를 사용시 결제모듈 중복문제로 카카오페이를 활성화 할수 없습니다. \\n\\n카카오페이 사용을 비활성화 합니다.';
|
||||
$de_kakaopay_enckey = '';
|
||||
}
|
||||
|
||||
//
|
||||
// 영카트 default
|
||||
@@ -411,6 +446,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']}',
|
||||
@@ -436,11 +477,6 @@ $sql = " update {$g5['g5_shop_default_table']}
|
||||
de_hp_use = '{$de_hp_use}',
|
||||
de_escrow_use = '{$de_escrow_use}',
|
||||
de_tax_flag_use = '{$de_tax_flag_use}',
|
||||
de_kakaopay_mid = '{$de_kakaopay_mid}',
|
||||
de_kakaopay_key = '{$de_kakaopay_key}',
|
||||
de_kakaopay_enckey = '{$de_kakaopay_enckey}',
|
||||
de_kakaopay_hashkey = '{$de_kakaopay_hashkey}',
|
||||
de_kakaopay_cancelpwd = '{$de_kakaopay_cancelpwd}',
|
||||
de_member_reg_coupon_use = '{$de_member_reg_coupon_use}',
|
||||
de_member_reg_coupon_term = '{$de_member_reg_coupon_term}',
|
||||
de_member_reg_coupon_price = '{$de_member_reg_coupon_price}',
|
||||
@@ -480,4 +516,4 @@ if( $warning_msg ){
|
||||
alert($warning_msg, "./configform.php");
|
||||
} else {
|
||||
goto_url("./configform.php");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -6,6 +6,8 @@ auth_check_menu($auth, $sub_menu, "w");
|
||||
|
||||
check_admin_token();
|
||||
|
||||
$cp_id = isset($_REQUEST['cp_id']) ? safe_replace_regex($_REQUEST['cp_id'], 'cp_id') : '';
|
||||
|
||||
$_POST = array_map('trim', $_POST);
|
||||
|
||||
$check_sanitize_keys = array(
|
||||
@@ -25,7 +27,7 @@ $check_sanitize_keys = array(
|
||||
);
|
||||
|
||||
foreach( $check_sanitize_keys as $key ){
|
||||
$$key = $_POST[$key] = isset($_POST[$key]) ? strip_tags(clean_xss_attributes($_POST[$key])) : '';
|
||||
$$key = $_POST[$key] = isset($_POST[$key]) ? addslashes(strip_tags(clean_xss_attributes(stripslashes($_POST[$key])))) : '';
|
||||
}
|
||||
|
||||
if(!$_POST['cp_subject'])
|
||||
@@ -264,4 +266,4 @@ if ($w == '' && (isset($_POST['cp_sms_send']) || isset($_POST['cp_email_send']))
|
||||
}
|
||||
}
|
||||
|
||||
goto_url('./couponlist.php');
|
||||
goto_url('./couponlist.php');
|
||||
|
||||
@@ -4,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'=>'',
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
if (!defined('_GNUBOARD_')) exit;
|
||||
|
||||
// 날짜 없는 최초 조회와 잘못된 날짜 조회를 구분한다. 오류는 false로 반환한다.
|
||||
function shop_admin_date_range($params, $default_to = '')
|
||||
{
|
||||
if (!array_key_exists('fr_date', $params) && !array_key_exists('to_date', $params)) {
|
||||
return array('', $default_to);
|
||||
}
|
||||
|
||||
foreach (array('fr_date', 'to_date') as $key) {
|
||||
if (!isset($params[$key]) || !is_string($params[$key]) || !preg_match('/\A[0-9]{8}\z/', $params[$key])) {
|
||||
return false;
|
||||
}
|
||||
$date = $params[$key];
|
||||
if (!checkdate((int) substr($date, 4, 2), (int) substr($date, 6, 2), (int) substr($date, 0, 4))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if ($params['fr_date'] > $params['to_date']) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return array($params['fr_date'], $params['to_date']);
|
||||
}
|
||||
@@ -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 및 금액이 일치합니다.';
|
||||
}
|
||||
}
|
||||
@@ -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');
|
||||
@@ -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, '', '&');
|
||||
// 상세보기 링크는 목록으로 돌아올 때 현재 페이지까지 유지하도록 page를 포함한다.
|
||||
$view_query_string = $query_string.'&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']); ?>&<?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']); ?>&<?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&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.'&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');
|
||||
@@ -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, '', '&') : '');
|
||||
|
||||
$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&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');
|
||||
@@ -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');
|
||||
|
||||
@@ -30,6 +30,11 @@ if($w == 'd') {
|
||||
|
||||
// 주문정보
|
||||
$data = unserialize(base64_decode($od['dt_data']));
|
||||
if (isset($data['od_settle_case']) && $data['od_settle_case'] === 'KAKAOPAY') {
|
||||
alert('SIRK 전용 카카오페이 미완료 주문은 결제 상태를 이니시스에서 확인한 뒤 사후지원 담당자에게 문의해 주십시오.');
|
||||
}
|
||||
$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 +58,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 +118,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 +154,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);
|
||||
@@ -208,8 +213,6 @@ if($default['de_tax_flag_use']) {
|
||||
}
|
||||
|
||||
$od_pg = $default['de_pg_service'];
|
||||
if($data['od_settle_case'] == 'KAKAOPAY')
|
||||
$od_pg = 'KAKAOPAY';
|
||||
|
||||
$od_email = get_email_address($data['od_email']);
|
||||
$od_name = addslashes(clean_xss_tags($data['od_name']));
|
||||
@@ -221,7 +224,7 @@ $od_zip2 = substr($od_zip, 3);
|
||||
$od_addr1 = addslashes(clean_xss_tags($data['od_addr1']));
|
||||
$od_addr2 = addslashes(clean_xss_tags($data['od_addr2']));
|
||||
$od_addr3 = addslashes(clean_xss_tags($data['od_addr3']));
|
||||
$od_addr_jibeon = preg_match("/^(N|R)$/", $data['od_addr_jibeon']) ? $data['od_addr_jibeon'] : '';
|
||||
$od_addr_jibeon = preg_match("/^(N|R|J)$/", $data['od_addr_jibeon']) ? $data['od_addr_jibeon'] : '';
|
||||
$od_b_name = addslashes(clean_xss_tags($data['od_b_name']));
|
||||
$od_b_tel = addslashes(clean_xss_tags($data['od_b_tel']));
|
||||
$od_b_hp = addslashes(clean_xss_tags($data['od_b_hp']));
|
||||
@@ -231,7 +234,7 @@ $od_b_zip2 = substr($od_b_zip, 3);
|
||||
$od_b_addr1 = addslashes(clean_xss_tags($data['od_b_addr1']));
|
||||
$od_b_addr2 = addslashes(clean_xss_tags($data['od_b_addr2']));
|
||||
$od_b_addr3 = addslashes(clean_xss_tags($data['od_b_addr3']));
|
||||
$od_b_addr_jibeon = preg_match("/^(N|R)$/", $data['od_b_addr_jibeon']) ? $data['od_b_addr_jibeon'] : '';
|
||||
$od_b_addr_jibeon = preg_match("/^(N|R|J)$/", $data['od_b_addr_jibeon']) ? $data['od_b_addr_jibeon'] : '';
|
||||
$od_memo = addslashes(clean_xss_tags($data['od_memo'], 0, 1, 0, 0));
|
||||
$od_deposit_name = addslashes(clean_xss_tags($data['od_deposit_name']));
|
||||
$od_tax_flag = $default['de_tax_flag_use'];
|
||||
@@ -240,10 +243,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 +301,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 +327,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 +352,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 +362,9 @@ if($od['mb_id']) {
|
||||
sql_query($sql);
|
||||
}
|
||||
|
||||
if(isset($data['sc_cp_id']) && $data['sc_cp_id']) {
|
||||
if($data_sc_cp_id) {
|
||||
$sql = " insert into {$g5['g5_shop_coupon_log_table']}
|
||||
set cp_id = '{$data['sc_cp_id']}',
|
||||
set cp_id = '$data_sc_cp_id',
|
||||
mb_id = '{$od['mb_id']}',
|
||||
od_id = '$od_id',
|
||||
cp_price = '$tot_sc_cp_price',
|
||||
@@ -384,10 +390,16 @@ sql_query($sql);
|
||||
$sql = " delete from {$g5['g5_shop_order_data_table']} where od_id = '$od_id' and dt_pg = '$od_pg' ";
|
||||
sql_query($sql, true);
|
||||
|
||||
$orderform_url = './orderform.php?od_id='.$od_id;
|
||||
$inorderlist_url = './inorderlist.php?'.str_replace('&', '&', $qstr);
|
||||
$js_replace = array('\\' => '\\\\', '"' => '\\"', "'" => '\\u0027', '/' => '\\/', "\r" => '\\r', "\n" => '\\n', "\t" => '\\t', '<' => '\\u003C', '>' => '\\u003E', '&' => '\\u0026', "\xE2\x80\xA8" => '\\u2028', "\xE2\x80\xA9" => '\\u2029');
|
||||
$js_orderform_url = function_exists('get_js_safe_string') ? get_js_safe_string($orderform_url) : '"'.strtr((string)$orderform_url, $js_replace).'"';
|
||||
$js_inorderlist_url = function_exists('get_js_safe_string') ? get_js_safe_string($inorderlist_url) : '"'.strtr((string)$inorderlist_url, $js_replace).'"';
|
||||
|
||||
echo '<meta http-equiv="content-type" content="text/html; charset=utf-8">'.PHP_EOL;
|
||||
echo '<script>'.PHP_EOL;
|
||||
echo 'if(confirm("복구하신 주문 상세페이지로 이동하시겠습니까?"))'.PHP_EOL;
|
||||
echo 'document.location.href = "./orderform.php?od_id='.$od_id.'";'.PHP_EOL;
|
||||
echo 'document.location.href = '.$js_orderform_url.';'.PHP_EOL;
|
||||
echo 'else'.PHP_EOL;
|
||||
echo 'document.location.href = "./inorderlist.php?'.str_replace('&', '&', $qstr).'";'.PHP_EOL;
|
||||
echo '</script>'.PHP_EOL;
|
||||
echo 'document.location.href = '.$js_inorderlist_url.';'.PHP_EOL;
|
||||
echo '</script>'.PHP_EOL;
|
||||
|
||||
@@ -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
|
||||
@@ -104,6 +112,12 @@ $colspan = 10;
|
||||
case 'lg':
|
||||
$pg = 'LGU+';
|
||||
break;
|
||||
case 'toss':
|
||||
$pg = '토스페이먼츠';
|
||||
break;
|
||||
case 'nicepay':
|
||||
$pg = 'NICEPAY';
|
||||
break;
|
||||
default:
|
||||
$pg = 'KCP';
|
||||
break;
|
||||
@@ -127,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']; ?>&<?php echo $qstr; ?>" class="btn btn_03"><span class="sound_only"><?php echo $row['od_id']; ?> </span>보기</a>
|
||||
|
||||
@@ -73,10 +73,6 @@ for ($i=0; $row=sql_fetch_array($result); $i++)
|
||||
}
|
||||
|
||||
// 모바일 1줄당 이미지수 필드 추가
|
||||
if(!sql_query(" select ev_mobile_list_row from {$g5['g5_shop_event_table']} limit 1 ", false)) {
|
||||
sql_query(" ALTER TABLE `{$g5['g5_shop_event_table']}`
|
||||
ADD `ev_mobile_list_row` int(11) NOT NULL DEFAULT '0' AFTER `ev_mobile_list_mod` ", true);
|
||||
}
|
||||
|
||||
include_once (G5_ADMIN_PATH.'/admin.head.php');
|
||||
?>
|
||||
@@ -455,4 +451,4 @@ function feventform_check(f)
|
||||
|
||||
|
||||
<?php
|
||||
include_once (G5_ADMIN_PATH.'/admin.tail.php');
|
||||
include_once (G5_ADMIN_PATH.'/admin.tail.php');
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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++)
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -105,7 +105,7 @@ else if ($w == "u")
|
||||
and b.ca_mb_id = '{$member['mb_id']}' ";
|
||||
$row = sql_fetch($sql);
|
||||
if (!$row['it_id'])
|
||||
alert("\'{$member['mb_id']}\' 님께서 수정 할 권한이 없는 상품입니다.");
|
||||
alert("'{$member['mb_id']}' 님께서 수정 할 권한이 없는 상품입니다.");
|
||||
}
|
||||
|
||||
$it = get_shop_item($it_id);
|
||||
@@ -158,29 +158,13 @@ for ($i=0; $row=sql_fetch_array($result); $i++)
|
||||
}
|
||||
|
||||
// 재입고알림 설정 필드 추가
|
||||
if(!sql_query(" select it_stock_sms from {$g5['g5_shop_item_table']} limit 1 ", false)) {
|
||||
sql_query(" ALTER TABLE `{$g5['g5_shop_item_table']}`
|
||||
ADD `it_stock_sms` tinyint(4) NOT NULL DEFAULT '0' AFTER `it_stock_qty` ", true);
|
||||
}
|
||||
|
||||
// 추가옵션 포인트 설정 필드 추가
|
||||
if(!sql_query(" select it_supply_point from {$g5['g5_shop_item_table']} limit 1 ", false)) {
|
||||
sql_query(" ALTER TABLE `{$g5['g5_shop_item_table']}`
|
||||
ADD `it_supply_point` int(11) NOT NULL DEFAULT '0' AFTER `it_point_type` ", true);
|
||||
}
|
||||
|
||||
// 상품메모 필드 추가
|
||||
if(!sql_query(" select it_shop_memo from {$g5['g5_shop_item_table']} limit 1 ", false)) {
|
||||
sql_query(" ALTER TABLE `{$g5['g5_shop_item_table']}`
|
||||
ADD `it_shop_memo` text NOT NULL AFTER `it_use_avg` ", true);
|
||||
}
|
||||
|
||||
// 지식쇼핑 PID 필드추가
|
||||
// 상품메모 필드 추가
|
||||
if(!sql_query(" select ec_mall_pid from {$g5['g5_shop_item_table']} limit 1 ", false)) {
|
||||
sql_query(" ALTER TABLE `{$g5['g5_shop_item_table']}`
|
||||
ADD `ec_mall_pid` varchar(255) NOT NULL AFTER `it_shop_memo` ", true);
|
||||
}
|
||||
|
||||
$pg_anchor ='<ul class="anchor">
|
||||
<li><a href="#anc_sitfrm_cate">상품분류</a></li>
|
||||
@@ -199,17 +183,8 @@ $pg_anchor ='<ul class="anchor">
|
||||
|
||||
|
||||
// 쿠폰적용안함 설정 필드 추가
|
||||
if(!sql_query(" select it_nocoupon from {$g5['g5_shop_item_table']} limit 1", false)) {
|
||||
sql_query(" ALTER TABLE `{$g5['g5_shop_item_table']}`
|
||||
ADD `it_nocoupon` tinyint(4) NOT NULL DEFAULT '0' AFTER `it_use` ", true);
|
||||
}
|
||||
|
||||
// 스킨필드 추가
|
||||
if(!sql_query(" select it_skin from {$g5['g5_shop_item_table']} limit 1", false)) {
|
||||
sql_query(" ALTER TABLE `{$g5['g5_shop_item_table']}`
|
||||
ADD `it_skin` varchar(255) NOT NULL DEFAULT '' AFTER `ca_id3`,
|
||||
ADD `it_mobile_skin` varchar(255) NOT NULL DEFAULT '' AFTER `it_skin` ", true);
|
||||
}
|
||||
?>
|
||||
|
||||
<form name="fitemform" action="./itemformupdate.php" method="post" enctype="MULTIPART/FORM-DATA" autocomplete="off" onsubmit="return fitemformcheck(this)">
|
||||
@@ -1901,4 +1876,4 @@ categorychange(document.fitemform);
|
||||
</script>
|
||||
|
||||
<?php
|
||||
include_once (G5_ADMIN_PATH.'/admin.tail.php');
|
||||
include_once (G5_ADMIN_PATH.'/admin.tail.php');
|
||||
|
||||
@@ -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,6 +365,18 @@ $it_explan = isset($_POST['it_explan']) ? $_POST['it_explan'] : '';
|
||||
if ($it_name == "")
|
||||
alert("상품명을 입력해 주십시오.");
|
||||
|
||||
// 상품 스킨은 파일 경로가 아니라 스킨 디렉토리명(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'])))) : '';
|
||||
|
||||
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',
|
||||
@@ -384,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',
|
||||
@@ -487,7 +499,7 @@ else if ($w == "d")
|
||||
and b.ca_mb_id = '{$member['mb_id']}' ";
|
||||
$row = sql_fetch($sql);
|
||||
if (!$row['it_id'])
|
||||
alert("\'{$member['mb_id']}\' 님께서 삭제 할 권한이 없는 상품입니다.");
|
||||
alert("'{$member['mb_id']}' 님께서 삭제 할 권한이 없는 상품입니다.");
|
||||
}
|
||||
|
||||
itemdelete($it_id);
|
||||
|
||||
@@ -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&sst=$sst&sod=$sod&sfl=$sfl&stx=$stx&page=$page");
|
||||
goto_url("./itemlist.php?sca=$sca&sst=$sst&sod=$sod&sfl=$sfl&stx=$stx&page=$page");
|
||||
|
||||
@@ -4,13 +4,18 @@ include_once('./_common.php');
|
||||
|
||||
auth_check_menu($auth, $sub_menu, "r");
|
||||
|
||||
include_once('./date_filter.lib.php');
|
||||
$date_range = shop_admin_date_range($_GET, date('Ymd'));
|
||||
if ($date_range === false) {
|
||||
http_response_code(400);
|
||||
alert('조회 기간은 올바른 시작일과 종료일을 YYYYMMDD 형식으로 입력해 주십시오. 시작일은 종료일보다 늦을 수 없습니다.');
|
||||
}
|
||||
list($fr_date, $to_date) = $date_range;
|
||||
|
||||
$g5['title'] = '상품판매순위';
|
||||
include_once (G5_ADMIN_PATH.'/admin.head.php');
|
||||
include_once(G5_PLUGIN_PATH.'/jquery-ui/datepicker.php');
|
||||
|
||||
$fr_date = (isset($_GET['fr_date']) && preg_match("/[0-9]/", $_GET['fr_date'])) ? $_GET['fr_date'] : '';
|
||||
$to_date = (isset($_GET['to_date']) && preg_match("/[0-9]/", $_GET['to_date'])) ? $_GET['to_date'] : date("Ymd", time());
|
||||
|
||||
$doc = isset($_GET['doc']) ? clean_xss_tags($_GET['doc'], 1, 1) : '';
|
||||
$sort1 = (isset($_GET['sort1']) && in_array($_GET['sort1'], array('ct_status_1', 'ct_status_2', 'ct_status_3', 'ct_status_4', 'ct_status_5', 'ct_status_6', 'ct_status_7', 'ct_status_8', 'ct_status_9', 'ct_status_sum'))) ? $_GET['sort1'] : 'ct_status_sum';
|
||||
$sort2 = (isset($_GET['sort2']) && in_array($_GET['sort2'], array('desc', 'asc'))) ? $_GET['sort2'] : 'desc';
|
||||
@@ -57,7 +62,14 @@ $sql = $sql . " limit $from_record, $rows ";
|
||||
$result = sql_query($sql);
|
||||
|
||||
//$qstr = 'page='.$page.'&sort1='.$sort1.'&sort2='.$sort2;
|
||||
$qstr1 = $qstr.'&fr_date='.$fr_date.'&to_date='.$to_date.'&sel_ca_id='.$sel_ca_id;
|
||||
// 검증된 날짜만 URL에 전달한다. 최초 조회의 빈 날짜는 링크에서 생략한다.
|
||||
$filter_query = array('sel_ca_id' => $sel_ca_id);
|
||||
if ($fr_date !== '' && $to_date !== '') {
|
||||
$filter_query['fr_date'] = $fr_date;
|
||||
$filter_query['to_date'] = $to_date;
|
||||
}
|
||||
$qstr1 = htmlspecialchars(http_build_query($filter_query, '', '&'), ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');
|
||||
$paging_query = htmlspecialchars(http_build_query(array_merge($filter_query, array('sort1' => $sort1, 'sort2' => $sort2)), '', '&'), ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');
|
||||
|
||||
$listall = '<a href="'.$_SERVER['SCRIPT_NAME'].'" class="ov_listall">전체목록</a>';
|
||||
?>
|
||||
@@ -92,9 +104,9 @@ $listall = '<a href="'.$_SERVER['SCRIPT_NAME'].'" class="ov_listall">전체목
|
||||
|
||||
기간설정
|
||||
<label for="fr_date" class="sound_only">시작일</label>
|
||||
<input type="text" name="fr_date" value="<?php echo $fr_date; ?>" id="fr_date" required class="required frm_input" size="8" maxlength="8"> 에서
|
||||
<input type="text" name="fr_date" value="<?php echo htmlspecialchars($fr_date, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8'); ?>" id="fr_date" required class="required frm_input" size="8" maxlength="8"> 에서
|
||||
<label for="to_date" class="sound_only">종료일</label>
|
||||
<input type="text" name="to_date" value="<?php echo $to_date; ?>" id="to_date" required class="required frm_input" size="8" maxlength="8"> 까지
|
||||
<input type="text" name="to_date" value="<?php echo htmlspecialchars($to_date, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8'); ?>" id="to_date" required class="required frm_input" size="8" maxlength="8"> 까지
|
||||
<input type="submit" value="검색" class="btn_submit">
|
||||
|
||||
</form>
|
||||
@@ -162,7 +174,7 @@ $listall = '<a href="'.$_SERVER['SCRIPT_NAME'].'" class="ov_listall">전체목
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<?php echo get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, "{$_SERVER['SCRIPT_NAME']}?$qstr1&page="); ?>
|
||||
<?php echo get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, "{$_SERVER['SCRIPT_NAME']}?$paging_query&page="); ?>
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
|
||||
@@ -11,18 +11,6 @@ include_once (G5_ADMIN_PATH.'/admin.head.php');
|
||||
if(!isset($g5['g5_shop_item_stocksms_table']))
|
||||
die('<meta charset="utf-8">dbconfig.php 파일에 <strong>$g5[\'g5_shop_item_stocksms_table\'] = G5_SHOP_TABLE_PREFIX.\'item_stocksms\';</strong> 를 추가해 주세요.');
|
||||
|
||||
if(!sql_query(" select ss_id from {$g5['g5_shop_item_stocksms_table']} limit 1", false)) {
|
||||
sql_query(" CREATE TABLE IF NOT EXISTS `{$g5['g5_shop_item_stocksms_table']}` (
|
||||
`ss_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`it_id` varchar(20) NOT NULL DEFAULT '',
|
||||
`ss_hp` varchar(255) NOT NULL DEFAULT '',
|
||||
`ss_send` tinyint(4) NOT NULL DEFAULT '0',
|
||||
`ss_send_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`ss_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`ss_ip` varchar(25) NOT NULL DEFAULT '',
|
||||
PRIMARY KEY (`ss_id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ", true);
|
||||
}
|
||||
|
||||
$doc = isset($_GET['doc']) ? clean_xss_tags($_GET['doc'], 1, 1) : '';
|
||||
$sort1 = (isset($_GET['sort1']) && in_array($_GET['sort1'], array('it_id', 'ss_hp', 'ss_send', 'ss_send_time', 'ss_datetime'))) ? $_GET['sort1'] : 'ss_send';
|
||||
@@ -184,4 +172,4 @@ function fitemstocksms_submit(f)
|
||||
</script>
|
||||
|
||||
<?php
|
||||
include_once (G5_ADMIN_PATH.'/admin.tail.php');
|
||||
include_once (G5_ADMIN_PATH.'/admin.tail.php');
|
||||
|
||||
@@ -18,13 +18,6 @@ if (!$is['is_id'])
|
||||
alert('등록된 자료가 없습니다.');
|
||||
|
||||
// 사용후기 의 답변 필드 추가
|
||||
if (!isset($is['is_reply_subject'])) {
|
||||
sql_query(" ALTER TABLE `{$g5['g5_shop_item_use_table']}`
|
||||
ADD COLUMN `is_reply_subject` VARCHAR(255) NOT NULL DEFAULT '' AFTER `is_confirm`,
|
||||
ADD COLUMN `is_reply_content` TEXT NOT NULL AFTER `is_reply_subject`,
|
||||
ADD COLUMN `is_reply_name` VARCHAR(25) NOT NULL DEFAULT '' AFTER `is_reply_content`
|
||||
", true);
|
||||
}
|
||||
|
||||
$name = get_sideview($is['mb_id'], get_text($is['is_name']), $is['mb_email'], $is['mb_homepage']);
|
||||
|
||||
@@ -117,4 +110,4 @@ function fitemuseform_submit(f)
|
||||
</script>
|
||||
|
||||
<?php
|
||||
include_once (G5_ADMIN_PATH.'/admin.tail.php');
|
||||
include_once (G5_ADMIN_PATH.'/admin.tail.php');
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,17 +30,17 @@ if(! function_exists('column_char')) {
|
||||
$rows = array();
|
||||
|
||||
for($i=1; $row=sql_fetch_array($result); $i++) {
|
||||
$rows[] =
|
||||
array(' '.$row['od_id'],
|
||||
$row['od_name'],
|
||||
' '.$row['od_tel'],
|
||||
' '.$row['od_hp'],
|
||||
$row['od_b_name'],
|
||||
' '.$row['od_b_tel'],
|
||||
' '.$row['od_b_hp'],
|
||||
print_address($row['od_b_addr1'], $row['od_b_addr2'], $row['od_b_addr3'], $row['od_b_addr_jibeon']),
|
||||
$row['od_delivery_company'],
|
||||
$row['od_invoice']);
|
||||
$rows[] =
|
||||
array(' '.$row['od_id'],
|
||||
function_exists('csv_safe_cell') ? csv_safe_cell($row['od_name']) : $row['od_name'],
|
||||
' '.$row['od_tel'],
|
||||
' '.$row['od_hp'],
|
||||
function_exists('csv_safe_cell') ? csv_safe_cell($row['od_b_name']) : $row['od_b_name'],
|
||||
' '.$row['od_b_tel'],
|
||||
' '.$row['od_b_hp'],
|
||||
function_exists('csv_safe_cell') ? csv_safe_cell(print_address($row['od_b_addr1'], $row['od_b_addr2'], $row['od_b_addr3'], $row['od_b_addr_jibeon'])) : print_address($row['od_b_addr1'], $row['od_b_addr2'], $row['od_b_addr3'], $row['od_b_addr_jibeon']),
|
||||
function_exists('csv_safe_cell') ? csv_safe_cell($row['od_delivery_company']) : $row['od_delivery_company'],
|
||||
function_exists('csv_safe_cell') ? csv_safe_cell($row['od_invoice']) : $row['od_invoice']);
|
||||
}
|
||||
|
||||
$data = array_merge(array($headers), $rows);
|
||||
|
||||
@@ -6,6 +6,8 @@ include_once(G5_LIB_PATH.'/mailer.lib.php');
|
||||
|
||||
auth_check_menu($auth, $sub_menu, "w");
|
||||
|
||||
check_admin_token();
|
||||
|
||||
define("_ORDERMAIL_", true);
|
||||
|
||||
$sms_count = 0;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user