Compare commits

...
101 Commits
Author SHA1 Message Date
thisgun 29381da2ce 버전 5.6.7 수정 2024-10-31 16:19:11 +09:00
thisgun d96f47f93d NHN_KCP 휴대폰 본인인증 설정 가맹점 인증키 추가 2024-10-31 12:17:26 +09:00
thisgun 830994b637 소셜로그인 테이블 PK 수정 2024-10-28 10:55:14 +09:00
thisgun 0d586e2101 htmlpurifier 4.15.0 버전으로 수정 2024-10-25 17:52:55 +09:00
thisgun 5e6549a22c 영카트 관리자페이지 주문내역출력 페이지 코드 수정 2024-10-25 16:25:54 +09:00
thisgun ab204cfa59 CloudFlare 환경과 적용에 대한 코드 수정 #349 2024-10-25 11:46:50 +09:00
thisgun 3ca77a38fb 위시리스트에서 주문하기시 상품이 잘못 장바구니 담기되는 오류 수정 2024-10-23 15:23:47 +09:00
thisgun 67051c74a8 latest 함수 PHP 8 optional parameter issue 수정 2024-10-22 17:48:08 +09:00
thisgun 2a0bf12e65 버전 5.6.6 수정 2024-09-24 16:05:45 +09:00
thisgun dfa16adf31 KG이니시스 통합인증 9032 중복된 주문 에러와 회원정보 찾기 오류 수정 2024-09-24 16:03:42 +09:00
thisgun 96b30e0df6 Toss Payments - XPay 호출 도메인 변경 lgdacom.conf url 수정 #341 2024-09-04 20:03:13 +09:00
thisgun ef99a886cc 버전 5.6.5 수정 2024-09-04 12:56:35 +09:00
thisgun 20eb993757 나이스페이 주문정보 입력 오류시 결제 취소 코드 추가 및 불필요한 코드 제거 2024-09-04 12:55:05 +09:00
thisgun 3474be175d 토스페이먼츠 (구)lg XPay 테스트 에스크로 배송 url 수정 2024-09-03 18:03:21 +09:00
thisgun 532bf6f0f4 토스페이먼츠 (구)lg XPay 도메인 지원종료에 따른 결제도메인 수정 2024-09-03 17:17:55 +09:00
thisgun c4c1e50f68 Merge branch 'master' of github.com:gnuboard/gnuboard5 2024-07-18 10:28:57 +09:00
thisgun 7754e12194 토스페이먼츠 테스트 결제 url 수정 2024-07-18 10:28:26 +09:00
thisgun 287d68790f 토스페이먼츠 모바일 결제수단 키 수정 2024-07-18 10:18:57 +09:00
kagla 7d396b1749 Merge pull request #331 from gnuboard/php8.3
창고재고 없을때 '재고 부족' sound 처리하는 잘못 노출된 span 태그 제거
2024-07-18 08:24:17 +09:00
kagla d666e3467f 창고재고 없을때 '재고 부족' sound 처리하는 잘못 노출된 span 태그 제거 2024-07-18 08:18:11 +09:00
kagla d4c158cfa4 php-mysql 미설치시, 그누보드 설치 경고창에 정보 안나오는 경우 해결 2024-07-16 10:56:06 +09:00
thisgun f1af936c7d Cloudflare 환경에서 REMOTE_ADDR에 사용자 아이피 적용 2024-07-11 18:30:03 +09:00
thisgun 72d52b594c Deprecated: Optional parameter warning message 경고메시지 나오는 함수 코드 수정 2024-07-08 11:22:58 +09:00
thisgun 5622b38c17 버전 5.6.4 수정 2024-07-03 12:59:54 +09:00
thisgun cef3a48ff1 Merge branch 'master' of github.com:gnuboard/gnuboard5 2024-07-03 12:50:21 +09:00
thisgun c6b58bb16b 그누보드 open redirect 취약점 수정 2024-07-03 12:50:12 +09:00
thisgun 14ffe72574 영카트 관리자 주문내역에서 개인결제 추가시 토큰오류 문제 수정 2024-07-03 11:56:33 +09:00
kkigomi 02baf1589f fix: get_member 함수에서 hook에 잘못된 아이디가 전달될 수 있는 문제 고침 (#328)
* fix: get_member 함수에서 hook에 잘못된 아이디가 전달될 수 있는 문제 고침

trim()이 mysql 쿼리에서만 처리되어 hook에 잘못된 회원아이디가 전달될 수 있는 문제.

* 잘못된 파라미터 타입 수정
2024-06-18 09:45:34 +09:00
thisgun 9a1067862a 버전 5.6.3 수정 2024-06-07 14:28:31 +09:00
thisgun 07f848e1c7 Merge branch 'master' of github.com:gnuboard/gnuboard5 2024-06-07 12:43:59 +09:00
thisgun 80846ac637 5.5버전 브랜치와 충돌수정 2024-06-07 12:43:34 +09:00
thisgun 62c0803cf5 초기화되지 않은 변수 수정 #325 2024-06-07 12:38:32 +09:00
thisgun 08df872863 HTMLPurifier_Filter_iframevideo 클래스명의 대소문자 불일치 수정#324 2024-06-07 12:31:17 +09:00
zipuragi ca30e27b27 게시판에서 회원 아이디로 댓글 검색시 잘못된 결과가 나오는 문제 (#322) 2024-06-07 12:25:31 +09:00
thisgun 56615a5e9e 비회원인 상태에서 장바구니에서 주문하기 후 로그인하면 장바구니가 비어있는 문제 수정 2024-06-07 12:24:41 +09:00
총 9c44d234ed Create SECURITY.md 2024-06-05 16:18:50 +09:00
thisgun e03e01d410 Open Redirect 취약점 수정 #318 2024-06-05 14:56:50 +09:00
thisgun 940e701fa4 관리자 회원관리에서 PHP WARNING 경고문이 나오는 코드 수정 #316 2024-06-05 10:09:24 +09:00
thisgun 031f8b4ef9 소셜로그인 타임아웃 설정타임 수정 #315 2024-06-04 17:59:31 +09:00
thisgun ed6b7f3326 글쓰기 임시저장과 쪽지쓰기 코드 수정 2024-06-04 17:38:33 +09:00
thisgun 0ded1df66d 삼품재고관리가 제대로 표시되지 않는 문제 수정 2024-06-04 11:27:16 +09:00
thisgun f4dfbacf03 글복사 sql query에 볋칭 as 추가 및 포인트 업데이트 코드 수정 2024-06-04 10:25:59 +09:00
thisgun 3fd8740c92 관리자 기본환경설정에서 불필요한 코드 제거 2024-06-03 18:16:59 +09:00
thisgun 68dc0bd4ec KG이니시스 MID SEED대칭키 수정 2024-06-03 18:16:17 +09:00
thisgun cc96048dfa NHN_KCP 결제정보 검증기능 추가 적용 2024-06-03 18:15:45 +09:00
thisgun 6697327265 쇼핑몰 주문 SMS 파일의 금액변수에 (int) 형 추가 2024-06-03 18:15:39 +09:00
thisgun a301d3e1f0 관리자 기본환경설정에서 불필요한 코드 제거 2024-06-03 12:39:48 +09:00
thisgun 2c0e05bbcc KG이니시스 MID SEED대칭키 수정 2024-05-31 19:23:42 +09:00
thisgun 92c1052cf5 NHN_KCP 결제정보 검증기능 추가 적용 2024-05-14 17:10:00 +09:00
thisgun c4763a64d8 쇼핑몰 주문 SMS 파일의 금액변수에 (int) 형 추가 2024-05-14 16:04:14 +09:00
kit rio 02e0996eb4 kisa seed_cbc undefined 변수 수정
SEED_CBC_Decrypt 함수
return null 전에 초기화
2024-04-17 18:41:44 +09:00
thisgun 82648dcbfc 버전 5.6.2 수정 2024-04-17 18:29:23 +09:00
thisgun 61a0236938 버전 5.5.16 수정 2024-04-17 18:23:10 +09:00
thisgun 712172a0ea NHN_KCP 결제정보 검증기능 적용 2024-04-17 18:19:43 +09:00
thisgun d0eadcb12e 나이스페이 관리자 테스트결제 경고문 표시 및 모바일결제 스크립트 오류 수정 2024-04-17 15:45:36 +09:00
thisgun f38baea729 Merge branch 'master' of github.com:gnuboard/g5-update 2024-04-17 15:22:12 +09:00
thisgun 6048a8a1c5 NHN_KCP 결제정보 검증기능 적용 2024-04-17 15:21:55 +09:00
총 b84a6114f4 Merge pull request #12 from gnuboard/fix/cbc
seed_cbc undefined 변수 수정
2024-04-12 16:09:56 +09:00
kit rio b3ea5f19a8 kisa seed_cbc undefined 변수 수정
SEED_CBC_Decrypt 함수
return null 전에 초기화
2024-04-11 17:46:58 +09:00
thisgun b52a1f4da4 버전 5.6.1 수정 2024-04-11 12:32:58 +09:00
thisgun ce89cba2c7 버전 5.5.15 수정 2024-04-11 12:14:00 +09:00
thisgun c3634c05f7 KG이니시스 통합인증 암호화적용 여부 선택옵션 추가 2024-04-11 12:10:59 +09:00
thisgun 470d65d92a KG이니시스 통합인증 암호화적용 여부 선택옵션 추가 2024-04-11 11:55:55 +09:00
thisgun 2aff3cd491 버전 5.6 수정 2024-04-03 10:45:11 +09:00
thisgun 84669cb47f 나이스페이 결제수단 추가 2024-04-03 10:42:04 +09:00
thisgun baa114c471 버전 5.5.14 수정 2024-04-03 10:02:42 +09:00
thisgun 2bfd995e49 쇼핑몰 결제시 결세수단 체크 과정 추가 2024-04-03 09:59:02 +09:00
thisgun 1e72d7e81c DB 업그레이드시 기본설정,QA설정,로그인,방문자,쇼핑몰설정 테이블에 pk auto_increment 추가 2024-04-03 09:58:49 +09:00
thisgun 79b0066ec1 Merge branch 'master' of github.com:gnuboard/gnuboard5 2024-04-03 09:57:01 +09:00
kagla 47e243c0ad Fix/db (#311)
* QA설정테이블에 qa_id pkey auto_increment 추가

* 설정, 로그인, 방문자 테이블에 pkey, auto_increment 추가

* 쇼핑몰 설정테이블에 de_id pkey auto_increment 추가
2024-04-03 09:56:45 +09:00
thisgun bf6678e036 글쓰기 sql query 에 별칭 as 추가 #309 2024-04-03 09:44:37 +09:00
thisgun aba7d75de6 쇼핑몰 모바일 상품 리스트 페이지에서 불필요한 변수 제거 #308 2024-03-27 12:21:54 +09:00
thisgun 474fc8f9a9 관리자 xss 체크 alert이 너무 자주 발생하는 문제 #301 수정 2024-03-27 11:22:25 +09:00
thisgun a0eb804918 [KVE-2024-0023] 답변이 달린 상품문의글 수정가능 취약점 수정 2024-03-25 10:47:29 +09:00
thisgun 0d9c773d22 [KVE-2024-0022] 쇼핑몰 사용후기 별점 조작 취약점 수정 2024-03-25 10:03:07 +09:00
thisgun 6705d014f9 [KVE-2024-0021] Stored XSS 취약점 수정 2024-03-25 09:25:53 +09:00
thisgun 985546fbad G5_USE_SHOP 상수가 false 시 기본테마 로그인에 warning 경고문이 나오는 문제 수정 2024-02-19 18:07:18 +09:00
thisgun fa6aa881de 게시글 복사시 첨부파일 변수명값이 초기화가 안된 오류 수정 2024-02-19 12:49:17 +09:00
thisgun 06750e248b 버전 5.5.13 수정 2024-02-19 10:08:31 +09:00
thisgun c1c4089883 Union based SQL injection 취약점 수정 2024-02-15 15:28:48 +09:00
thisgun 248cb2b173 관리자 페이지 원격 명령 실행 취약점 수정 2024-02-14 19:09:20 +09:00
thisgun 8d912e3511 Open Redirection 취약점 다시 재수정 2024-02-14 18:31:52 +09:00
thisgun c67118f374 버전 5.5.12 수정 2024-01-25 16:58:48 +09:00
thisgun 15f2037790 OpenRediect 취약점 수정 2024-01-25 16:50:47 +09:00
thisgun cb6b39cb60 이니시스 본인인증 모듈 최근것으로 적용 2024-01-25 12:30:43 +09:00
thisgun 73a5f4cc47 NHN_KCP 에스크로 마크 상점코드가 SIR로 나왔던 오류 수정 2024-01-24 10:53:16 +09:00
thisgun 5f910f192e 버전 5.5.11 수정 2024-01-02 10:28:48 +09:00
thisgun bc2c939d72 Merge branch 'patch_5.5.11' of github.com:gnuboard/gnuboard5 2024-01-02 10:18:41 +09:00
kkigomi b7c557f44e #297 보안취약점 처리 보완 (#300) 2024-01-02 10:17:41 +09:00
thisgun 1ff5df8215 KCP 모바일 결제중 Deprecated 메시지로 결제가 안되는 오류 수정 2024-01-02 09:59:06 +09:00
thisgun 72d03f305c 카카오로 링크 내보내기 스크립트 수정 2023-12-29 18:14:54 +09:00
thisgun 1ec9a0ee12 게시판 아이디를 content로 생성하면 짧은주소 기능과 충돌하는 문제 수정 #299 2023-12-29 11:56:32 +09:00
thisgun a061d6c863 동시성 문제로 wr_seo_title 값이 중복되는 문제 수정 #293 2023-12-18 17:26:30 +09:00
thisgun 4f2f725de8 보안취약점 수정 #297 2023-12-18 12:39:55 +09:00
thisgun fae53d3cd5 관리페이지에서 환경설정을 저장할 때 변조된 데이터가 사용될 수 있는 문제 수정 #296 2023-12-18 11:55:15 +09:00
thisgun 1fc3a343c2 영카트 상품의 짧은주소에 사용되는 it_seo_title이 중복되는 문제 수정 #295 2023-12-18 11:29:37 +09:00
thisgun 5e1ab9c1e7 [KVE-2023-5525] 그누보드(영카트) lgxpay plugin XSS취약점 수정 2023-12-04 18:16:20 +09:00
thisgun 5605b539f4 버전 5.5.10 수정 2023-11-10 14:12:48 +09:00
thisgun a8baa8dd7d ss_mb_key 체크함수의 user_agent 에 hook 추가 2023-11-10 13:57:24 +09:00
thisgun 16051b3049 비회원이 비밀글을 작성할 경우 패스워드를 묻는 오류 문제 수정 2023-11-10 12:47:10 +09:00
thisgun db1d56e07b G5_DOMAIN 설정시 url에 타 도메인을 지정할수 없습니다. 메시지가 나오는 오류 수정 #290 2023-11-10 12:21:19 +09:00
152 changed files with 32449 additions and 28628 deletions

No files matched your search

+3
View File
@@ -0,0 +1,3 @@
# Gnuboard5 Security Policy
Please ask [https://sir.kr/security/.](https://sir.kr/co_qa)
+1 -1
View File
@@ -554,7 +554,7 @@ function admin_check_xss_params($params)
if (is_array($value)) { if (is_array($value)) {
admin_check_xss_params($value); admin_check_xss_params($value);
} else if ((preg_match('/<\s?[^\>]*\/?\s?>/i', $value) && (preg_match('/script.*?\/script/ius', $value) || preg_match('/[onload|onerror]=.*/ius', $value))) || preg_match('/^(?=.*token\()(?=.*xmlhttprequest\()(?=.*send\().*$/im', $value) || (preg_match('/[onload|onerror|focus]=.*/ius', $value) && preg_match('/(eval|expression|exec|prompt)(\s*)\((.*)\)/ius', $value))) { } else if ((preg_match('/<\s?[^\>]*\/?\s?>/i', $value) && (preg_match('/script.*?\/script/ius', $value) || preg_match('/(onload|onerror)=.*/ius', $value))) || preg_match('/^(?=.*token\()(?=.*xmlhttprequest\()(?=.*send\().*$/im', $value) || (preg_match('/(onload|onerror|focus)=.*/ius', $value) && preg_match('/(eval|expression|exec|prompt)(\s*)\((.*)\)/ius', $value))) {
alert('요청 쿼리에 잘못된 스크립트문장이 있습니다.\\nXSS 공격일수도 있습니다.', G5_URL); alert('요청 쿼리에 잘못된 스크립트문장이 있습니다.\\nXSS 공격일수도 있습니다.', G5_URL);
die(); die();
} }
+3 -1
View File
@@ -8,7 +8,7 @@ auth_check_menu($auth, $sub_menu, 'w');
check_admin_token(); check_admin_token();
$bo_table = isset($_POST['bo_table']) ? $_POST['bo_table'] : null; $bo_table = isset($_POST['bo_table']) ? substr(preg_replace('/[^a-z0-9_]/i', '', $_POST['bo_table']), 0, 20) : null;
$target_table = isset($_POST['target_table']) ? trim($_POST['target_table']) : ''; $target_table = isset($_POST['target_table']) ? trim($_POST['target_table']) : '';
$target_subject = isset($_POST['target_subject']) ? trim($_POST['target_subject']) : ''; $target_subject = isset($_POST['target_subject']) ? trim($_POST['target_subject']) : '';
@@ -24,6 +24,8 @@ if (!preg_match('/[A-Za-z0-9_]{1,20}/', $target_table)) {
alert('게시판 TABLE명은 공백없이 영문자, 숫자, _ 만 사용 가능합니다. (20자 이내)'); alert('게시판 TABLE명은 공백없이 영문자, 숫자, _ 만 사용 가능합니다. (20자 이내)');
} }
$target_table = substr(preg_replace('/[^a-z0-9_]/i', '', $target_table), 0, 20);
// 게시판명이 금지된 단어로 되어 있으면 // 게시판명이 금지된 단어로 되어 있으면
if ($w == '' && in_array($target_table, get_bo_table_banned_word())) { if ($w == '' && in_array($target_table, get_bo_table_banned_word())) {
alert('입력한 게시판 TABLE명을 사용할수 없습니다. 다른 이름으로 입력해 주세요.'); alert('입력한 게시판 TABLE명을 사용할수 없습니다. 다른 이름으로 입력해 주세요.');
+34 -4
View File
@@ -8,7 +8,9 @@ if ($is_admin != 'super') {
alert('최고관리자만 접근 가능합니다.'); alert('최고관리자만 접근 가능합니다.');
} }
$copy_config = get_config(true); // https://github.com/gnuboard/gnuboard5/issues/296 이슈처리
$sql = " select * from {$g5['config_table']} limit 1";
$config = sql_fetch($sql);
if (!isset($config['cf_add_script'])) { if (!isset($config['cf_add_script'])) {
sql_query( sql_query(
@@ -407,6 +409,17 @@ if (!isset($config['cf_cert_kg_mid'])) {
ADD COLUMN `cf_cert_kg_mid` VARCHAR(255) NOT NULL DEFAULT '' AFTER `cf_cert_kg_cd`; "; ADD COLUMN `cf_cert_kg_mid` VARCHAR(255) NOT NULL DEFAULT '' AFTER `cf_cert_kg_cd`; ";
sql_query($sql, false); 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);
}
if (!$config['cf_faq_skin']) { if (!$config['cf_faq_skin']) {
$config['cf_faq_skin'] = "basic"; $config['cf_faq_skin'] = "basic";
} }
@@ -699,14 +712,14 @@ if ($config['cf_sms_use'] && $config['cf_icode_id'] && $config['cf_icode_pw']) {
<th scope="row"><label for="cf_analytics">방문자분석 스크립트</label></th> <th scope="row"><label for="cf_analytics">방문자분석 스크립트</label></th>
<td colspan="3"> <td colspan="3">
<?php echo help('방문자분석 스크립트 코드를 입력합니다. 예) 구글 애널리틱스<br>관리자 페이지에서는 이 코드를 사용하지 않습니다.'); ?> <?php echo help('방문자분석 스크립트 코드를 입력합니다. 예) 구글 애널리틱스<br>관리자 페이지에서는 이 코드를 사용하지 않습니다.'); ?>
<textarea name="cf_analytics" id="cf_analytics"><?php echo get_text($copy_config['cf_analytics']); ?></textarea> <textarea name="cf_analytics" id="cf_analytics"><?php echo get_text($config['cf_analytics']); ?></textarea>
</td> </td>
</tr> </tr>
<tr> <tr>
<th scope="row"><label for="cf_add_meta">추가 메타태그</label></th> <th scope="row"><label for="cf_add_meta">추가 메타태그</label></th>
<td colspan="3"> <td colspan="3">
<?php echo help('추가로 사용하실 meta 태그를 입력합니다.<br>관리자 페이지에서는 이 코드를 사용하지 않습니다.'); ?> <?php echo help('추가로 사용하실 meta 태그를 입력합니다.<br>관리자 페이지에서는 이 코드를 사용하지 않습니다.'); ?>
<textarea name="cf_add_meta" id="cf_add_meta"><?php echo get_text($copy_config['cf_add_meta']); ?></textarea> <textarea name="cf_add_meta" id="cf_add_meta"><?php echo get_text($config['cf_add_meta']); ?></textarea>
</td> </td>
</tr> </tr>
<tr> <tr>
@@ -1001,6 +1014,16 @@ if ($config['cf_sms_use'] && $config['cf_icode_id'] && $config['cf_icode_pw']) {
</select> </select>
</td> </td>
</tr> </tr>
<tr>
<th scope="row" class="cf_cert_service"><label for="cf_cert_use_seed">통합인증 암호화 적용</label></th>
<td class="cf_cert_service">
<?php echo help('KG이니시스 통합인증서비스에 암호화를 적용합니다. 만일 글자가 깨지는 문제가 발생하면 사용안함으로 적용해 주세요.') ?>
<select name="cf_cert_use_seed" id="cf_cert_use_seed">
<?php echo option_selected("0", $config['cf_cert_use_seed'], "사용안함"); ?>
<?php echo option_selected("1", $config['cf_cert_use_seed'], "사용함"); ?>
</select>
</td>
</tr>
<tr> <tr>
<th scope="row" class="cf_cert_service"><label for="cf_cert_hp">휴대폰 본인확인</label></th> <th scope="row" class="cf_cert_service"><label for="cf_cert_hp">휴대폰 본인확인</label></th>
<td class="cf_cert_service"> <td class="cf_cert_service">
@@ -1049,6 +1072,13 @@ if ($config['cf_sms_use'] && $config['cf_icode_id'] && $config['cf_icode_pw']) {
<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> <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>
</td> </td>
</tr> </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>입력하지 않거나 잘못 입력시 휴대폰 본인확인을 취소 하셨습니다. 라고 메시지가 나오면서 창이 닫히는 오류가 발생됩니다.') ?>
<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>
</td>
</tr>
<tr> <tr>
<th scope="row" class="cf_cert_service"><label for="cf_cert_limit">본인확인 이용제한</label></th> <th scope="row" class="cf_cert_service"><label for="cf_cert_limit">본인확인 이용제한</label></th>
<td class="cf_cert_service"> <td class="cf_cert_service">
@@ -1392,7 +1422,7 @@ if ($config['cf_sms_use'] && $config['cf_icode_id'] && $config['cf_icode_pw']) {
<th scope="row"><label for="cf_add_script">추가 script, css</label></th> <th scope="row"><label for="cf_add_script">추가 script, css</label></th>
<td> <td>
<?php echo help('HTML의 &lt;/HEAD&gt; 태그위로 추가될 JavaScript와 css 코드를 설정합니다.<br>관리자 페이지에서는 이 코드를 사용하지 않습니다.') ?> <?php echo help('HTML의 &lt;/HEAD&gt; 태그위로 추가될 JavaScript와 css 코드를 설정합니다.<br>관리자 페이지에서는 이 코드를 사용하지 않습니다.') ?>
<textarea name="cf_add_script" id="cf_add_script"><?php echo get_text($copy_config['cf_add_script']); ?></textarea> <textarea name="cf_add_script" id="cf_add_script"><?php echo get_text($config['cf_add_script']); ?></textarea>
</td> </td>
</tr> </tr>
</tbody> </tbody>
+12 -10
View File
@@ -12,7 +12,6 @@ if ($is_admin != 'super') {
$cf_title = isset($_POST['cf_title']) ? strip_tags(clean_xss_attributes($_POST['cf_title'])) : ''; $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_admin = isset($_POST['cf_admin']) ? clean_xss_tags($_POST['cf_admin'], 1, 1) : '';
$posts = array();
$mb = get_member($cf_admin); $mb = get_member($cf_admin);
@@ -24,15 +23,15 @@ check_admin_token();
$cf_social_servicelist = !empty($_POST['cf_social_servicelist']) ? implode(',', $_POST['cf_social_servicelist']) : ''; $cf_social_servicelist = !empty($_POST['cf_social_servicelist']) ? implode(',', $_POST['cf_social_servicelist']) : '';
$check_keys = array('cf_cert_kcb_cd', 'cf_cert_kcp_cd', 'cf_editor', 'cf_recaptcha_site_key', 'cf_recaptcha_secret_key', 'cf_naver_clientid', 'cf_naver_secret', 'cf_facebook_appid', 'cf_facebook_secret', 'cf_twitter_key', 'cf_twitter_secret', 'cf_google_clientid', 'cf_google_secret', 'cf_googl_shorturl_apikey', 'cf_kakao_rest_key', 'cf_kakao_client_secret', 'cf_kakao_js_apikey', 'cf_payco_clientid', 'cf_payco_secret', 'cf_cert_kg_cd', 'cf_cert_kg_mid'); $check_keys = array('cf_cert_kcb_cd', 'cf_cert_kcp_cd', 'cf_cert_kcp_enckey', 'cf_editor', 'cf_recaptcha_site_key', 'cf_recaptcha_secret_key', 'cf_naver_clientid', 'cf_naver_secret', 'cf_facebook_appid', 'cf_facebook_secret', 'cf_twitter_key', 'cf_twitter_secret', 'cf_google_clientid', 'cf_google_secret', 'cf_googl_shorturl_apikey', 'cf_kakao_rest_key', 'cf_kakao_client_secret', 'cf_kakao_js_apikey', 'cf_payco_clientid', 'cf_payco_secret', 'cf_cert_kg_cd', 'cf_cert_kg_mid');
foreach ($check_keys as $key) { foreach ($check_keys as $key) {
if (isset($_POST[$key]) && $_POST[$key]) { if (isset($_POST[$key]) && $_POST[$key]) {
$posts[$key] = $_POST[$key] = preg_replace('/[^a-z0-9_\-\.]/i', '', $_POST[$key]); $_POST[$key] = preg_replace('/[^a-z0-9_\-\.]/i', '', $_POST[$key]);
} }
} }
$posts['cf_icode_server_port'] = $_POST['cf_icode_server_port'] = isset($_POST['cf_icode_server_port']) ? preg_replace('/[^0-9]/', '', $_POST['cf_icode_server_port']) : '7295'; $_POST['cf_icode_server_port'] = isset($_POST['cf_icode_server_port']) ? preg_replace('/[^0-9]/', '', $_POST['cf_icode_server_port']) : '7295';
if (isset($_POST['cf_intercept_ip']) && $_POST['cf_intercept_ip']) { if (isset($_POST['cf_intercept_ip']) && $_POST['cf_intercept_ip']) {
$pattern = explode("\n", trim($_POST['cf_intercept_ip'])); $pattern = explode("\n", trim($_POST['cf_intercept_ip']));
@@ -105,6 +104,7 @@ $check_keys = array(
'cf_cert_ipin' => 'char', 'cf_cert_ipin' => 'char',
'cf_cert_hp' => 'char', 'cf_cert_hp' => 'char',
'cf_cert_simple' => 'char', 'cf_cert_simple' => 'char',
'cf_cert_use_seed' => 'int',
'cf_admin_email' => 'char', 'cf_admin_email' => 'char',
'cf_admin_email_name' => 'char', 'cf_admin_email_name' => 'char',
'cf_add_script' => 'text', 'cf_add_script' => 'text',
@@ -164,12 +164,12 @@ for ($i = 1; $i <= 10; $i++) {
foreach ($check_keys as $k => $v) { foreach ($check_keys as $k => $v) {
if ($v === 'int') { if ($v === 'int') {
$posts[$key] = $_POST[$k] = isset($_POST[$k]) ? (int) $_POST[$k] : 0; $_POST[$k] = isset($_POST[$k]) ? (int) $_POST[$k] : 0;
} else { } else {
if (in_array($k, array('cf_analytics', 'cf_add_meta', 'cf_add_script', 'cf_stipulation', 'cf_privacy'))) { if (in_array($k, array('cf_analytics', 'cf_add_meta', 'cf_add_script', 'cf_stipulation', 'cf_privacy'))) {
$posts[$key] = $_POST[$k] = isset($_POST[$k]) ? $_POST[$k] : ''; $_POST[$k] = isset($_POST[$k]) ? $_POST[$k] : '';
} else { } else {
$posts[$key] = $_POST[$k] = isset($_POST[$k]) ? strip_tags(clean_xss_attributes($_POST[$k])) : ''; $_POST[$k] = isset($_POST[$k]) ? strip_tags(clean_xss_attributes($_POST[$k])) : '';
} }
} }
} }
@@ -180,9 +180,9 @@ if ($_POST['cf_cert_use'] && !$_POST['cf_cert_ipin'] && !$_POST['cf_cert_hp'] &&
} }
if (!$_POST['cf_cert_use']) { if (!$_POST['cf_cert_use']) {
$posts[$key] = $_POST['cf_cert_ipin'] = ''; $_POST['cf_cert_ipin'] = '';
$posts[$key] = $_POST['cf_cert_hp'] = ''; $_POST['cf_cert_hp'] = '';
$posts[$key] = $_POST['cf_cert_simple'] = ''; $_POST['cf_cert_simple'] = '';
} }
$sql = " update {$g5['config_table']} $sql = " update {$g5['config_table']}
@@ -284,10 +284,12 @@ $sql = " update {$g5['config_table']}
cf_cert_ipin = '{$_POST['cf_cert_ipin']}', cf_cert_ipin = '{$_POST['cf_cert_ipin']}',
cf_cert_hp = '{$_POST['cf_cert_hp']}', cf_cert_hp = '{$_POST['cf_cert_hp']}',
cf_cert_simple = '{$_POST['cf_cert_simple']}', cf_cert_simple = '{$_POST['cf_cert_simple']}',
cf_cert_use_seed = '".(int)$_POST['cf_cert_use_seed']."',
cf_cert_kg_cd = '{$_POST['cf_cert_kg_cd']}', cf_cert_kg_cd = '{$_POST['cf_cert_kg_cd']}',
cf_cert_kg_mid = '" . trim($_POST['cf_cert_kg_mid']) . "', cf_cert_kg_mid = '" . trim($_POST['cf_cert_kg_mid']) . "',
cf_cert_kcb_cd = '{$_POST['cf_cert_kcb_cd']}', cf_cert_kcb_cd = '{$_POST['cf_cert_kcb_cd']}',
cf_cert_kcp_cd = '{$_POST['cf_cert_kcp_cd']}', cf_cert_kcp_cd = '{$_POST['cf_cert_kcp_cd']}',
cf_cert_kcp_enckey = '{$_POST['cf_cert_kcp_enckey']}',
cf_cert_limit = '{$_POST['cf_cert_limit']}', cf_cert_limit = '{$_POST['cf_cert_limit']}',
cf_cert_req = '{$_POST['cf_cert_req']}', cf_cert_req = '{$_POST['cf_cert_req']}',
cf_sms_use = '{$_POST['cf_sms_use']}', cf_sms_use = '{$_POST['cf_sms_use']}',
+3
View File
@@ -57,6 +57,9 @@ if ($w == "u") {
if (!$co['co_id']) { if (!$co['co_id']) {
alert('등록된 자료가 없습니다.'); alert('등록된 자료가 없습니다.');
} }
if (function_exists('check_case_exist_title')) check_case_exist_title($co, G5_CONTENT_DIR, false);
} else { } else {
$html_title .= ' 입력'; $html_title .= ' 입력';
$co = array( $co = array(
+2
View File
@@ -624,6 +624,7 @@ a.lg_btn{display:inline-block;margin:5px 0 0;padding:5px 10px;background:#ED008C
a.kg_btn{display:inline-block;margin:5px 0 0;padding:5px 10px;background:#4A2C7C;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.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.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}
.scf_cardtest {margin:5px 0 0} .scf_cardtest {margin:5px 0 0}
.scf_cardtest_btn {margin-left:5px;vertical-align:middle} .scf_cardtest_btn {margin-left:5px;vertical-align:middle}
@@ -666,6 +667,7 @@ ul.de_pg_tab li.tab-current a{background:#2CC185;color:#fff}
.inicis_info_fld th{background-color:#F6F1FF} .inicis_info_fld th{background-color:#F6F1FF}
.kakao_info_fld th{background-color:#FFFCED} .kakao_info_fld th{background-color:#FFFCED}
.naver_info_fld th{background-color:#F3FFF3} .naver_info_fld th{background-color:#F3FFF3}
.nicepay_info_fld th{background-color:#d1e6ff}
/* 주문내역 */ /* 주문내역 */
#sodr_list td {text-align:center} #sodr_list td {text-align:center}
+51 -1
View File
@@ -205,6 +205,14 @@ if (defined('G5_USE_SHOP') && G5_USE_SHOP) {
break; 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 컬럼 크기 조정 // auth.au_menu 컬럼 크기 조정
@@ -212,13 +220,55 @@ $sql = " SHOW COLUMNS FROM `{$g5['auth_table']}` LIKE 'au_menu' ";
$row = sql_fetch($sql); $row = sql_fetch($sql);
if ( if (
stripos($row['Type'], 'varchar') !== false stripos($row['Type'], 'varchar') !== false
&& (int) preg_replace('/[^0-9]/', '', $row['Type']) <= 50 && (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); sql_query(" ALTER TABLE `{$g5['auth_table']}` CHANGE `au_menu` `au_menu` VARCHAR(50) NOT NULL; ", true);
$is_check = 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;
}
}
$is_check = run_replace('admin_dbupgrade', $is_check); $is_check = run_replace('admin_dbupgrade', $is_check);
$db_upgrade_msg = $is_check ? 'DB 업그레이드가 완료되었습니다.' : '더 이상 업그레이드 할 내용이 없습니다.<br>현재 DB 업그레이드가 완료된 상태입니다.'; $db_upgrade_msg = $is_check ? 'DB 업그레이드가 완료되었습니다.' : '더 이상 업그레이드 할 내용이 없습니다.<br>현재 DB 업그레이드가 완료된 상태입니다.';
+1 -1
View File
@@ -205,7 +205,7 @@ if (isset($mb_id) && $mb_id) {
if ($mb['mb_intercept_date']) { if ($mb['mb_intercept_date']) {
$g5['title'] = "차단된 "; $g5['title'] = "차단된 ";
} else { } else {
$g5['title'] .= ""; $g5['title'] = "";
} }
$g5['title'] .= '회원 ' . $html_title; $g5['title'] .= '회원 ' . $html_title;
require_once './admin.head.php'; require_once './admin.head.php';
+3 -1
View File
@@ -12,6 +12,7 @@ require_once './admin.head.php';
if (!sql_query(" DESCRIBE `{$g5['qa_config_table']}` ", false)) { if (!sql_query(" DESCRIBE `{$g5['qa_config_table']}` ", false)) {
sql_query( sql_query(
" CREATE TABLE IF NOT EXISTS `{$g5['qa_config_table']}` ( " 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_title` varchar(255) NOT NULL DEFAULT'',
`qa_category` varchar(255) NOT NULL DEFAULT'', `qa_category` varchar(255) NOT NULL DEFAULT'',
`qa_skin` varchar(255) NOT NULL DEFAULT '', `qa_skin` varchar(255) NOT NULL DEFAULT '',
@@ -46,7 +47,8 @@ if (!sql_query(" DESCRIBE `{$g5['qa_config_table']}` ", false)) {
`qa_2` varchar(255) NOT NULL DEFAULT '', `qa_2` varchar(255) NOT NULL DEFAULT '',
`qa_3` varchar(255) NOT NULL DEFAULT '', `qa_3` varchar(255) NOT NULL DEFAULT '',
`qa_4` varchar(255) NOT NULL DEFAULT '', `qa_4` varchar(255) NOT NULL DEFAULT '',
`qa_5` varchar(255) NOT NULL DEFAULT '' `qa_5` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`qa_id`)
)", )",
true true
); );
+17
View File
@@ -133,6 +133,8 @@ function pg_setting_check($is_print=false){
$pg_msg = 'LG유플러스'; $pg_msg = 'LG유플러스';
} else if ( $default['de_pg_service'] === 'inicis' && $default['de_inicis_mid'] && $default['de_inicis_sign_key'] ){ } else if ( $default['de_pg_service'] === 'inicis' && $default['de_inicis_mid'] && $default['de_inicis_sign_key'] ){
$pg_msg = 'KG이니시스'; $pg_msg = 'KG이니시스';
} else if ( $default['de_pg_service'] === 'nicepay' && $default['de_nicepay_mid'] && $default['de_nicepay_key'] ){
$pg_msg = 'NICEPAY';
} }
} }
@@ -156,6 +158,21 @@ function pg_setting_check($is_print=false){
} }
} }
function is_cancel_shop_pg_order($od){
$is_od_pg_cancel = false;
if (($od['od_settle_case'] == '신용카드' || $od['od_settle_case'] == '간편결제' || $od['od_settle_case'] == 'KAKAOPAY') || ($od['od_pg'] == 'inicis' && is_inicis_order_pay($od['od_settle_case']))) {
$is_od_pg_cancel = true;
}
if ($od['od_pg'] === 'nicepay' && in_array($od['od_settle_case'], array('계좌이체', '휴대폰'))) {
$is_od_pg_cancel = true;
}
return $is_od_pg_cancel;
}
function check_order_inicis_tmps(){ function check_order_inicis_tmps(){
global $g5, $config, $default, $member; global $g5, $config, $default, $member;
+54 -3
View File
@@ -207,6 +207,14 @@ if( ! isset($default['de_inicis_iniapi_key']) ){
sql_query($sql, false); 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);
}
if( function_exists('pg_setting_check') ){ if( function_exists('pg_setting_check') ){
pg_setting_check(true); pg_setting_check(true);
} }
@@ -633,6 +641,12 @@ if(!$default['de_kakaopay_cancelpwd']){
<?php echo help("KG이니시스 가상계좌 사용시 다음 주소를 <strong><a href=\"https://iniweb.inicis.com/\" target=\"_blank\">KG이니시스 관리자</a> &gt; 거래내역 &gt; 가상계좌 &gt; 입금통보방식선택 &gt; URL 수신 설정</strong>에 넣으셔야 상점에 자동으로 입금 통보됩니다."); ?> <?php echo help("KG이니시스 가상계좌 사용시 다음 주소를 <strong><a href=\"https://iniweb.inicis.com/\" target=\"_blank\">KG이니시스 관리자</a> &gt; 거래내역 &gt; 가상계좌 &gt; 입금통보방식선택 &gt; URL 수신 설정</strong>에 넣으셔야 상점에 자동으로 입금 통보됩니다."); ?>
<?php echo G5_SHOP_URL; ?>/settle_inicis_common.php</td> <?php echo G5_SHOP_URL; ?>/settle_inicis_common.php</td>
</tr> </tr>
<tr id="nicepay_vbank_url" class="pg_vbank_url">
<th scope="row">NICEPAY 가상계좌 입금통보 URL</th>
<td>
<?php echo help("NICEPAY 가상계좌 사용시 다음 주소를 <strong><a href=\"https://npg.nicepay.co.kr/\" target=\"_blank\">NICEPAY 관리자</a> &gt; 가맹점관리자페이지 설정 (메인화면 → 가맹점정보 클릭)</strong>에 넣으셔야 상점에 자동으로 입금 통보됩니다."); ?>
<?php echo G5_SHOP_URL; ?>/settle_nicepay_common.php</td>
</tr>
<tr> <tr>
<th scope="row"><label for="de_hp_use">휴대폰결제사용</label></th> <th scope="row"><label for="de_hp_use">휴대폰결제사용</label></th>
<td> <td>
@@ -763,6 +777,7 @@ if(!$default['de_kakaopay_cancelpwd']){
<li class="<?php if($default['de_pg_service'] == 'kcp') echo 'tab-current'; ?>"><a href="#kcp_info_anchor" data-value="kcp" title="NHN KCP 선택하기" >NHN KCP</a></li> <li class="<?php if($default['de_pg_service'] == 'kcp') echo 'tab-current'; ?>"><a href="#kcp_info_anchor" data-value="kcp" title="NHN KCP 선택하기" >NHN KCP</a></li>
<li class="<?php if($default['de_pg_service'] == 'lg') echo 'tab-current'; ?>"><a href="#lg_info_anchor" data-value="lg" title="토스페이먼츠 선택하기">토스페이먼츠</a></li> <li class="<?php if($default['de_pg_service'] == 'lg') echo 'tab-current'; ?>"><a href="#lg_info_anchor" data-value="lg" title="토스페이먼츠 선택하기">토스페이먼츠</a></li>
<li class="<?php if($default['de_pg_service'] == 'inicis') echo 'tab-current'; ?>"><a href="#inicis_info_anchor" data-value="inicis" title="KG이니시스 선택하기">KG이니시스</a></li> <li class="<?php if($default['de_pg_service'] == 'inicis') echo 'tab-current'; ?>"><a href="#inicis_info_anchor" data-value="inicis" title="KG이니시스 선택하기">KG이니시스</a></li>
<li class="<?php if($default['de_pg_service'] == 'nicepay') echo 'tab-current'; ?>"><a href="#nicepay_info_anchor" data-value="nicepay" title="NICEPAY 선택하기">NICEPAY</a></li>
</ul> </ul>
</td> </td>
</tr> </tr>
@@ -918,7 +933,7 @@ if(!$default['de_kakaopay_cancelpwd']){
</tr> </tr>
<tr class="kakao_info_fld"> <tr class="kakao_info_fld">
<th scope="row"> <th scope="row">
<label for="de_kakaopay_enckey">카카오페이 사용</label> <label for="de_kakaopay_enckey">KG이니시스<br>카카오페이 사용</label>
</th> </th>
<td> <td>
<?php echo help("체크시 카카오페이 (KG 이니시스)를 사용합니다. <br >KG 이니시스의 SIRK****** 아이디를 받은 상점만 해당됩니다.", 50); ?> <?php echo help("체크시 카카오페이 (KG 이니시스)를 사용합니다. <br >KG 이니시스의 SIRK****** 아이디를 받은 상점만 해당됩니다.", 50); ?>
@@ -932,6 +947,38 @@ if(!$default['de_kakaopay_cancelpwd']){
<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"> <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> </td>
</tr> </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/inicis_pg.php" target="_blank" id="scf_nicepay_reg" class="nicepay_btn">NICEPAY 신청하기</a></th>
<td>
<span class="frm_info">NICEPAY로 부터 발급 받으신 상점MID를 SR 을 제외한 나머지 자리를 입력 합니다.<br>NICEPAY 상점관리자 > 가맹점정보 > KEY관리에서 확인 할수 있습니다.<br>만약, 상점아이디가 SR로 시작하지 않는다면 계약담당자에게 변경 요청을 해주시기 바랍니다. 예) SRpaytestm</span>
<span class="sitecode">SR</span>
<input type="text" name="de_nicepay_mid" value="<?php echo get_sanitize_input($default['de_nicepay_mid']); ?>" id="de_nicepay_mid" class="frm_input" size="12" maxlength="12">
영문소문자(숫자포함 가능)
</td>
</tr>
<tr class="pg_info_fld nicepay_info_fld">
<th scope="row"><label for="de_nicepay_key">NICEPAY KEY</label></th>
<td>
<input type="text" name="de_nicepay_key" value="<?php echo get_sanitize_input($default['de_nicepay_key']); ?>" id="de_nicepay_key" class="frm_input" size="100" maxlength="100">
</td>
</tr>
<tr class="pg_info_fld nicepay_info_fld">
<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>
</td>
</tr>
<?php if (defined('G5_SHOP_DIRECT_NAVERPAY') && G5_SHOP_DIRECT_NAVERPAY) { ?> <?php if (defined('G5_SHOP_DIRECT_NAVERPAY') && G5_SHOP_DIRECT_NAVERPAY) { ?>
<tr class="naver_info_fld"> <tr class="naver_info_fld">
<th scope="row"> <th scope="row">
@@ -1020,8 +1067,8 @@ if(!$default['de_kakaopay_cancelpwd']){
<a href="http://testadmin8.kcp.co.kr/" target="_blank" class="btn_frmline">테스트 관리자</a> <a href="http://testadmin8.kcp.co.kr/" target="_blank" class="btn_frmline">테스트 관리자</a>
</div> </div>
<div class="scf_cardtest lg_cardtest"> <div class="scf_cardtest lg_cardtest">
<a href="https://pgweb.uplus.co.kr/" target="_blank" class="btn_frmline">실결제 관리자</a> <a href="https://pgweb.tosspayments.com/" target="_blank" class="btn_frmline">실결제 관리자</a>
<a href="https://pgweb.uplus.co.kr/tmert" target="_blank" class="btn_frmline">테스트 관리자</a> <a href="https://pgweb.tosspayments.com/tmert" target="_blank" class="btn_frmline">테스트 관리자</a>
</div> </div>
<div class="scf_cardtest inicis_cardtest"> <div class="scf_cardtest inicis_cardtest">
<a href="https://iniweb.inicis.com/" target="_blank" class="btn_frmline">상점 관리자</a> <a href="https://iniweb.inicis.com/" target="_blank" class="btn_frmline">상점 관리자</a>
@@ -1728,6 +1775,10 @@ function fconfig_check(f)
if( f.de_inicis_mid.value && f.de_inicis_sign_key.value && parseInt(f.de_card_test.value) > 0 ){ if( f.de_inicis_mid.value && f.de_inicis_sign_key.value && parseInt(f.de_card_test.value) > 0 ){
pg_msg = "KG이니시스"; pg_msg = "KG이니시스";
} }
} else if ( f.de_pg_service.value == "nicepay" ) {
if( f.de_nicepay_mid.value && f.de_nicepay_key.value && parseInt(f.de_card_test.value) > 0 ){
pg_msg = "NICEPAY";
}
} }
if( pg_msg ){ if( pg_msg ){
+7 -3
View File
@@ -28,8 +28,8 @@ if ($_FILES['mobile_logo_img2']['name']) upload_file($_FILES['mobile_logo_img2']
$de_kcp_mid = isset($_POST['de_kcp_mid']) ? substr($_POST['de_kcp_mid'], 0, 3) : ''; $de_kcp_mid = isset($_POST['de_kcp_mid']) ? substr($_POST['de_kcp_mid'], 0, 3) : '';
$cf_icode_server_port = isset($cf_icode_server_port) ? preg_replace('/[^0-9]/', '', $cf_icode_server_port) : '7295'; $cf_icode_server_port = isset($cf_icode_server_port) ? preg_replace('/[^0-9]/', '', $cf_icode_server_port) : '7295';
$de_shop_skin = isset($_POST['de_shop_skin']) ? preg_replace('#\.+(\/|\\\)#', '', $_POST['de_shop_skin']) : 'basic'; $de_shop_skin = isset($_POST['de_shop_skin']) ? preg_replace(array('#\.+(\/|\\\)#', '#[\'\"]#'), array('', ''), $_POST['de_shop_skin']) : 'basic';
$de_shop_mobile_skin = isset($_POST['de_shop_mobile_skin']) ? preg_replace('#\.+(\/|\\\)#', '', $_POST['de_shop_mobile_skin']) : 'basic'; $de_shop_mobile_skin = isset($_POST['de_shop_mobile_skin']) ? preg_replace(array('#\.+(\/|\\\)#', '#[\'\"]#'), array('', ''), $_POST['de_shop_mobile_skin']) : 'basic';
$skins = get_skin_dir('shop'); $skins = get_skin_dir('shop');
@@ -59,7 +59,7 @@ $de_shop_mobile_skin = in_array($de_shop_mobile_skin, $mobile_skins) ? $de_shop_
$check_skin_keys = array('de_type1_list_skin', 'de_type2_list_skin', 'de_type3_list_skin', 'de_type4_list_skin', 'de_type5_list_skin', 'de_mobile_type1_list_skin', 'de_mobile_type2_list_skin', 'de_mobile_type3_list_skin', 'de_mobile_type4_list_skin', 'de_mobile_type5_list_skin', 'de_rel_list_skin', 'de_mobile_rel_list_skin', 'de_search_list_skin', 'de_mobile_search_list_skin', 'de_listtype_list_skin', 'de_mobile_listtype_list_skin'); $check_skin_keys = array('de_type1_list_skin', 'de_type2_list_skin', 'de_type3_list_skin', 'de_type4_list_skin', 'de_type5_list_skin', 'de_mobile_type1_list_skin', 'de_mobile_type2_list_skin', 'de_mobile_type3_list_skin', 'de_mobile_type4_list_skin', 'de_mobile_type5_list_skin', 'de_rel_list_skin', 'de_mobile_rel_list_skin', 'de_search_list_skin', 'de_mobile_search_list_skin', 'de_listtype_list_skin', 'de_mobile_listtype_list_skin');
foreach($check_skin_keys as $key){ foreach($check_skin_keys as $key){
$$key = $_POST[$key] = isset($_POST[$key]) ? preg_replace('#\.+(\/|\\\)#', '', strip_tags($_POST[$key])) : ''; $$key = $_POST[$key] = isset($_POST[$key]) ? preg_replace(array('#\.+(\/|\\\)#', '#[\'\"]#'), array('', ''), strip_tags($_POST[$key])) : '';
if( isset($_POST[$key]) && preg_match('#\.+(\/|\\\)#', $_POST[$key]) ){ if( isset($_POST[$key]) && preg_match('#\.+(\/|\\\)#', $_POST[$key]) ){
alert('스킨설정에 유효하지 문자가 포함되어 있습니다.'); alert('스킨설정에 유효하지 문자가 포함되어 있습니다.');
@@ -167,6 +167,8 @@ $check_sanitize_keys = array(
'de_inicis_lpay_use', //KG이니시스 Lpay 사용 'de_inicis_lpay_use', //KG이니시스 Lpay 사용
'de_inicis_kakaopay_use', //KG이니시스 카카오페이 사용 'de_inicis_kakaopay_use', //KG이니시스 카카오페이 사용
'de_inicis_cartpoint_use', //KG이니시스 신용카드 포인트 결제 'de_inicis_cartpoint_use', //KG이니시스 신용카드 포인트 결제
'de_nicepay_mid', //NICEPAY 상점아이디
'de_nicepay_key', //NICEPAY 상점키
'de_kakaopay_mid', //카카오페이 상점MID 'de_kakaopay_mid', //카카오페이 상점MID
'de_kakaopay_key', //카카오페이 상점키 'de_kakaopay_key', //카카오페이 상점키
'de_kakaopay_enckey', //카카오페이 상점 EncKey 'de_kakaopay_enckey', //카카오페이 상점 EncKey
@@ -377,6 +379,8 @@ $sql = " update {$g5['g5_shop_default_table']}
de_inicis_lpay_use = '{$de_inicis_lpay_use}', de_inicis_lpay_use = '{$de_inicis_lpay_use}',
de_inicis_kakaopay_use = '{$de_inicis_kakaopay_use}', de_inicis_kakaopay_use = '{$de_inicis_kakaopay_use}',
de_inicis_cartpoint_use = '{$de_inicis_cartpoint_use}', de_inicis_cartpoint_use = '{$de_inicis_cartpoint_use}',
de_nicepay_mid = '{$de_nicepay_mid}',
de_nicepay_key = '{$de_nicepay_key}',
de_card_noint_use = '{$de_card_noint_use}', de_card_noint_use = '{$de_card_noint_use}',
de_card_point = '{$de_card_point}', de_card_point = '{$de_card_point}',
de_settle_min_point = '{$de_settle_min_point}', de_settle_min_point = '{$de_settle_min_point}',
+2
View File
@@ -184,6 +184,8 @@ $sql = " update {$g5['g5_shop_item_table']}
where it_id = '$new_it_id' "; where it_id = '$new_it_id' ";
sql_query($sql); sql_query($sql);
if( function_exists('shop_seo_title_update') ) shop_seo_title_update($new_it_id, true);
/** /**
* 아이템 복사 처리 후 Event Hook * 아이템 복사 처리 후 Event Hook
* @var string $it_id 원본 아이템 ID * @var string $it_id 원본 아이템 ID
+2 -2
View File
@@ -41,8 +41,8 @@ if ($ev_mimg_del) @unlink(G5_DATA_PATH."/event/{$ev_id}_m");
if ($ev_himg_del) @unlink(G5_DATA_PATH."/event/{$ev_id}_h"); if ($ev_himg_del) @unlink(G5_DATA_PATH."/event/{$ev_id}_h");
if ($ev_timg_del) @unlink(G5_DATA_PATH."/event/{$ev_id}_t"); if ($ev_timg_del) @unlink(G5_DATA_PATH."/event/{$ev_id}_t");
$ev_skin = preg_replace('#\.+(\/|\\\)#', '', $ev_skin); $ev_skin = preg_replace(array('#\.+(\/|\\\)#', '#[\'\"]#'), array('', ''), $ev_skin);
$ev_mobile_skin = preg_replace('#\.+(\/|\\\)#', '', $ev_mobile_skin); $ev_mobile_skin = preg_replace(array('#\.+(\/|\\\)#', '#[\'\"]#'), array('', ''), $ev_mobile_skin);
$skin_regex_patten = "^list.[0-9]+\.skin\.php"; $skin_regex_patten = "^list.[0-9]+\.skin\.php";
+2
View File
@@ -112,6 +112,8 @@ else if ($w == "u")
if(!$it) if(!$it)
alert('상품정보가 존재하지 않습니다.'); alert('상품정보가 존재하지 않습니다.');
if (function_exists('check_case_exist_title')) check_case_exist_title($it, G5_SHOP_DIR, false);
if (! (isset($ca_id) && $ca_id)) if (! (isset($ca_id) && $ca_id))
$ca_id = $it['ca_id']; $ca_id = $it['ca_id'];
+2 -2
View File
@@ -285,8 +285,8 @@ if($supply_count) {
$value_array = array(); $value_array = array();
$count_ii_article = (isset($_POST['ii_article']) && is_array($_POST['ii_article'])) ? count($_POST['ii_article']) : 0; $count_ii_article = (isset($_POST['ii_article']) && is_array($_POST['ii_article'])) ? count($_POST['ii_article']) : 0;
for($i=0; $i<$count_ii_article; $i++) { for($i=0; $i<$count_ii_article; $i++) {
$key = isset($_POST['ii_article'][$i]) ? strip_tags($_POST['ii_article'][$i], '<br><span><strong><b>') : ''; $key = isset($_POST['ii_article'][$i]) ? html_purifier($_POST['ii_article'][$i]) : '';
$val = isset($_POST['ii_value'][$i]) ? strip_tags($_POST['ii_value'][$i], '<br><span><strong><b>') : ''; $val = isset($_POST['ii_value'][$i]) ? html_purifier($_POST['ii_value'][$i]) : '';
$value_array[$key] = $val; $value_array[$key] = $val;
} }
$it_info_value = addslashes(serialize($value_array)); $it_info_value = addslashes(serialize($value_array));
+4
View File
@@ -4,6 +4,10 @@ include_once('./_common.php');
auth_check_menu($auth, $sub_menu, "r"); auth_check_menu($auth, $sub_menu, "r");
if (isset($sfl) && $sfl && !in_array($sfl, array('it_name','it_id','it_maker','it_brand','it_model','it_origin','it_sell_email'))) {
$sfl = '';
}
$g5['title'] = '상품관리'; $g5['title'] = '상품관리';
include_once (G5_ADMIN_PATH.'/admin.head.php'); include_once (G5_ADMIN_PATH.'/admin.head.php');
+4
View File
@@ -4,6 +4,10 @@ include_once('./_common.php');
auth_check_menu($auth, $sub_menu, "r"); auth_check_menu($auth, $sub_menu, "r");
if (isset($sfl) && $sfl && !in_array($sfl, array('it_name','a.it_id'))) {
$sfl = '';
}
$g5['title'] = '상품문의'; $g5['title'] = '상품문의';
include_once (G5_ADMIN_PATH.'/admin.head.php'); include_once (G5_ADMIN_PATH.'/admin.head.php');
+2 -3
View File
@@ -35,7 +35,7 @@ $sql_common .= $sql_search;
// 테이블의 전체 레코드수만 얻음 // 테이블의 전체 레코드수만 얻음
$sql = " select count(*) as cnt " . $sql_common; $sql = " select count(*) as cnt " . $sql_common;
$row = sql_fetch($sql); $row = sql_fetch($sql);
$total_count = $row['cnt']; $total_count = isset($row['cnt']) ? $row['cnt'] : 0;
$rows = $config['cf_page_rows']; $rows = $config['cf_page_rows'];
$total_page = ceil($total_count / $rows); // 전체 페이지 계산 $total_page = ceil($total_count / $rows); // 전체 페이지 계산
@@ -159,7 +159,6 @@ $listall = '<a href="'.$_SERVER['SCRIPT_NAME'].'" class="ov_listall">전체목
$it_stock_qty_st = ''; // 스타일 정의 $it_stock_qty_st = ''; // 스타일 정의
if($row['it_stock_qty'] <= $row['it_noti_qty']) { if($row['it_stock_qty'] <= $row['it_noti_qty']) {
$it_stock_qty_st = ' sit_stock_qty_alert'; $it_stock_qty_st = ' sit_stock_qty_alert';
$it_stock_qty = ''.$it_stock_qty.' !<span class="sound_only"> 재고부족 </span>';
} }
$bg = 'bg'.($i%2); $bg = 'bg'.($i%2);
@@ -171,7 +170,7 @@ $listall = '<a href="'.$_SERVER['SCRIPT_NAME'].'" class="ov_listall">전체목
<?php echo $row['it_id']; ?> <?php echo $row['it_id']; ?>
</td> </td>
<td class="td_left"><a href="<?php echo $href; ?>"><?php echo get_it_image($row['it_id'], 50, 50); ?> <?php echo cut_str(stripslashes($row['it_name']), 60, "&#133"); ?></a></td> <td class="td_left"><a href="<?php echo $href; ?>"><?php echo get_it_image($row['it_id'], 50, 50); ?> <?php echo cut_str(stripslashes($row['it_name']), 60, "&#133"); ?></a></td>
<td class="td_num<?php echo $it_stock_qty_st; ?>"><?php echo (int)$it_stock_qty; ?></td> <td class="td_num<?php echo $it_stock_qty_st; ?>"><?php echo $it_stock_qty; ?></td>
<td class="td_num"><?php echo number_format((float)$wait_qty); ?></td> <td class="td_num"><?php echo number_format((float)$wait_qty); ?></td>
<td class="td_num"><?php echo number_format((float)$temporary_qty); ?></td> <td class="td_num"><?php echo number_format((float)$temporary_qty); ?></td>
<td class="td_num"> <td class="td_num">
+4
View File
@@ -4,6 +4,10 @@ include_once('./_common.php');
auth_check_menu($auth, $sub_menu, "r"); auth_check_menu($auth, $sub_menu, "r");
if (isset($sfl) && $sfl && !in_array($sfl, array('it_name','a.it_id','is_name'))) {
$sfl = '';
}
$g5['title'] = '사용후기'; $g5['title'] = '사용후기';
include_once (G5_ADMIN_PATH.'/admin.head.php'); include_once (G5_ADMIN_PATH.'/admin.head.php');
+26 -4
View File
@@ -107,6 +107,12 @@ if($od['od_pg'] == 'lg') {
} }
} }
$print_od_deposit_name = $od['od_deposit_name'];
// nicepay 로 주문하고 가상계좌인 경우
if ($od['od_pg'] === 'nicepay' && $od['od_settle_case'] === '가상계좌' && $od['od_deposit_name']){
$print_od_deposit_name .= '_NICE';
}
// add_javascript('js 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨 // add_javascript('js 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
?> ?>
@@ -408,7 +414,7 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
</tr> </tr>
<tr> <tr>
<th scope="row">입금자</th> <th scope="row">입금자</th>
<td><?php echo get_text($od['od_deposit_name']); ?></td> <td><?php echo get_text($print_od_deposit_name); ?></td>
</tr> </tr>
<tr> <tr>
<th scope="row">입금확인일시</th> <th scope="row">입금확인일시</th>
@@ -504,10 +510,10 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
if ($od['od_settle_case'] != '무통장') { if ($od['od_settle_case'] != '무통장') {
switch($od['od_pg']) { switch($od['od_pg']) {
case 'lg': case 'lg':
$pg_url = 'http://pgweb.uplus.co.kr'; $pg_url = 'http://pgweb.tosspayments.com';
$pg_test = '토스페이먼츠'; $pg_test = '토스페이먼츠';
if ($default['de_card_test']) { if ($default['de_card_test']) {
$pg_url = 'http://pgweb.uplus.co.kr/tmert'; $pg_url = 'http://pgweb.tosspayments.com/tmert';
$pg_test .= ' 테스트 '; $pg_test .= ' 테스트 ';
} }
break; break;
@@ -519,6 +525,10 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
$pg_url = 'https://mms.cnspay.co.kr'; $pg_url = 'https://mms.cnspay.co.kr';
$pg_test = 'KAKAOPAY'; $pg_test = 'KAKAOPAY';
break; break;
case 'nicepay':
$pg_url = 'https://npg.nicepay.co.kr/';
$pg_test = 'NICEPAY';
break;
default: default:
$pg_url = 'http://admin8.kcp.co.kr'; $pg_url = 'http://admin8.kcp.co.kr';
$pg_test = 'KCP'; $pg_test = 'KCP';
@@ -623,6 +633,18 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
} else if($od['od_pg'] == 'inicis') { } else if($od['od_pg'] == 'inicis') {
$cash = unserialize($od['od_cash_info']); $cash = unserialize($od['od_cash_info']);
$cash_receipt_script = 'window.open(\'https://iniweb.inicis.com/DefaultWebApp/mall/cr/cm/Cash_mCmReceipt.jsp?noTid='.$cash['TID'].'&clpaymethod=22\',\'showreceipt\',\'width=380,height=540,scrollbars=no,resizable=no\');'; $cash_receipt_script = 'window.open(\'https://iniweb.inicis.com/DefaultWebApp/mall/cr/cm/Cash_mCmReceipt.jsp?noTid='.$cash['TID'].'&clpaymethod=22\',\'showreceipt\',\'width=380,height=540,scrollbars=no,resizable=no\');';
} else if($od['od_pg'] == 'nicepay') {
$od_tid = $od['od_tno'];
$cash_type = 0;
if (! $od_tid) {
$cash = unserialize($od['od_cash_info']);
$od_tid = isset($cash['TID']) ? $cash['TID'] : '';
$cash_type = $od_tid ? 1 : 0;
}
$cash_receipt_script = 'window.open(\'https://npg.nicepay.co.kr/issue/IssueLoader.do?type='.$cash_type.'&TID='.$od_tid.'&noMethod=1\',\'receipt\',\'width=430,height=700\');';
} else { } else {
require G5_SHOP_PATH.'/settle_kcp.inc.php'; require G5_SHOP_PATH.'/settle_kcp.inc.php';
@@ -1075,7 +1097,7 @@ function form_submit(f)
var msg = ""; var msg = "";
<?php if($od['od_settle_case'] == '신용카드' || $od['od_settle_case'] == 'KAKAOPAY' || $od['od_settle_case'] == '간편결제' || ($od['od_pg'] == 'inicis' && is_inicis_order_pay($od['od_settle_case']) )) { ?> <?php if (is_cancel_shop_pg_order($od)) { ?>
if(status == "취소" || status == "반품" || status == "품절") { if(status == "취소" || status == "반품" || status == "품절") {
var $ct_chk = $("input[name^=ct_chk]"); var $ct_chk = $("input[name^=ct_chk]");
var chk_cnt = $ct_chk.length; var chk_cnt = $ct_chk.length;
+28 -2
View File
@@ -191,7 +191,7 @@ if (in_array($_POST['ct_status'], $status_cancel)) {
$sql = " select * from {$g5['g5_shop_order_table']} where od_id = '$od_id' "; $sql = " select * from {$g5['g5_shop_order_table']} where od_id = '$od_id' ";
$od = sql_fetch($sql); $od = sql_fetch($sql);
if($od['od_tno'] && ($od['od_settle_case'] == '신용카드' || $od['od_settle_case'] == '간편결제' || $od['od_settle_case'] == 'KAKAOPAY') || ($od['od_pg'] == 'inicis' && is_inicis_order_pay($od['od_settle_case']) )) { if ($od['od_tno'] && is_cancel_shop_pg_order($od)) {
switch($od['od_pg']) { switch($od['od_pg']) {
case 'lg': case 'lg':
include_once(G5_SHOP_PATH.'/settle_lg.inc.php'); include_once(G5_SHOP_PATH.'/settle_lg.inc.php');
@@ -243,6 +243,32 @@ if (in_array($_POST['ct_status'], $status_cancel)) {
$pg_res_msg = 'curl 로 데이터를 받지 못했습니다.'; $pg_res_msg = 'curl 로 데이터를 받지 못했습니다.';
} }
break;
case 'nicepay':
include_once(G5_SHOP_PATH.'/settle_nicepay.inc.php');
$cancel_msg = '쇼핑몰 운영자 승인 취소';
$tno = $od['od_tno'];
$cancelAmt = $od['od_receipt_price'];
// 0:전체 취소, 1:부분 취소(별도 계약 필요)
$partialCancelCode = 0;
include G5_SHOP_PATH.'/nicepay/cancel_process.php';
if (isset($result['ResultCode'])) {
// 실패했다면
if ($result['ResultCode'] !== '2001') {
$pg_res_cd = $result['ResultCode'];
$pg_res_msg = $result['ResultMsg'];
}
} else {
$pg_res_cd = '';
$pg_res_msg = 'curl 로 데이터를 받지 못하거나 통신에 실패했습니다.';
}
break; break;
case 'KAKAOPAY': case 'KAKAOPAY':
include_once(G5_SHOP_PATH.'/settle_kakaopay.inc.php'); include_once(G5_SHOP_PATH.'/settle_kakaopay.inc.php');
@@ -296,7 +322,7 @@ if (in_array($_POST['ct_status'], $status_cancel)) {
// PG 취소요청 성공했으면 // PG 취소요청 성공했으면
if($pg_res_cd == '') { if($pg_res_cd == '') {
$pg_cancel_log = ' PG 신용카드 승인취소 처리'; $pg_cancel_log = ' PG '.$od['od_settle_case'].' 승인취소 처리';
$sql = " update {$g5['g5_shop_order_table']} $sql = " update {$g5['g5_shop_order_table']}
set od_refund_price = '{$od['od_receipt_price']}' set od_refund_price = '{$od['od_receipt_price']}'
where od_id = '$od_id' "; where od_id = '$od_id' ";
+3 -3
View File
@@ -49,7 +49,7 @@ if ($csv == 'csv')
$to_date = date_conv($to_date); $to_date = date_conv($to_date);
$sql = " SELECT a.od_id, od_b_zip1, od_b_zip2, od_b_addr1, od_b_addr2, od_b_addr3, od_b_addr_jibeon, od_b_name, od_b_tel, od_b_hp, b.it_name, ct_qty, b.it_id, a.od_id, od_memo, od_invoice, b.ct_option, b.ct_send_cost, b.it_sc_type $sql = " SELECT a.od_id, od_b_zip1, od_b_zip2, od_b_addr1, od_b_addr2, od_b_addr3, od_b_addr_jibeon, od_b_name, od_b_tel, od_b_hp, b.it_name, ct_qty, b.it_id, od_memo, od_invoice, b.ct_option, b.ct_send_cost, b.it_sc_type
FROM {$g5['g5_shop_order_table']} a, {$g5['g5_shop_cart_table']} b FROM {$g5['g5_shop_order_table']} a, {$g5['g5_shop_cart_table']} b
where a.od_id = b.od_id "; where a.od_id = b.od_id ";
if ($case == 1) // 출력기간 if ($case == 1) // 출력기간
@@ -65,7 +65,7 @@ if ($csv == 'csv')
alert("출력할 내역이 없습니다."); alert("출력할 내역이 없습니다.");
//header('Content-Type: text/x-csv'); //header('Content-Type: text/x-csv');
header("Content-charset=utf-8"); header("Content-Type: text/csv; charset=utf-8");
header('Content-Type: doesn/matter'); header('Content-Type: doesn/matter');
header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT'); header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Content-Disposition: attachment; filename="orderlist-' . date("ymd", time()) . '.csv"'); header('Content-Disposition: attachment; filename="orderlist-' . date("ymd", time()) . '.csv"');
@@ -153,7 +153,7 @@ if ($csv == 'xls')
$fr_date = date_conv($fr_date); $fr_date = date_conv($fr_date);
$to_date = date_conv($to_date); $to_date = date_conv($to_date);
$sql = " SELECT a.od_id, od_b_zip1, od_b_zip2, od_b_addr1, od_b_addr2, od_b_addr3, od_b_addr_jibeon, od_b_name, od_b_tel, od_b_hp, b.it_name, ct_qty, b.it_id, a.od_id, od_memo, od_invoice, b.ct_option, b.ct_send_cost, b.it_sc_type $sql = " SELECT a.od_id, od_b_zip1, od_b_zip2, od_b_addr1, od_b_addr2, od_b_addr3, od_b_addr_jibeon, od_b_name, od_b_tel, od_b_hp, b.it_name, ct_qty, b.it_id, od_memo, od_invoice, b.ct_option, b.ct_send_cost, b.it_sc_type
FROM {$g5['g5_shop_order_table']} a, {$g5['g5_shop_cart_table']} b FROM {$g5['g5_shop_order_table']} a, {$g5['g5_shop_cart_table']} b
where a.od_id = b.od_id "; where a.od_id = b.od_id ";
if ($case == 1) // 출력기간 if ($case == 1) // 출력기간
+6
View File
@@ -44,6 +44,12 @@ if($popup == 'yes') { // 팝업창일 때
$pp['pp_price'] = $od['od_misu']; $pp['pp_price'] = $od['od_misu'];
$wrp_tag_st = '<div class="new_win">'.PHP_EOL.'<h1 id="new_win_title">'.$html_title.'</h1>'; $wrp_tag_st = '<div class="new_win">'.PHP_EOL.'<h1 id="new_win_title">'.$html_title.'</h1>';
$wrp_tag_end = '</div>'; $wrp_tag_end = '</div>';
echo '<script>
if (typeof g5_admin_csrf_token_key === "undefined") {
var g5_admin_csrf_token_key = "' . (function_exists('admin_csrf_token_key') ? admin_csrf_token_key() : '') . '";
}
</script>';
} }
else { // 현재페이지일 때 else { // 현재페이지일 때
include_once (G5_ADMIN_PATH.'/admin.head.php'); include_once (G5_ADMIN_PATH.'/admin.head.php');
+2 -2
View File
@@ -4,8 +4,8 @@ include_once('./_common.php');
if (!$is_member) die('0'); if (!$is_member) die('0');
$uid = isset($_REQUEST['uid']) ? preg_replace('/[^0-9]/', '', $_REQUEST['uid']) : 0; $uid = isset($_REQUEST['uid']) ? preg_replace('/[^0-9]/', '', $_REQUEST['uid']) : 0;
$subject = isset($_REQUEST['subject']) ? trim($_REQUEST['subject']) : ''; $subject = isset($_REQUEST['subject']) ? preg_replace("#[\\\]+$#", "", substr(trim($_POST['subject']),0,255)) : '';
$content = isset($_REQUEST['content']) ? trim($_REQUEST['content']) : ''; $content = isset($_REQUEST['content']) ? preg_replace("#[\\\]+$#", "", substr(trim($_POST['content']),0,65536)) : '';
if ($subject && $content) { if ($subject && $content) {
$sql = " select count(*) as cnt from {$g5['autosave_table']} where mb_id = '{$member['mb_id']}' and as_subject = '$subject' and as_content = '$content' "; $sql = " select count(*) as cnt from {$g5['autosave_table']} where mb_id = '{$member['mb_id']}' and as_subject = '$subject' and as_content = '$content' ";
-1
View File
@@ -8,7 +8,6 @@ if( function_exists('social_check_login_before') ){
$g5['title'] = '로그인'; $g5['title'] = '로그인';
include_once('./_head.sub.php'); include_once('./_head.sub.php');
$url = isset($_GET['url']) ? strip_tags($_GET['url']) : '';
$od_id = isset($_POST['od_id']) ? safe_replace_regex($_POST['od_id'], 'od_id') : ''; $od_id = isset($_POST['od_id']) ? safe_replace_regex($_POST['od_id'], 'od_id') : '';
// url 체크 // url 체크
+9 -1
View File
@@ -147,8 +147,16 @@ if(function_exists('set_cart_id')){
cart_item_clean(); cart_item_clean();
set_cart_id(''); set_cart_id('');
$s_cart_id = get_session('ss_cart_id'); $s_cart_id = get_session('ss_cart_id');
$add_cart_where = '';
// 장바구니에서 주문하기를 하는 경우
if (strpos($link, 'orderform.php') !== false) {
$add_cart_where = " and ct_select_time < '".date('Y-m-d H:i:s', strtotime('-1 hour', G5_SERVER_TIME))."' ";
}
// 선택필드 초기화 // 선택필드 초기화
$sql = " update {$g5['g5_shop_cart_table']} set ct_select = '0' where od_id = '$s_cart_id' "; $sql = " update {$g5['g5_shop_cart_table']} set ct_select = '0' where od_id = '$s_cart_id' $add_cart_where ";
sql_query($sql); sql_query($sql);
} }
+5 -1
View File
@@ -19,7 +19,11 @@ if ($url) {
if ( substr($url, 0, 2) == '//' ) if ( substr($url, 0, 2) == '//' )
$url = 'http:' . $url; $url = 'http:' . $url;
$p = @parse_url(urldecode($url)); if (preg_match('#\\\0#', $url) || preg_match('/^\/{1,}\\\/', $url)) {
alert('url 에 올바르지 않은 값이 포함되어 있습니다.', G5_URL);
}
$p = @parse_url(urldecode(str_replace('\\', '', $url)));
/* /*
// OpenRediect 취약점관련, PHP 5.3 이하버전에서는 parse_url 버그가 있음 ( Safflower 님 제보 ) 아래 url 예제 // OpenRediect 취약점관련, PHP 5.3 이하버전에서는 parse_url 버그가 있음 ( Safflower 님 제보 ) 아래 url 예제
// http://localhost/bbs/logout.php?url=http://sir.kr%23@/ // http://localhost/bbs/logout.php?url=http://sir.kr%23@/
+4 -2
View File
@@ -4,8 +4,6 @@ include_once('./_common.php');
if ($is_guest) if ($is_guest)
alert('로그인 한 회원만 접근하실 수 있습니다.', G5_BBS_URL.'/login.php'); alert('로그인 한 회원만 접근하실 수 있습니다.', G5_BBS_URL.'/login.php');
$url = isset($_GET['url']) ? clean_xss_tags($_GET['url']) : '';
while (1) { while (1) {
$tmp = preg_replace('/&#[^;]+;/', '', $url); $tmp = preg_replace('/&#[^;]+;/', '', $url);
if ($tmp == $url) break; if ($tmp == $url) break;
@@ -31,6 +29,10 @@ if($url){
if( preg_match('#^/{3,}#', $url) ){ if( preg_match('#^/{3,}#', $url) ){
$url = preg_replace('#^/{3,}#', '/', $url); $url = preg_replace('#^/{3,}#', '/', $url);
} }
if (function_exists('safe_filter_url_host')) {
$url = safe_filter_url_host($url);
}
} }
$url = get_text($url); $url = get_text($url);
+9 -5
View File
@@ -14,24 +14,28 @@ $str_nick_list = '';
$msg = ''; $msg = '';
$error_list = array(); $error_list = array();
$member_list = array('id'=>array(), 'nick'=>array()); $member_list = array('id'=>array(), 'nick'=>array());
$me_memo = isset($_POST['me_memo']) ? preg_replace("#[\\\]+$#", "", substr(trim($_POST['me_memo']),0,65536)) : '';
run_event('memo_form_update_before', $recv_list); run_event('memo_form_update_before', $recv_list);
for ($i=0; $i<count($recv_list); $i++) { for ($i=0; $i<count($recv_list); $i++) {
$row = sql_fetch(" select mb_id, mb_nick, mb_open, mb_leave_date, mb_intercept_date from {$g5['member_table']} where mb_id = '{$recv_list[$i]}' ");
$recv_list_id = substr(preg_replace("/[^a-zA-Z0-9_]*/", "", $recv_list[$i]), 0, 20);
$row = sql_fetch(" select mb_id, mb_nick, mb_open, mb_leave_date, mb_intercept_date from {$g5['member_table']} where mb_id = '{$recv_list_id}' ");
if ($row) { if ($row) {
if ($is_admin || ($row['mb_open'] && (!$row['mb_leave_date'] && !$row['mb_intercept_date']))) { if ($is_admin || ($row['mb_open'] && (!$row['mb_leave_date'] && !$row['mb_intercept_date']))) {
$member_list['id'][] = $row['mb_id']; $member_list['id'][] = $row['mb_id'];
$member_list['nick'][] = $row['mb_nick']; $member_list['nick'][] = $row['mb_nick'];
} else { } else {
$error_list[] = $recv_list[$i]; $error_list[] = $recv_list_id;
} }
} }
/* /*
// 관리자가 아니면서 // 관리자가 아니면서
// 가입된 회원이 아니거나 정보공개를 하지 않았거나 탈퇴한 회원이거나 차단된 회원에게 쪽지를 보내는것은 에러 // 가입된 회원이 아니거나 정보공개를 하지 않았거나 탈퇴한 회원이거나 차단된 회원에게 쪽지를 보내는것은 에러
if ((!$row['mb_id'] || !$row['mb_open'] || $row['mb_leave_date'] || $row['mb_intercept_date']) && !$is_admin) { if ((!$row['mb_id'] || !$row['mb_open'] || $row['mb_leave_date'] || $row['mb_intercept_date']) && !$is_admin) {
$error_list[] = $recv_list[$i]; $error_list[] = $recv_list_id;
} else { } else {
$member_list['id'][] = $row['mb_id']; $member_list['id'][] = $row['mb_id'];
$member_list['nick'][] = $row['mb_nick']; $member_list['nick'][] = $row['mb_nick'];
@@ -67,14 +71,14 @@ for ($i=0; $i<count($member_list['id']); $i++) {
$recv_mb_nick = get_text($member_list['nick'][$i]); $recv_mb_nick = get_text($member_list['nick'][$i]);
// 받는 회원 쪽지 INSERT // 받는 회원 쪽지 INSERT
$sql = " insert into {$g5['memo_table']} ( me_recv_mb_id, me_send_mb_id, me_send_datetime, me_memo, me_read_datetime, me_type, me_send_ip ) values ( '$recv_mb_id', '{$member['mb_id']}', '".G5_TIME_YMDHIS."', '{$_POST['me_memo']}', '0000-00-00 00:00:00' , 'recv', '{$_SERVER['REMOTE_ADDR']}' ) "; $sql = " insert into {$g5['memo_table']} ( me_recv_mb_id, me_send_mb_id, me_send_datetime, me_memo, me_read_datetime, me_type, me_send_ip ) values ( '$recv_mb_id', '{$member['mb_id']}', '".G5_TIME_YMDHIS."', '{$me_memo}', '0000-00-00 00:00:00' , 'recv', '{$_SERVER['REMOTE_ADDR']}' ) ";
sql_query($sql); sql_query($sql);
if( $me_id = sql_insert_id() ){ if( $me_id = sql_insert_id() ){
// 보내는 회원 쪽지 INSERT // 보내는 회원 쪽지 INSERT
$sql = " insert into {$g5['memo_table']} ( me_recv_mb_id, me_send_mb_id, me_send_datetime, me_memo, me_read_datetime, me_send_id, me_type , me_send_ip ) values ( '$recv_mb_id', '{$member['mb_id']}', '".G5_TIME_YMDHIS."', '{$_POST['me_memo']}', '0000-00-00 00:00:00', '$me_id', 'send', '{$_SERVER['REMOTE_ADDR']}' ) "; $sql = " insert into {$g5['memo_table']} ( me_recv_mb_id, me_send_mb_id, me_send_datetime, me_memo, me_read_datetime, me_send_id, me_type , me_send_ip ) values ( '$recv_mb_id', '{$member['mb_id']}', '".G5_TIME_YMDHIS."', '{$me_memo}', '0000-00-00 00:00:00', '$me_id', 'send', '{$_SERVER['REMOTE_ADDR']}' ) ";
sql_query($sql); sql_query($sql);
$member_list['me_id'][$i] = $me_id; $member_list['me_id'][$i] = $me_id;
+3 -1
View File
@@ -80,7 +80,7 @@ while ($row = sql_fetch_array($result))
} }
$sql = " insert into $move_write_table $sql = " insert into $move_write_table
set wr_num = " . ($next_wr_num ? "'$next_wr_num'" : "(SELECT IFNULL(MIN(wr_num) - 1, -1) FROM $move_write_table sq) ") . ", set wr_num = " . ($next_wr_num ? "'$next_wr_num'" : "(SELECT IFNULL(MIN(wr_num) - 1, -1) FROM $move_write_table as sq) ") . ",
wr_reply = '{$row2['wr_reply']}', wr_reply = '{$row2['wr_reply']}',
wr_is_comment = '{$row2['wr_is_comment']}', wr_is_comment = '{$row2['wr_is_comment']}',
wr_comment = '{$row2['wr_comment']}', wr_comment = '{$row2['wr_comment']}',
@@ -133,6 +133,8 @@ while ($row = sql_fetch_array($result))
$result3 = sql_query($sql3); $result3 = sql_query($sql3);
for ($k=0; $row3 = sql_fetch_array($result3); $k++) for ($k=0; $row3 = sql_fetch_array($result3); $k++)
{ {
$copy_file_name = '';
if ($row3['bf_file']) if ($row3['bf_file'])
{ {
// 원본파일을 복사하고 퍼미션을 변경 // 원본파일을 복사하고 퍼미션을 변경
+1 -1
View File
@@ -3,7 +3,7 @@ include_once('./_common.php');
$po_id = isset($_POST['po_id']) ? preg_replace('/[^0-9]/', '', $_POST['po_id']) : 0; $po_id = isset($_POST['po_id']) ? preg_replace('/[^0-9]/', '', $_POST['po_id']) : 0;
$po = sql_fetch(" select * from {$g5['poll_table']} where po_id = '{$_POST['po_id']}' "); $po = sql_fetch(" select * from {$g5['poll_table']} where po_id = '$po_id' ");
if (! (isset($po['po_id']) && $po['po_id'])) if (! (isset($po['po_id']) && $po['po_id']))
alert('po_id 값이 제대로 넘어오지 않았습니다.'); alert('po_id 값이 제대로 넘어오지 않았습니다.');
+2
View File
@@ -1,6 +1,8 @@
<?php <?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가 if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
if (function_exists('check_case_exist_title')) check_case_exist_title($write, G5_BBS_DIR, true);
// 게시판에서 두단어 이상 검색 후 검색된 게시물에 코멘트를 남기면 나오던 오류 수정 // 게시판에서 두단어 이상 검색 후 검색된 게시물에 코멘트를 남기면 나오던 오류 수정
$sop = strtolower($sop); $sop = strtolower($sop);
if ($sop != 'and' && $sop != 'or') if ($sop != 'and' && $sop != 'or')
+8 -2
View File
@@ -259,7 +259,7 @@ if ($w == '' || $w == 'r') {
} }
$sql = " insert into $write_table $sql = " insert into $write_table
set wr_num = " . ($w == 'r' ? "'$wr_num'" : "(SELECT IFNULL(MIN(wr_num) - 1, -1) FROM $write_table sq) ") . ", set wr_num = " . ($w == 'r' ? "'$wr_num'" : "(SELECT IFNULL(MIN(wr_num) - 1, -1) FROM $write_table as sq) ") . ",
wr_reply = '$wr_reply', wr_reply = '$wr_reply',
wr_comment = 0, wr_comment = 0,
ca_name = '$ca_name', ca_name = '$ca_name',
@@ -678,8 +678,14 @@ sql_query(" delete from {$g5['autosave_table']} where as_uid = '{$uid}' ");
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// 비밀글이라면 세션에 비밀글의 아이디를 저장한다. 자신의 글은 다시 비밀번호를 묻지 않기 위함 // 비밀글이라면 세션에 비밀글의 아이디를 저장한다. 자신의 글은 다시 비밀번호를 묻지 않기 위함
if ($secret) if ($secret) {
if (! $wr_num) {
$write = get_write($write_table, $wr_id, true);
$wr_num = $write['wr_num'];
}
set_session("ss_secret_{$bo_table}_{$wr_num}", TRUE); set_session("ss_secret_{$bo_table}_{$wr_num}", TRUE);
}
// 메일발송 사용 (수정글은 발송하지 않음) // 메일발송 사용 (수정글은 발송하지 않음)
if (!($w == 'u' || $w == 'cu') && $config['cf_email_use'] && $board['bo_use_email']) { if (!($w == 'u' || $w == 'cu') && $config['cf_email_use'] && $board['bo_use_email']) {
+4 -9
View File
@@ -58,15 +58,10 @@ include_once($g5_path['path'].'/config.php'); // 설정 파일
unset($g5_path); unset($g5_path);
// IIS 에서 SERVER_ADDR 서버변수가 없다면 // IIS 에서 SERVER_ADDR 서버변수가 없다면
if(! isset($_SERVER['SERVER_ADDR'])) { if (!isset($_SERVER['SERVER_ADDR'])) {
$_SERVER['SERVER_ADDR'] = isset($_SERVER['LOCAL_ADDR']) ? $_SERVER['LOCAL_ADDR'] : ''; $_SERVER['SERVER_ADDR'] = isset($_SERVER['LOCAL_ADDR']) ? $_SERVER['LOCAL_ADDR'] : '';
} }
// Cloudflare 환경을 고려한 https 사용여부
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === "https") {
$_SERVER['HTTPS'] = 'on';
}
// multi-dimensional array에 사용자지정 함수적용 // multi-dimensional array에 사용자지정 함수적용
function array_map_deep($fn, $array) function array_map_deep($fn, $array)
{ {
@@ -426,7 +421,7 @@ if (isset($_REQUEST['sca'])) {
if (isset($_REQUEST['sfl'])) { if (isset($_REQUEST['sfl'])) {
$sfl = trim($_REQUEST['sfl']); $sfl = trim($_REQUEST['sfl']);
$sfl = preg_replace("/[\<\>\'\"\\\'\\\"\%\=\(\)\/\^\*\s]/", "", $sfl); $sfl = preg_replace("/[\<\>\'\"\\\'\\\"\%\=\(\)\/\^\*\s\#]/", "", $sfl);
if ($sfl) if ($sfl)
$qstr .= '&amp;sfl=' . urlencode($sfl); // search field (검색 필드) $qstr .= '&amp;sfl=' . urlencode($sfl); // search field (검색 필드)
} else { } else {
@@ -505,7 +500,7 @@ if (isset($_REQUEST['bo_table']) && ! is_array($_REQUEST['bo_table'])) {
// URL ENCODING // URL ENCODING
if (isset($_REQUEST['url'])) { if (isset($_REQUEST['url'])) {
$url = strip_tags(trim($_REQUEST['url'])); $url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%@$\|*\'()\[\]\\x80-\\xff]|i', '', trim($_REQUEST['url']));
$urlencode = urlencode($url); $urlencode = urlencode($url);
} else { } else {
$url = ''; $url = '';
@@ -513,7 +508,7 @@ if (isset($_REQUEST['url'])) {
if (G5_DOMAIN) { if (G5_DOMAIN) {
$p = @parse_url(G5_DOMAIN); $p = @parse_url(G5_DOMAIN);
$p['path'] = isset($p['path']) ? $p['path'] : '/'; $p['path'] = isset($p['path']) ? $p['path'] : '/';
$urlencode = G5_DOMAIN.urldecode(preg_replace("/^".urlencode($p['path'])."/", "", $urlencode)); $urlencode = rtrim(G5_DOMAIN, '%2F').'%2F'.ltrim(urldecode(preg_replace("/^".urlencode($p['path'])."/", "", $urlencode)), '%2F');
} }
} }
+5
View File
@@ -234,5 +234,10 @@ define('G5_VISIT_BROWSCAP_USE', false);
*/ */
define('G5_IP_DISPLAY', '\\1.♡.\\3.\\4'); define('G5_IP_DISPLAY', '\\1.♡.\\3.\\4');
// Cloudflare 사용시 REMOTE_ADDR 에 사용자 IP 적용과 https 사용 여부
if (isset($_SERVER['HTTP_CF_CONNECTING_IP'])) {
include_once(G5_LIB_PATH.'/cloudflare.lib.php'); // cloudflare 의 ip 대역인지 체크
}
// KAKAO 우편번호 서비스 CDN // KAKAO 우편번호 서비스 CDN
define('G5_POSTCODE_JS', '<script src="//t1.daumcdn.net/mapjsapi/bundle/postcode/prod/postcode.v2.js" async></script>'); define('G5_POSTCODE_JS', '<script src="//t1.daumcdn.net/mapjsapi/bundle/postcode/prod/postcode.v2.js" async></script>');
+5 -2
View File
@@ -806,12 +806,15 @@ box-shadow: 1px 2px 2px #eee;}
#sod_frm_paysel legend {position:absolute;font-size:0;line-height:0;overflow:hidden} #sod_frm_paysel legend {position:absolute;font-size:0;line-height:0;overflow:hidden}
#sod_frm_paysel .KPAY{background:url('../img/kpay.png') no-repeat 50% 50% #fff;overflow:hidden;text-indent:-999px} #sod_frm_paysel .KPAY{background:url('../img/kpay.png') no-repeat 50% 50% #fff;overflow:hidden;text-indent:-999px}
#sod_frm_paysel .PAYNOW{background:url('../img/paynow.png') no-repeat 50% 50% #fff;overflow:hidden;text-indent:-999px} #sod_frm_paysel .PAYNOW{background:url('../img/paynow.png') no-repeat 50% 50% #fff;overflow:hidden;text-indent:-999px}
#sod_frm_paysel .PAYCO{background:url('../img/payco.png') no-repeat 50% 50% #fff;overflow:hidden;text-indent:-999px} #sod_frm_paysel .PAYCO, #sod_frm_paysel .paycopay_icon{background:url('../img/payco.png') no-repeat 50% 50% #fff;overflow:hidden;text-indent:-999px}
#sod_frm_paysel .inicis_lpay{background:url('../img/lpay_logo.png') no-repeat 50% 50% #fff;overflow:hidden;text-indent:-999px} #sod_frm_paysel .inicis_lpay, #sod_frm_paysel .lpay_icon{background:url('../img/lpay_logo.png') no-repeat 50% 50% #fff;overflow:hidden;text-indent:-999px}
#sod_frm_paysel .inicis_kakaopay{position:relative;overflow:hidden;text-indent:-999px} #sod_frm_paysel .inicis_kakaopay{position:relative;overflow:hidden;text-indent:-999px}
#sod_frm_paysel .inicis_kakaopay em{position:absolute;top:15px;left:45px;width:70px;height:30px;background:url('../img/kakao.png') no-repeat 50% 50% #ffeb00;overflow:hidden;text-indent:-999px;border-radius:30px} #sod_frm_paysel .inicis_kakaopay em{position:absolute;top:15px;left:45px;width:70px;height:30px;background:url('../img/kakao.png') no-repeat 50% 50% #ffeb00;overflow:hidden;text-indent:-999px;border-radius:30px}
#sod_frm_paysel .kakaopay_icon{background:url('../img/kakao.png') no-repeat 50% 50% #fff;overflow:hidden;text-indent:-999px} #sod_frm_paysel .kakaopay_icon{background:url('../img/kakao.png') no-repeat 50% 50% #fff;overflow:hidden;text-indent:-999px}
#sod_frm_paysel .naverpay_icon{background:url('../img/ico-default-naverpay.png') no-repeat 50% 50% #fff;overflow:hidden;text-indent:-999px} #sod_frm_paysel .naverpay_icon{background:url('../img/ico-default-naverpay.png') no-repeat 50% 50% #fff;overflow:hidden;text-indent:-999px}
#sod_frm_paysel .samsungpay_icon{background:url('../img/samsungpay.png') no-repeat 50% 50% #fff;display:inline-block;overflow:hidden;text-indent:-999px}
#sod_frm_paysel .ssgpay_icon{background:url('../img/ssgpay_icon.png') no-repeat 50% 50% #fff;display:inline-block;overflow:hidden;text-indent:-999px}
#sod_frm_paysel .skpay_icon{background:url('../img/skpay11_icon.png') no-repeat 50% 50% #fff; background-size: 70px;display:inline-block;overflow:hidden;text-indent:-999px}
#sod_frm_paysel .bank_icon{background:url('../img/pay_icon1.png') no-repeat 15px 50% #fff} #sod_frm_paysel .bank_icon{background:url('../img/pay_icon1.png') no-repeat 15px 50% #fff}
#sod_frm_paysel .vbank_icon{background:url('../img/pay_icon2.png') no-repeat 15px 50% #fff;padding-top:13px} #sod_frm_paysel .vbank_icon{background:url('../img/pay_icon2.png') no-repeat 15px 50% #fff;padding-top:13px}
#sod_frm_paysel .iche_icon{background:url('../img/pay_icon2.png') no-repeat 15px 50% #fff;padding-top:13px} #sod_frm_paysel .iche_icon{background:url('../img/pay_icon2.png') no-repeat 15px 50% #fff;padding-top:13px}
+11 -5
View File
@@ -223,13 +223,15 @@ box-shadow: 0 0 6px rgba(0,0,0,0.2);}
#m_sod_frm_paysel li {float:left;padding:5px;width:46%;height:35px} #m_sod_frm_paysel li {float:left;padding:5px;width:46%;height:35px}
#m_sod_frm_paysel .KPAY{background:url('../img/kpay.png') no-repeat;width:37px;height:15px;overflow:hidden;text-indent:-999px;display:inline-block;background-size:100%} #m_sod_frm_paysel .KPAY{background:url('../img/kpay.png') no-repeat;width:37px;height:15px;overflow:hidden;text-indent:-999px;display:inline-block;background-size:100%}
#m_sod_frm_paysel .PAYNOW{background:url('../img/paynow.png') no-repeat;width:46px;height:15px;overflow:hidden;text-indent:-999px;display:inline-block;background-size:100%;} #m_sod_frm_paysel .PAYNOW{background:url('../img/paynow.png') no-repeat;width:46px;height:15px;overflow:hidden;text-indent:-999px;display:inline-block;background-size:100%;}
#m_sod_frm_paysel .PAYCO{background:url('../img/payco.png') no-repeat 1px;width:50px;height:15px;overflow:hidden;text-indent:-999px;display:inline-block;background-size:100%} #m_sod_frm_paysel .PAYCO, #m_sod_frm_paysel .paycopay_icon{background:url('../img/payco.png') no-repeat 1px;width:50px;height:15px;overflow:hidden;text-indent:-999px;display:inline-block;background-size:100%}
#m_sod_frm_paysel .inicis_lpay{background:url('../img/lpay_logo.png') no-repeat;width:35px;height:12px;overflow:hidden;text-indent:-999px;display:inline-block;background-size:100%;} #m_sod_frm_paysel .inicis_lpay, #m_sod_frm_paysel .lpay_icon{background:url('../img/lpay_logo.png') no-repeat;width:35px;height:12px;overflow:hidden;text-indent:-999px;display:inline-block;background-size:100%;}
#m_sod_frm_paysel .inicis_kakaopay{background:url('../img/kakao.png') no-repeat 50% 50% #ffeb00;border-radius:30px;height:26px;width:74px;display:inline-block;overflow:hidden;text-indent:-999px;background-size:36px auto} #m_sod_frm_paysel .inicis_kakaopay{background:url('../img/kakao.png') no-repeat 50% 50% #ffeb00;border-radius:30px;height:26px;width:74px;display:inline-block;overflow:hidden;text-indent:-999px;background-size:36px auto}
#m_sod_frm_paysel .kakaopay_icon{background:url('../img/ico-mobile-kakaopay.png') no-repeat #fff;height:23px;width:63px;display:inline-block;overflow:hidden;text-indent:-999px;background-size:45px auto;background-position: 10% 40%} #m_sod_frm_paysel .kakaopay_icon{background:url('../img/ico-mobile-kakaopay.png') no-repeat #fff;height:23px;width:63px;display:inline-block;overflow:hidden;text-indent:-999px;background-size:45px auto;background-position: 10% 40%}
#m_sod_frm_paysel .naverpay_icon{background:url('../img/ico-mobile-naverpay.png') no-repeat #fff;height:23px;width:60px;display:inline-block;overflow:hidden;text-indent:-999px;background-size:45px auto;background-position: 0% 30%} #m_sod_frm_paysel .naverpay_icon{background:url('../img/ico-mobile-naverpay.png') no-repeat #fff;height:23px;width:60px;display:inline-block;overflow:hidden;text-indent:-999px;background-size:45px auto;background-position: 0% 30%}
#m_sod_frm_paysel .applepay_icon{background:url('../img/ico-mobile-applepay.png') no-repeat #fff;height:30px;width:60px;display:inline-block;overflow:hidden;text-indent:-999px;background-size:43px auto} #m_sod_frm_paysel .applepay_icon{background:url('../img/ico-mobile-applepay.png') no-repeat #fff;height:30px;width:60px;display:inline-block;overflow:hidden;text-indent:-999px;background-size:43px auto}
#m_sod_frm_paysel .samsung_pay{margin-left:-23px;background:url('../img/samsungpay.png') no-repeat 24px 3px;height:25px;width:106px;display:inline-block;overflow:hidden;text-indent:-999px} #m_sod_frm_paysel .ssgpay_icon{background:url('../img/ssgpay_icon.png') no-repeat 0px 3px #fff;width:55px;height:20px;background-size:100%;display:inline-block;overflow:hidden;text-indent:-999px}
#m_sod_frm_paysel .skpay_icon{background:url('../img/skpay11_icon.png') no-repeat 0px 3px #fff;width:55px;height:20px;background-size:100%;display:inline-block;overflow:hidden;text-indent:-999px}
#m_sod_frm_paysel .samsung_pay, #m_sod_frm_paysel .samsungpay_icon{margin-left:-23px;background:url('../img/samsungpay.png') no-repeat 24px 7px;height:25px;width:106px;display:inline-block;overflow:hidden;text-indent:-999px}
#sod_frm_pay{padding:10px;;border-top:1px solid #f3f3f3} #sod_frm_pay{padding:10px;;border-top:1px solid #f3f3f3}
#sod_frm_pay h2{margin:10px 0;font-size:1.25em} #sod_frm_pay h2{margin:10px 0;font-size:1.25em}
@@ -907,10 +909,14 @@ box-shadow:0 0 8px rgba(65,98,255,0.8)}
#sod_frm_paysel legend {position:absolute;font-size:0;line-height:0;overflow:hidden} #sod_frm_paysel legend {position:absolute;font-size:0;line-height:0;overflow:hidden}
#sod_frm_paysel .KPAY{background:url('../img/kpay.png') no-repeat 50% 50% #fff;overflow:hidden;text-indent:-999px} #sod_frm_paysel .KPAY{background:url('../img/kpay.png') no-repeat 50% 50% #fff;overflow:hidden;text-indent:-999px}
#sod_frm_paysel .PAYNOW{background:url('../img/paynow.png') no-repeat 50% 50% #fff;overflow:hidden;text-indent:-999px} #sod_frm_paysel .PAYNOW{background:url('../img/paynow.png') no-repeat 50% 50% #fff;overflow:hidden;text-indent:-999px}
#sod_frm_paysel .PAYCO{background:url('../img/payco.png') no-repeat 50% 50% #fff;overflow:hidden;text-indent:-999px} #sod_frm_paysel .PAYCO, #sod_frm_paysel .paycopay_icon{background:url('../img/payco.png') no-repeat 50% 50% #fff;overflow:hidden;text-indent:-999px}
#sod_frm_paysel .inicis_lpay{background:url('../img/lpay_logo.png') no-repeat 50% 50% #fff;overflow:hidden;text-indent:-999px} #sod_frm_paysel .inicis_lpay, #sod_frm_paysel .lpay_icon{background:url('../img/lpay_logo.png') no-repeat 50% 50% #fff;overflow:hidden;text-indent:-999px}
#sod_frm_paysel .inicis_kakaopay{background:url('../img/kakao.png') no-repeat 50% 50% #f4dc34;overflow:hidden;text-indent:-999px} #sod_frm_paysel .inicis_kakaopay{background:url('../img/kakao.png') no-repeat 50% 50% #f4dc34;overflow:hidden;text-indent:-999px}
#sod_frm_paysel .kakaopay_icon{background:url('../img/kakao.png') no-repeat 50% 50% #f4dc34;overflow:hidden;text-indent:-999px} #sod_frm_paysel .kakaopay_icon{background:url('../img/kakao.png') no-repeat 50% 50% #f4dc34;overflow:hidden;text-indent:-999px}
#sod_frm_paysel .naverpay_icon{background:url('../img/ico-default-naverpay.png') no-repeat 50% 50% #fff;overflow:hidden;text-indent:-999px}
#sod_frm_paysel .samsungpay_icon{background:url('../img/samsungpay.png') no-repeat 50% 50% #fff;display:inline-block;overflow:hidden;text-indent:-999px}
#sod_frm_paysel .ssgpay_icon{background:url('../img/ssgpay_icon.png') no-repeat 50% 50% #fff;display:inline-block;overflow:hidden;text-indent:-999px}
#sod_frm_paysel .skpay_icon{background:url('../img/skpay11_icon.png') no-repeat 50% 50% #fff; background-size: 70px;display:inline-block;overflow:hidden;text-indent:-999px}
#sod_frm_paysel .bank_icon{background:url('../img/pay_icon1.png') no-repeat 15px 50% #fff} #sod_frm_paysel .bank_icon{background:url('../img/pay_icon1.png') no-repeat 15px 50% #fff}
#sod_frm_paysel .vbank_icon{background:url('../img/pay_icon2.png') no-repeat 15px 50% #fff;padding-top:13px} #sod_frm_paysel .vbank_icon{background:url('../img/pay_icon2.png') no-repeat 15px 50% #fff;padding-top:13px}
#sod_frm_paysel .iche_icon{background:url('../img/pay_icon2.png') no-repeat 15px 50% #fff;padding-top:13px} #sod_frm_paysel .iche_icon{background:url('../img/pay_icon2.png') no-repeat 15px 50% #fff;padding-top:13px}
+2
View File
@@ -1,6 +1,8 @@
<?php <?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가 if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
define('KGINICIS_USE_CERT_SEED', isset($config['cf_cert_use_seed']) ? (int) $config['cf_cert_use_seed'] : 1);
// 유저 사이드뷰에서 아이콘 지정 안했을시 기본 no 프로필 이미지 // 유저 사이드뷰에서 아이콘 지정 안했을시 기본 no 프로필 이미지
define('G5_NO_PROFILE_IMG', '<span class="profile_img"><img src="'.G5_IMG_URL.'/no_profile.gif" alt="no_profile" width="'.$config['cf_member_icon_width'].'" height="'.$config['cf_member_icon_height'].'"></span>'); define('G5_NO_PROFILE_IMG', '<span class="profile_img"><img src="'.G5_IMG_URL.'/no_profile.gif" alt="no_profile" width="'.$config['cf_member_icon_width'].'" height="'.$config['cf_member_icon_height'].'"></span>');
Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

+13 -5
View File
@@ -189,6 +189,7 @@ CREATE TABLE IF NOT EXISTS `g5_board_new` (
DROP TABLE IF EXISTS `g5_config`; DROP TABLE IF EXISTS `g5_config`;
CREATE TABLE IF NOT EXISTS `g5_config` ( CREATE TABLE IF NOT EXISTS `g5_config` (
`cf_id` int(11) NOT NULL auto_increment,
`cf_title` varchar(255) NOT NULL DEFAULT '', `cf_title` varchar(255) NOT NULL DEFAULT '',
`cf_theme` varchar(100) NOT NULL DEFAULT '', `cf_theme` varchar(100) NOT NULL DEFAULT '',
`cf_admin` varchar(100) NOT NULL DEFAULT '', `cf_admin` varchar(100) NOT NULL DEFAULT '',
@@ -291,8 +292,10 @@ CREATE TABLE IF NOT EXISTS `g5_config` (
`cf_cert_simple` varchar(255) NOT NULL DEFAULT '', `cf_cert_simple` varchar(255) NOT NULL DEFAULT '',
`cf_cert_kg_cd` varchar(255) NOT NULL DEFAULT '', `cf_cert_kg_cd` varchar(255) NOT NULL DEFAULT '',
`cf_cert_kg_mid` varchar(255) NOT NULL DEFAULT '', `cf_cert_kg_mid` varchar(255) NOT NULL DEFAULT '',
`cf_cert_use_seed` tinyint(4) NOT NULL DEFAULT '1',
`cf_cert_kcb_cd` varchar(255) NOT NULL DEFAULT '', `cf_cert_kcb_cd` varchar(255) NOT NULL DEFAULT '',
`cf_cert_kcp_cd` varchar(255) NOT NULL DEFAULT '', `cf_cert_kcp_cd` varchar(255) NOT NULL DEFAULT '',
`cf_cert_kcp_enckey` varchar(100) NOT NULL DEFAULT '',
`cf_lg_mid` varchar(100) NOT NULL DEFAULT '', `cf_lg_mid` varchar(100) NOT NULL DEFAULT '',
`cf_lg_mert_key` varchar(100) NOT NULL DEFAULT '', `cf_lg_mert_key` varchar(100) NOT NULL DEFAULT '',
`cf_cert_limit` int(11) NOT NULL DEFAULT '0', `cf_cert_limit` int(11) NOT NULL DEFAULT '0',
@@ -342,7 +345,8 @@ CREATE TABLE IF NOT EXISTS `g5_config` (
`cf_7` varchar(255) NOT NULL DEFAULT '', `cf_7` varchar(255) NOT NULL DEFAULT '',
`cf_8` varchar(255) NOT NULL DEFAULT '', `cf_8` varchar(255) NOT NULL DEFAULT '',
`cf_9` varchar(255) NOT NULL DEFAULT '', `cf_9` varchar(255) NOT NULL DEFAULT '',
`cf_10` varchar(255) NOT NULL DEFAULT '' `cf_10` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`cf_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- -------------------------------------------------------- -- --------------------------------------------------------
@@ -445,12 +449,14 @@ CREATE TABLE IF NOT EXISTS `g5_group_member` (
DROP TABLE IF EXISTS `g5_login`; DROP TABLE IF EXISTS `g5_login`;
CREATE TABLE IF NOT EXISTS `g5_login` ( CREATE TABLE IF NOT EXISTS `g5_login` (
`lo_id` int(11) NOT NULL AUTO_INCREMENT,
`lo_ip` varchar(100) NOT NULL default '', `lo_ip` varchar(100) NOT NULL default '',
`mb_id` varchar(20) NOT NULL default '', `mb_id` varchar(20) NOT NULL default '',
`lo_datetime` datetime NOT NULL default '0000-00-00 00:00:00', `lo_datetime` datetime NOT NULL default '0000-00-00 00:00:00',
`lo_location` text NOT NULL, `lo_location` text NOT NULL,
`lo_url` text NOT NULL, `lo_url` text NOT NULL,
PRIMARY KEY (`lo_ip`) PRIMARY KEY (`lo_id`),
UNIQUE KEY `lo_ip_unique` (`lo_ip`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- -------------------------------------------------------- -- --------------------------------------------------------
@@ -679,7 +685,7 @@ CREATE TABLE IF NOT EXISTS `g5_scrap` (
DROP TABLE IF EXISTS `g5_visit`; DROP TABLE IF EXISTS `g5_visit`;
CREATE TABLE IF NOT EXISTS `g5_visit` ( CREATE TABLE IF NOT EXISTS `g5_visit` (
`vi_id` int(11) NOT NULL default '0', `vi_id` int(11) NOT NULL AUTO_INCREMENT,
`vi_ip` varchar(100) NOT NULL default '', `vi_ip` varchar(100) NOT NULL default '',
`vi_date` date NOT NULL default '0000-00-00', `vi_date` date NOT NULL default '0000-00-00',
`vi_time` time NOT NULL default '00:00:00', `vi_time` time NOT NULL default '00:00:00',
@@ -747,6 +753,7 @@ CREATE TABLE IF NOT EXISTS `g5_autosave` (
DROP TABLE IF EXISTS `g5_qa_config`; DROP TABLE IF EXISTS `g5_qa_config`;
CREATE TABLE IF NOT EXISTS `g5_qa_config` ( CREATE TABLE IF NOT EXISTS `g5_qa_config` (
`qa_id` int(11) NOT NULL AUTO_INCREMENT,
`qa_title` varchar(255) NOT NULL DEFAULT'', `qa_title` varchar(255) NOT NULL DEFAULT'',
`qa_category` varchar(255) NOT NULL DEFAULT'', `qa_category` varchar(255) NOT NULL DEFAULT'',
`qa_skin` varchar(255) NOT NULL DEFAULT '', `qa_skin` varchar(255) NOT NULL DEFAULT '',
@@ -782,7 +789,8 @@ CREATE TABLE IF NOT EXISTS `g5_qa_config` (
`qa_2` varchar(255) NOT NULL DEFAULT '', `qa_2` varchar(255) NOT NULL DEFAULT '',
`qa_3` varchar(255) NOT NULL DEFAULT '', `qa_3` varchar(255) NOT NULL DEFAULT '',
`qa_4` varchar(255) NOT NULL DEFAULT '', `qa_4` varchar(255) NOT NULL DEFAULT '',
`qa_5` varchar(255) NOT NULL DEFAULT '' `qa_5` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`qa_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- -------------------------------------------------------- -- --------------------------------------------------------
@@ -902,7 +910,7 @@ CREATE TABLE IF NOT EXISTS `g5_member_social_profiles` (
`description` varchar(255) NOT NULL DEFAULT '', `description` varchar(255) NOT NULL DEFAULT '',
`mp_register_day` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `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', `mp_latest_day` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
UNIQUE KEY `mp_no` (`mp_no`), PRIMARY KEY (`mp_no`),
KEY `mb_id` (`mb_id`), KEY `mb_id` (`mb_id`),
KEY `provider` (`provider`) KEY `provider` (`provider`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+5 -1
View File
@@ -209,6 +209,7 @@ CREATE TABLE IF NOT EXISTS `g5_shop_coupon_zone` (
DROP TABLE IF EXISTS `g5_shop_default`; DROP TABLE IF EXISTS `g5_shop_default`;
CREATE TABLE IF NOT EXISTS `g5_shop_default` ( CREATE TABLE IF NOT EXISTS `g5_shop_default` (
`de_id` int(11) NOT NULL auto_increment,
`de_admin_company_owner` varchar(255) NOT NULL DEFAULT '', `de_admin_company_owner` varchar(255) NOT NULL DEFAULT '',
`de_admin_company_name` varchar(255) NOT NULL DEFAULT '', `de_admin_company_name` varchar(255) NOT NULL DEFAULT '',
`de_admin_company_saupja_no` varchar(255) NOT NULL DEFAULT '', `de_admin_company_saupja_no` varchar(255) NOT NULL DEFAULT '',
@@ -359,6 +360,8 @@ CREATE TABLE IF NOT EXISTS `g5_shop_default` (
`de_inicis_lpay_use` tinyint(4) NOT NULL DEFAULT '0', `de_inicis_lpay_use` tinyint(4) NOT NULL DEFAULT '0',
`de_inicis_kakaopay_use` tinyint(4) NOT NULL DEFAULT '0', `de_inicis_kakaopay_use` tinyint(4) NOT NULL DEFAULT '0',
`de_inicis_cartpoint_use` tinyint(4) NOT NULL DEFAULT '0', `de_inicis_cartpoint_use` tinyint(4) NOT NULL DEFAULT '0',
`de_nicepay_mid` varchar(30) NOT NULL DEFAULT '',
`de_nicepay_key` varchar(255) NOT NULL DEFAULT '',
`de_item_use_use` tinyint(4) NOT NULL DEFAULT '0', `de_item_use_use` tinyint(4) NOT NULL DEFAULT '0',
`de_item_use_write` tinyint(4) NOT NULL DEFAULT '0', `de_item_use_write` tinyint(4) NOT NULL DEFAULT '0',
`de_code_dup_use` tinyint(4) NOT NULL DEFAULT '0', `de_code_dup_use` tinyint(4) NOT NULL DEFAULT '0',
@@ -386,7 +389,8 @@ CREATE TABLE IF NOT EXISTS `g5_shop_default` (
`de_member_reg_coupon_use` tinyint(4) NOT NULL DEFAULT '0', `de_member_reg_coupon_use` tinyint(4) NOT NULL DEFAULT '0',
`de_member_reg_coupon_term` int(11) NOT NULL DEFAULT '0', `de_member_reg_coupon_term` int(11) NOT NULL DEFAULT '0',
`de_member_reg_coupon_price` int(11) NOT NULL DEFAULT '0', `de_member_reg_coupon_price` int(11) NOT NULL DEFAULT '0',
`de_member_reg_coupon_minimum` int(11) NOT NULL DEFAULT '0' `de_member_reg_coupon_minimum` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`de_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- -------------------------------------------------------- -- --------------------------------------------------------
+1 -1
View File
@@ -134,7 +134,7 @@ function no_comma(data)
function del(href) function del(href)
{ {
if(confirm("한번 삭제한 자료는 복구할 방법이 없습니다.\n\n정말 삭제하시겠습니까?")) { if(confirm("한번 삭제한 자료는 복구할 방법이 없습니다.\n\n정말 삭제하시겠습니까?")) {
document.location.href = href; window.location.href = href;
} }
} }
+6
View File
@@ -1,5 +1,11 @@
function kakaolink_send(text, url, image) function kakaolink_send(text, url, image)
{ {
if (window.Kakao && (kakao_javascript_apikey !== undefined)) {
if (! Kakao.isInitialized()) {
Kakao.init(kakao_javascript_apikey);
}
}
if( image === undefined ){ if( image === undefined ){
image = ''; image = '';
} }
+112
View File
@@ -0,0 +1,112 @@
<?php
if (!defined('_GNUBOARD_')) exit;
// CloudFlare를 사용시, 사용자 환경에 맞는 $_SERVER['REMOTE_ADDR']과 $_SERVER['HTTPS'] 사용 여부를 수정합니다.
class G5CheckCloudFlare {
public static function check_cloudflare_ips($user_ip){
// 클라우드플레어 IP, https://www.cloudflare.com/ips
$cloudflare_ips = array(
// IPv4
'173.245.48.0/20',
'103.21.244.0/22',
'103.22.200.0/22',
'103.31.4.0/22',
'141.101.64.0/18',
'108.162.192.0/18',
'190.93.240.0/20',
'188.114.96.0/20',
'197.234.240.0/22',
'198.41.128.0/17',
'162.158.0.0/15',
'104.16.0.0/12',
'104.24.0.0/14',
'172.64.0.0/13',
'131.0.72.0/22',
// IPv6
'2400:cb00::/32',
'2606:4700::/32',
'2803:f800::/32',
'2405:b500::/32',
'2405:8100::/32',
'2a06:98c0::/29',
'2c0f:f248::/32',
);
// 사용자 IP가 Cloudflare IP 대역 범위에 있는지 확인
$is_cloudflare_ip = false;
foreach ($cloudflare_ips as $cidr) {
if (self::ip_in_range($user_ip, $cidr)) {
$is_cloudflare_ip = true;
break;
}
}
return $is_cloudflare_ip;
}
// IP 주소가 CIDR 범위 내에 있는지 확인하는 함수 (IPv4, IPv6 모두 가능)
public static function ip_in_range($ip, $range) {
// IPv4와 IPv6를 구분
if (strpos($range, ':') === false && preg_match('/^([0-9]{1,3}\.){3}[0-9]{1,3}$/', $ip)) {
// IPv4 처리
return self::ipv4_in_range($ip, $range);
} elseif (strpos($range, ':') !== false && strpos($ip, ':') !== false) {
// IPv6 처리
return self::ipv6_in_range($ip, $range);
}
return false;
}
// IPv4 CIDR 범위 검사
public static function ipv4_in_range($ip, $range) {
list($range, $netmask) = explode('/', $range, 2);
$range_decimal = ip2long($range);
$ip_decimal = ip2long($ip);
$wildcard_decimal = pow(2, (32 - $netmask)) - 1;
$netmask_decimal = ~$wildcard_decimal;
return (($ip_decimal & $netmask_decimal) == ($range_decimal & $netmask_decimal));
}
// IPv6 CIDR 범위 검사
public static function ipv6_in_range($ip, $range) {
list($range_ip, $netmask) = explode('/', $range, 2);
$netmask = (int) $netmask;
$ip_bin = @inet_pton($ip);
$range_bin = @inet_pton($range_ip);
// IPv6 주소는 128비트이므로, 비트마스크를 적용
$unpacked = unpack('A16', $ip_bin);
$ip_bits = $unpacked[1];
$unpacked2 = unpack('A16', $range_bin);
$range_bits = $unpacked2[1];
for ($i = 0; $i < (int)($netmask / 8); $i++) {
if ($ip_bits[$i] !== $range_bits[$i]) {
return false;
}
}
$remainder = $netmask % 8;
if ($remainder) {
$mask = 0xFF << (8 - $remainder);
return (ord($ip_bits[$i]) & $mask) === (ord($range_bits[$i]) & $mask);
}
return true;
}
}
if ($_SERVER['HTTP_CF_CONNECTING_IP'] && G5CheckCloudFlare::check_cloudflare_ips($_SERVER['REMOTE_ADDR'])) {
$_SERVER['REMOTE_ADDR'] = preg_replace('/[^0-9a-fA-F:.]/', '', $_SERVER['HTTP_CF_CONNECTING_IP']);
// Cloudflare 환경을 고려한 https 사용여부
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === "https") {
$_SERVER['HTTPS'] = 'on';
} elseif (isset($_SERVER['HTTP_CF_VISITOR']) && stripos($_SERVER['HTTP_CF_VISITOR'], 'https') !== false) {
$_SERVER['HTTPS'] = 'on';
}
}
+56 -14
View File
@@ -102,6 +102,10 @@ function goto_url($url)
{ {
run_event('goto_url', $url); run_event('goto_url', $url);
if (function_exists('safe_filter_url_host')) {
$url = safe_filter_url_host($url);
}
$url = str_replace("&amp;", "&", $url); $url = str_replace("&amp;", "&", $url);
//echo "<script> location.replace('$url'); </script>"; //echo "<script> location.replace('$url'); </script>";
@@ -182,6 +186,10 @@ function alert($msg='', $url='', $error=true, $post=false)
run_event('alert', $msg, $url, $error, $post); run_event('alert', $msg, $url, $error, $post);
if (function_exists('safe_filter_url_host')) {
$url = safe_filter_url_host($url);
}
$msg = $msg ? strip_tags($msg, '<br>') : '올바른 방법으로 이용해 주십시오.'; $msg = $msg ? strip_tags($msg, '<br>') : '올바른 방법으로 이용해 주십시오.';
$header = ''; $header = '';
@@ -220,6 +228,12 @@ function confirm($msg, $url1='', $url2='', $url3='')
alert($msg); alert($msg);
} }
if (function_exists('safe_filter_url_host')) {
$url1 = safe_filter_url_host($url1);
$url2 = safe_filter_url_host($url2);
$url3 = safe_filter_url_host($url3);
}
if(!trim($url1) || !trim($url2)) { if(!trim($url1) || !trim($url2)) {
$msg = '$url1 과 $url2 를 지정해 주세요.'; $msg = '$url1 과 $url2 를 지정해 주세요.';
alert($msg); alert($msg);
@@ -655,7 +669,7 @@ function html_purifier($html)
if ((function_exists('check_html_link_nofollow') && check_html_link_nofollow('html_purifier'))) { if ((function_exists('check_html_link_nofollow') && check_html_link_nofollow('html_purifier'))) {
$config->set('HTML.Nofollow', true); // rel=nofollow 으로 스팸유입을 줄임 $config->set('HTML.Nofollow', true); // rel=nofollow 으로 스팸유입을 줄임
} }
$config->set('URI.SafeIframeRegexp', '%^(https?:)?//(' . $safeiframe . ')%'); $config->set('URI.SafeIframeRegexp', '%^(https?:)?//(' . preg_replace('/\\\?\./', '\.', $safeiframe) . ')%');
$config->set('Attr.AllowedFrameTargets', array('_blank')); $config->set('Attr.AllowedFrameTargets', array('_blank'));
//유튜브, 비메오 전체화면 가능하게 하기 //유튜브, 비메오 전체화면 가능하게 하기
$config->set('Filter.Custom', array(new HTMLPurifier_Filter_Iframevideo())); $config->set('Filter.Custom', array(new HTMLPurifier_Filter_Iframevideo()));
@@ -712,7 +726,7 @@ function get_sql_search($search_ca_name, $search_field, $search_text, $search_op
$tmp = explode(",", trim($search_field)); $tmp = explode(",", trim($search_field));
$field = explode("||", $tmp[0]); $field = explode("||", $tmp[0]);
$not_comment = ""; $not_comment = "";
if (!empty($tmp[1])) if (isset($tmp[1]))
$not_comment = $tmp[1]; $not_comment = $tmp[1];
$str .= "("; $str .= "(";
@@ -768,8 +782,11 @@ function get_sql_search($search_ca_name, $search_field, $search_text, $search_op
$op1 = " $search_operator "; $op1 = " $search_operator ";
} }
$str .= " ) "; $str .= " ) ";
if ($not_comment) if ($not_comment === '1') {
$str .= " and wr_is_comment = '0' "; $str .= " and wr_is_comment = '0' ";
} else if ($not_comment === '0') {
$str .= " and wr_is_comment = '1' ";
}
return $str; return $str;
} }
@@ -832,23 +849,33 @@ function get_group($gr_id, $is_cache=false)
} }
// 회원 정보를 얻는다. /**
function get_member($mb_id, $fields='*', $is_cache=false) * 회원 정보를 얻는다
*
* @param string $mb_id
* @param string $fields
* @param bool $is_cache
*
* @return array
*/
function get_member($mb_id, $fields = '*', $is_cache = false)
{ {
global $g5; global $g5;
if (preg_match("/[^0-9a-z_]+/i", $mb_id)) $mb_id = trim($mb_id);
if (preg_match("/[^0-9a-z_]+/i", $mb_id)) {
return array(); return array();
}
static $cache = array(); static $cache = array();
$key = md5($fields); $key = md5($fields);
if( $is_cache && isset($cache[$mb_id]) && isset($cache[$mb_id][$key]) ){ if ($is_cache && isset($cache[$mb_id]) && isset($cache[$mb_id][$key])) {
return $cache[$mb_id][$key]; return $cache[$mb_id][$key];
} }
$sql = " select $fields from {$g5['member_table']} where mb_id = TRIM('$mb_id') "; $sql = " SELECT {$fields} from {$g5['member_table']} where mb_id = '{$mb_id}' ";
$cache[$mb_id][$key] = run_replace('get_member', sql_fetch($sql), $mb_id, $fields, $is_cache); $cache[$mb_id][$key] = run_replace('get_member', sql_fetch($sql), $mb_id, $fields, $is_cache);
@@ -1320,6 +1347,10 @@ function delete_point($mb_id, $rel_table, $rel_id, $rel_action)
and po_rel_action = '$rel_action' "; and po_rel_action = '$rel_action' ";
$row = sql_fetch($sql); $row = sql_fetch($sql);
if (! (isset($row['po_id']) && $row['po_id'])) {
return true;
}
if(isset($row['po_point']) && $row['po_point'] < 0) { if(isset($row['po_point']) && $row['po_point'] < 0) {
$mb_id = $row['mb_id']; $mb_id = $row['mb_id'];
$po_point = abs($row['po_point']); $po_point = abs($row['po_point']);
@@ -1652,7 +1683,10 @@ function sql_connect($host, $user, $pass, $db=G5_MYSQL_DB)
die('Connect Error: '.mysqli_connect_error()); die('Connect Error: '.mysqli_connect_error());
} }
} else { } else {
$link = mysql_connect($host, $user, $pass); if (!function_exists('mysql_connect')) {
die('MySQL이 설치되지 않아 mysql_connect 함수를 사용할 수 없습니다.');
}
$link = mysql_connect($host, $user, $pass) or die('MySQL Host, User, Password 정보에 오류가 있습니다.');
} }
return $link; return $link;
@@ -2098,7 +2132,7 @@ function time_select($time, $name="")
preg_match("/([0-9]{2}):([0-9]{2}):([0-9]{2})/", $time, $m); preg_match("/([0-9]{2}):([0-9]{2}):([0-9]{2})/", $time, $m);
// 시 // 시
$s .= "<select name='{$name}_h'>"; $s = "<select name='{$name}_h'>";
for ($i=0; $i<=23; $i++) { for ($i=0; $i<=23; $i++) {
$s .= "<option value='$i'"; $s .= "<option value='$i'";
if ($i == $m['0']) { if ($i == $m['0']) {
@@ -2285,7 +2319,7 @@ function ss_mb_key($member, $regenerate = false)
set_cookie('mb_client_key', $client_key, G5_SERVER_TIME * -1); set_cookie('mb_client_key', $client_key, G5_SERVER_TIME * -1);
} }
$mb_key = md5($member['mb_datetime'] . $client_key) . md5($_SERVER['HTTP_USER_AGENT']); $mb_key = md5($member['mb_datetime'] . $client_key) . run_replace('ss_mb_key_user_agent', md5($_SERVER['HTTP_USER_AGENT']));
return $mb_key; return $mb_key;
} }
@@ -3594,6 +3628,13 @@ function login_password_check($mb, $pass, $hash)
return check_password($pass, $hash); return check_password($pass, $hash);
} }
function safe_filter_url_host($url) {
$regex = run_replace('safe_filter_url_regex', '\\', $url);
return $regex ? preg_replace('#'. preg_quote($regex, '#') .'#iu', '', $url) : '';
}
// 동일한 host url 인지 // 동일한 host url 인지
function check_url_host($url, $msg='', $return_url=G5_URL, $is_redirect=false) function check_url_host($url, $msg='', $return_url=G5_URL, $is_redirect=false)
{ {
@@ -3605,14 +3646,15 @@ function check_url_host($url, $msg='', $return_url=G5_URL, $is_redirect=false)
} }
// KVE-2021-1277 Open Redirect 취약점 해결 // KVE-2021-1277 Open Redirect 취약점 해결
if (preg_match('#\\\0#', $url)) { if (preg_match('#\\\0#', $url) || preg_match('/^\/{1,}\\\/', $url)) {
alert('url 에 올바르지 않은 값이 포함되어 있습니다.'); alert('url 에 올바르지 않은 값이 포함되어 있습니다.');
} }
while ( ( $replace_url = preg_replace(array('/\/{2,}/', '/\\@/'), array('//', ''), urldecode($url)) ) != $url ) { while ( ( $replace_url = preg_replace(array('/\/{2,}/', '/\\@/'), array('//', ''), urldecode($url)) ) != $url ) {
$url = $replace_url; $url = $replace_url;
} }
$p = @parse_url(trim($url));
$p = @parse_url(trim(str_replace('\\', '', $url)));
$host = preg_replace('/:[0-9]+$/', '', $_SERVER['HTTP_HOST']); $host = preg_replace('/:[0-9]+$/', '', $_SERVER['HTTP_HOST']);
$is_host_check = false; $is_host_check = false;
+8 -2
View File
@@ -145,8 +145,14 @@ function get_content_by_field($write_table, $type='bbs', $where_field='', $where
{ {
global $g5, $g5_object; global $g5, $g5_object;
static $cache = array();
$order_key = 'wr_id';
if( $type === 'content' ){ if( $type === 'content' ){
$check_array = array('co_id', 'co_html', 'co_subject', 'co_content', 'co_seo_title', 'co_mobile_content', 'co_skin', 'co_mobile_skin', 'co_tag_filter_use', 'co_hit', 'co_include_head', 'co_include_tail'); $check_array = array('co_id', 'co_html', 'co_subject', 'co_content', 'co_seo_title', 'co_mobile_content', 'co_skin', 'co_mobile_skin', 'co_tag_filter_use', 'co_hit', 'co_include_head', 'co_include_tail');
$order_key = 'co_id';
} else { } else {
$check_array = array('wr_id', 'wr_num', 'wr_reply', 'wr_parent', 'wr_is_comment', 'ca_name', 'wr_option', 'wr_subject', 'wr_content', 'wr_seo_title', 'wr_link1', 'wr_link2', 'wr_hit', 'wr_good', 'wr_nogood', 'mb_id', 'wr_name', 'wr_email', 'wr_homepage', 'wr_datetime', 'wr_ip', 'wr_1', 'wr_2', 'wr_3', 'wr_4', 'wr_5', 'wr_6', 'wr_7', 'wr_8', 'wr_9', 'wr_10'); $check_array = array('wr_id', 'wr_num', 'wr_reply', 'wr_parent', 'wr_is_comment', 'ca_name', 'wr_option', 'wr_subject', 'wr_content', 'wr_seo_title', 'wr_link1', 'wr_link2', 'wr_hit', 'wr_good', 'wr_nogood', 'mb_id', 'wr_name', 'wr_email', 'wr_homepage', 'wr_datetime', 'wr_ip', 'wr_1', 'wr_2', 'wr_3', 'wr_4', 'wr_5', 'wr_6', 'wr_7', 'wr_8', 'wr_9', 'wr_10');
} }
@@ -162,7 +168,7 @@ function get_content_by_field($write_table, $type='bbs', $where_field='', $where
return $cache[$key]; return $cache[$key];
} }
$sql = " select * from {$write_table} where $where_field = '".sql_real_escape_string($where_value)."' "; $sql = " select * from {$write_table} where $where_field = '".sql_real_escape_string($where_value)."' order by $order_key desc limit 1 ";
$cache[$key] = sql_fetch($sql); $cache[$key] = sql_fetch($sql);
@@ -394,7 +400,7 @@ function get_mb_icon_name($mb_id){
// 생성되면 안되는 게시판명 // 생성되면 안되는 게시판명
function get_bo_table_banned_word(){ function get_bo_table_banned_word(){
$folders = array(); $folders = array(G5_CONTENT_DIR, 'rss');
foreach(glob(G5_PATH.'/*', GLOB_ONLYDIR) as $dir) { foreach(glob(G5_PATH.'/*', GLOB_ONLYDIR) as $dir) {
$folders[] = basename($dir); $folders[] = basename($dir);
+1 -1
View File
@@ -4,7 +4,7 @@ if (!defined('_GNUBOARD_')) exit;
// 최신글 추출 // 최신글 추출
// $cache_time 캐시 갱신시간 // $cache_time 캐시 갱신시간
function latest($skin_dir='', $bo_table, $rows=10, $subject_len=40, $cache_time=1, $options='') function latest($skin_dir='', $bo_table='', $rows=10, $subject_len=40, $cache_time=1, $options='')
{ {
global $g5; global $g5;
+2 -2
View File
@@ -32,9 +32,9 @@ function get_shop_item_with_category($it_id, $seo_title='', $add_query=''){
global $g5, $default; global $g5, $default;
if( $seo_title ){ if( $seo_title ){
$sql = " select a.*, b.ca_name, b.ca_use from {$g5['g5_shop_item_table']} a, {$g5['g5_shop_category_table']} b where a.it_seo_title = '".sql_real_escape_string(generate_seo_title($seo_title))."' and a.ca_id = b.ca_id $add_query"; $sql = " select a.*, b.ca_name, b.ca_use from {$g5['g5_shop_item_table']} a, {$g5['g5_shop_category_table']} b where a.it_seo_title = '".sql_real_escape_string(generate_seo_title($seo_title))."' and a.ca_id = b.ca_id $add_query order by it_id desc limit 1";
} else { } else {
$sql = " select a.*, b.ca_name, b.ca_use from {$g5['g5_shop_item_table']} a, {$g5['g5_shop_category_table']} b where a.it_id = '$it_id' and a.ca_id = b.ca_id $add_query"; $sql = " select a.*, b.ca_name, b.ca_use from {$g5['g5_shop_item_table']} a, {$g5['g5_shop_category_table']} b where a.it_id = '$it_id' and a.ca_id = b.ca_id $add_query order by it_id desc limit 1";
} }
$item = sql_fetch($sql); $item = sql_fetch($sql);
+52 -1
View File
@@ -2487,6 +2487,15 @@ function shop_is_taxsave($od, $is_view_receipt=false){
return 0; return 0;
} }
// 해당 주문에 현금영수증이 발급되었다면 마이페이지 주문
function is_order_cashreceipt($od) {
if ($od['od_cash'] && $od['od_cash_no'] && $od['od_cash_info'] && $od['od_receipt_price'] && in_array($od['od_settle_case'], array('무통장', '계좌이체', '가상계좌'))) {
return true;
}
return false;
}
// 장바구니 금액 체크 $is_price_update 가 true 이면 장바구니 가격 업데이트한다. // 장바구니 금액 체크 $is_price_update 가 true 이면 장바구니 가격 업데이트한다.
function before_check_cart_price($s_cart_id, $is_ct_select_condition=false, $is_price_update=false, $is_item_cache=false){ function before_check_cart_price($s_cart_id, $is_ct_select_condition=false, $is_price_update=false, $is_item_cache=false){
global $g5, $default, $config; global $g5, $default, $config;
@@ -2642,6 +2651,15 @@ function make_order_field($data, $exclude)
return $field; return $field;
} }
function shop_order_data_fields($is_personal=0) {
if ($is_personal){
return array('pp_name', 'pp_email', 'pp_hp', 'pp_settle_case');
}
return array('od_price', 'od_name', 'od_tel', 'od_hp', 'od_email', 'od_memo', 'od_settle_case', 'max_temp_point', 'od_temp_point', 'od_bank_account', 'od_deposit_name', 'od_test', 'od_ip', 'od_zip', 'od_addr1', 'od_addr2', 'od_addr3', 'od_addr_jibeon', 'od_b_name', 'od_b_tel', 'od_b_hp', 'od_b_addr1', 'od_b_addr2', 'od_b_addr3', 'od_b_addr_jibeon', 'od_b_zip', 'od_send_cost', 'od_send_cost2', 'od_hope_date');
}
// 주문요청기록 로그를 남깁니다. // 주문요청기록 로그를 남깁니다.
function add_order_post_log($msg='', $code='error'){ function add_order_post_log($msg='', $code='error'){
global $g5, $member; global $g5, $member;
@@ -2729,7 +2747,7 @@ function is_inicis_order_pay($type){
return false; return false;
} }
function get_item_images_info($it, $size=array(), $image_width, $image_height){ function get_item_images_info($it, $size=array(), $image_width=0, $image_height=0){
if( !(is_array($it) && $it) ) return array(); if( !(is_array($it) && $it) ) return array();
$images = array(); $images = array();
@@ -2752,6 +2770,39 @@ function get_item_images_info($it, $size=array(), $image_width, $image_height){
return $images; return $images;
} }
function check_payment_method($od_settle_case) {
global $default;
$is_block = 0;
if ($od_settle_case === '무통장') {
if (! $default['de_bank_use']) {
$is_block = 1;
}
} else if ($od_settle_case === '계좌이체') {
if (! $default['de_iche_use']) {
$is_block = 1;
}
} else if ($od_settle_case === '가상계좌') {
if (! $default['de_vbank_use']) {
$is_block = 1;
}
} else if ($od_settle_case === '휴대폰') {
if (! $default['de_hp_use']) {
$is_block = 1;
}
} else if ($od_settle_case === '신용카드') {
if (! $default['de_card_use']) {
$is_block = 1;
}
}
if ($is_block) {
alert($od_settle_case.' 은 결제수단에서 사용이 금지되어 있습니다.', G5_SHOP_URL);
die('');
}
}
//결제방식 이름을 체크하여 치환 대상인 문자열은 따로 리턴합니다. //결제방식 이름을 체크하여 치환 대상인 문자열은 따로 리턴합니다.
function check_pay_name_replace($payname, $od=array(), $is_client=0){ function check_pay_name_replace($payname, $od=array(), $is_client=0){
+53 -2
View File
@@ -253,10 +253,61 @@ function exist_seo_url($type, $seo_title, $write_table, $sql_id=0){
return ''; return '';
} }
function check_case_exist_title($data, $case=G5_BBS_DIR, $is_redirect=false) {
global $config, $g5, $board;
if ((int) $config['cf_bbs_rewrite'] !== 2) {
return;
}
$seo_title = '';
$redirect_url = '';
if ($case == G5_BBS_DIR && isset($data['wr_seo_title'])) {
$db_table = $g5['write_prefix'].$board['bo_table'];
if (exist_seo_url($case, $data['wr_seo_title'], $db_table, $data['wr_id'])) {
$seo_title = $data['wr_seo_title'].'-'.$data['wr_id'];
$sql = " update `{$db_table}` set wr_seo_title = '".sql_real_escape_string($seo_title)."' where wr_id = '{$data['wr_id']}' ";
sql_query($sql, false);
get_write($db_table, $data['wr_id'], false);
$redirect_url = get_pretty_url($board['bo_table'], $data['wr_id']);
}
} else if ($case == G5_CONTENT_DIR && isset($data['co_seo_title'])) {
$db_table = $g5['content_table'];
if (exist_seo_url($case, $data['co_seo_title'], $db_table, $data['co_id'])) {
$seo_title = $data['co_seo_title'].'-'.substr(get_random_token_string(4), 4);
$sql = " update `{$db_table}` set co_seo_title = '".sql_real_escape_string($seo_title)."' where co_id = '{$data['co_id']}' ";
sql_query($sql, false);
get_content_db($data['co_id'], false);
g5_delete_cache_by_prefix('content-' . $data['co_id'] . '-');
$redirect_url = get_pretty_url($case, $data['co_id']);
}
} else if (defined('G5_SHOP_DIR') && $case == G5_SHOP_DIR && isset($data['it_seo_title'])) {
$db_table = $g5['g5_shop_item_table'];
if (shop_exist_check_seo_title($data['it_seo_title'], $case, $db_table, $data['it_id'])) {
$seo_title = $data['it_seo_title'].'-'.substr(get_random_token_string(4), 4);
$sql = " update `{$db_table}` set it_seo_title = '".sql_real_escape_string($seo_title)."' where it_id = '{$data['it_id']}' ";
sql_query($sql, false);
get_shop_item($data['it_id'], false);
$redirect_url = get_pretty_url($case, $data['it_id']);
}
}
if ($is_redirect && $seo_title && $redirect_url) {
goto_url($redirect_url);
}
}
function exist_seo_title_recursive($type, $seo_title, $write_table, $sql_id=0){ function exist_seo_title_recursive($type, $seo_title, $write_table, $sql_id=0){
static $count = 0; static $count = 0;
$seo_title_add = ($count > 0) ? utf8_strcut($seo_title, 200 - ($count+1), '')."-$count" : $seo_title; $seo_title_add = ($count > 0) ? utf8_strcut($seo_title, 100000 - ($count+1), '')."-$count" : $seo_title;
if( ! exist_seo_url($type, $seo_title_add, $write_table, $sql_id) ){ if( ! exist_seo_url($type, $seo_title_add, $write_table, $sql_id) ){
return $seo_title_add; return $seo_title_add;
@@ -264,7 +315,7 @@ function exist_seo_title_recursive($type, $seo_title, $write_table, $sql_id=0){
$count++; $count++;
if( $count > 198 ){ if( $count > 99998 ){
return $seo_title_add; return $seo_title_add;
} }
+1 -1
View File
@@ -33,7 +33,7 @@ else
$order_by = 'b.it_order, b.it_id desc'; $order_by = 'b.it_order, b.it_id desc';
if ($skin) { if ($skin) {
$skin = preg_replace('#\.+(\/|\\\)#', '', $skin); $skin = preg_replace(array('#\.+(\/|\\\)#', '#[\'\"]#'), array('', ''), $skin);
$ev['ev_skin'] = $skin; $ev['ev_skin'] = $skin;
} }
+2
View File
@@ -16,6 +16,8 @@ if( isset($row['it_seo_title']) && ! $row['it_seo_title'] ){
shop_seo_title_update($row['it_id']); shop_seo_title_update($row['it_id']);
} }
if (function_exists('check_case_exist_title')) check_case_exist_title($it, G5_SHOP_DIR, true);
if (!($it['ca_use'] && $it['it_use'])) { if (!($it['ca_use'] && $it['it_use'])) {
if (!$is_admin) if (!$is_admin)
alert('판매가능한 상품이 아닙니다.'); alert('판매가능한 상품이 아닙니다.');
+1 -1
View File
@@ -99,7 +99,7 @@ class PayService extends SoapClient
var $resMsg; var $resMsg;
public function PayService( $wsdl = "", $options = array() ) public function __construct( $wsdl = "", $options = array() )
{ {
foreach( self::$classmap as $key => $value ) foreach( self::$classmap as $key => $value )
{ {
+18 -1
View File
@@ -9,7 +9,6 @@
/* = Copyright (c) 2010.05 KCP Inc. All Rights Reserved. = */ /* = Copyright (c) 2010.05 KCP Inc. All Rights Reserved. = */
/* ============================================================================== */ /* ============================================================================== */
/* ============================================================================== */ /* ============================================================================== */
/* = 환경 설정 파일 Include = */ /* = 환경 설정 파일 Include = */
/* = -------------------------------------------------------------------------- = */ /* = -------------------------------------------------------------------------- = */
@@ -110,6 +109,24 @@
/* = -------------------------------------------------------------------------- = */ /* = -------------------------------------------------------------------------- = */
if ( $req_tx == "pay" ) if ( $req_tx == "pay" )
{ {
/* 1004원은 실제로 업체에서 결제하셔야 될 원 금액을 넣어주셔야 합니다. 결제금액 유효성 검증 */
$c_PayPlus->mf_set_ordr_data( "ordr_mony", $good_mny );
$kcp_pay_type = ''; // 결제수단 검증 파라미터 pay_type (신용카드 : PACA, 계좌이체 : PABK, 가상계좌 : PAVC, 휴대폰 : PAMC)
if ($use_pay_method == "100000000000" && (in_array($od_settle_case, array('신용카드', '간편결제')))) { // 신용카드
$kcp_pay_type = 'PACA';
} else if ($use_pay_method == "010000000000" && $od_settle_case === '계좌이체') { // 계좌이체
$kcp_pay_type = 'PABK';
} else if ($use_pay_method == "001000000000" && $od_settle_case === '가상계좌') { // 가상계좌
$kcp_pay_type = 'PAVC';
} else if ($use_pay_method == "000010000000" && $od_settle_case === '휴대폰') { // 휴대폰
$kcp_pay_type = 'PAMC';
}
$c_PayPlus->mf_set_ordr_data( "pay_type", $kcp_pay_type );
$c_PayPlus->mf_set_ordr_data( "ordr_no", $ordr_idxx );
$post_enc_data = isset($_POST["enc_data"]) ? $_POST["enc_data"] : ''; $post_enc_data = isset($_POST["enc_data"]) ? $_POST["enc_data"] : '';
$post_enc_info = isset($_POST["enc_info"]) ? $_POST["enc_info"] : ''; $post_enc_info = isset($_POST["enc_info"]) ? $_POST["enc_info"] : '';
+1 -1
View File
@@ -2,7 +2,7 @@
// 해당 페이지는 사용자가 ISP{국민/BC) 카드 결제를 성공하였을 때, 사용자에게 보여지는 페이지입니다. // 해당 페이지는 사용자가 ISP{국민/BC) 카드 결제를 성공하였을 때, 사용자에게 보여지는 페이지입니다.
include_once('./_common.php'); include_once('./_common.php');
$LGD_OID = clean_xss_tags($_GET['LGD_OID']); $LGD_OID = clean_xss_tags($_GET['LGD_OID'], 1, 1);
echo "LGD_OID = ".$LGD_OID; echo "LGD_OID = ".$LGD_OID;
+4 -2
View File
@@ -80,6 +80,8 @@ $payReqMap['LGD_HASHDATA'] = $LGD_HASHDATA; // MD5 해쉬
$payReqMap['LGD_RETURNURL'] = $LGD_RETURNURL; // 응답수신페이지 $payReqMap['LGD_RETURNURL'] = $LGD_RETURNURL; // 응답수신페이지
$payReqMap['LGD_VERSION'] = "PHP_SmartXPay_1.0"; // 버전정보 (삭제하지 마세요) $payReqMap['LGD_VERSION'] = "PHP_SmartXPay_1.0"; // 버전정보 (삭제하지 마세요)
$payReqMap['LGD_CUSTOM_FIRSTPAY'] = $LGD_CUSTOM_FIRSTPAY; // 디폴트 결제수단 $payReqMap['LGD_CUSTOM_FIRSTPAY'] = $LGD_CUSTOM_FIRSTPAY; // 디폴트 결제수단
// 2024년 7월에 모바일 결제수단 키가 LGD_CUSTOM_USABLEPAY 키로 쓰이는 것을 확인함
$payReqMap['LGD_CUSTOM_USABLEPAY'] = $LGD_CUSTOM_FIRSTPAY; // 디폴트 결제수단
$payReqMap['LGD_CUSTOM_SWITCHINGTYPE'] = "SUBMIT"; // 신용카드 카드사 인증 페이지 연동 방식 $payReqMap['LGD_CUSTOM_SWITCHINGTYPE'] = "SUBMIT"; // 신용카드 카드사 인증 페이지 연동 방식
$payReqMap['LGD_ENCODING'] = "UTF-8"; $payReqMap['LGD_ENCODING'] = "UTF-8";
$payReqMap['LGD_ENCODING_NOTEURL'] = "UTF-8"; $payReqMap['LGD_ENCODING_NOTEURL'] = "UTF-8";
@@ -137,9 +139,9 @@ include_once(G5_PATH.'/head.sub.php');
?> ?>
<?php if ($default['de_card_test']) { // 테스트 결제시 ?> <?php if ($default['de_card_test']) { // 테스트 결제시 ?>
<script language="javascript" src="https://pretest.uplus.co.kr:9443/xpay/js/xpay_crossplatform.js" type="text/javascript"></script> <script language="javascript" src="https://js.tosspayments.com/xpay_crossplatform/sandbox/v1" type="text/javascript"></script>
<?php } else { //실 결제시 ?> <?php } else { //실 결제시 ?>
<script language="javascript" src="//xpay.uplus.co.kr/xpay/js/xpay_crossplatform.js" type="text/javascript"></script> <script language="javascript" src="https://xpay.tosspayments.com/xpay/js/xpay_crossplatform.js" type="text/javascript"></script>
<?php } ?> <?php } ?>
<script type="text/javascript"> <script type="text/javascript">
+1 -1
View File
@@ -168,7 +168,7 @@ var g5_shop_url = "<?php echo G5_SHOP_URL; ?>";
<?php <?php
$qstr1 = ''; $qstr1 = '';
if($i > 0 && $total_count > $items) { if($total_count > $items) {
$qstr1 .= 'ca_id='.$ca_id; $qstr1 .= 'ca_id='.$ca_id;
$qstr1 .='&sort='.$sort.'&sortodr='.$sortodr; $qstr1 .='&sort='.$sort.'&sortodr='.$sortodr;
$ajax_url = G5_SHOP_URL.'/ajax.list.php?'.$qstr1.'&use_sns=1'; $ajax_url = G5_SHOP_URL.'/ajax.list.php?'.$qstr1.'&use_sns=1';
+6
View File
@@ -0,0 +1,6 @@
<?php
include_once('../../../common.php');
if (!defined('G5_USE_SHOP') || !G5_USE_SHOP)
die('<p>쇼핑몰 설치 후 이용해 주십시오.</p>');
define('_SHOP_', true);
+2
View File
@@ -0,0 +1,2 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
+190
View File
@@ -0,0 +1,190 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
// 나이스페이 공통 설정
require_once(G5_MSHOP_PATH.'/settle_nicepay.inc.php');
/*
****************************************************************************************
* <Authentication Result Parameter>
****************************************************************************************
*/
$authResultCode = isset($_POST['AuthResultCode']) ? clean_xss_tags($_POST['AuthResultCode']) : ''; // authentication result code 0000:success
$authResultMsg = isset($_POST['AuthResultMsg']) ? clean_xss_tags($_POST['AuthResultMsg']) : ''; // authentication result message
$nextAppURL = isset($_POST['NextAppURL']) ? clean_xss_tags($_POST['NextAppURL']) : ''; // authorization request URL
$txTid = isset($_POST['TxTid']) ? clean_xss_tags($_POST['TxTid']) : ''; // transaction ID
$authToken = isset($_POST['AuthToken']) ? clean_xss_tags($_POST['AuthToken']) : ''; // authentication TOKEN
$payMethod = isset($_POST['PayMethod']) ? clean_xss_tags($_POST['PayMethod']) : ''; // payment method
$mid = isset($_POST['MID']) ? clean_xss_tags($_POST['MID']) : ''; // merchant id
$moid = isset($_POST['Moid']) ? clean_xss_tags($_POST['Moid']) : ''; // order number
$amt = isset($_POST['Amt']) ? (int) preg_replace('/[^0-9]/', '', $_POST['Amt']) : 0; // Amount of payment
$reqReserved = isset($_POST['ReqReserved']) ? clean_xss_tags($_POST['ReqReserved']) : ''; // mall custom field
$netCancelURL = isset($_POST['NetCancelURL']) ? clean_xss_tags($_POST['NetCancelURL']) : ''; // netCancelURL
if (isset($pp['pp_id']) && $pp['pp_id']) { //개인결제
$session_order_id = get_session('ss_personalpay_id');
$order_price = (int) $pp['pp_price'];
} else {
$session_order_id = get_session('ss_order_id'); // 쇼핑몰 일반결제
}
if ($session_order_id != $moid){
alert("요청한 주문번호가 틀려서 결제를 진행할수 없습니다.\\n다시 장바구니에서 시도해 주세요.", G5_SHOP_URL);
}
if ($default['de_nicepay_mid'] != $mid) {
alert("요청한 상점 mid와 설정된 mid가 틀리므로 결제를 진행할수 없습니다.", G5_SHOP_URL);
}
if ($order_price != $amt) {
alert("요청한 결제금액이 틀리므로 결제를 진행할수 없습니다.", G5_SHOP_URL);
}
// API CALL foreach example
if (! function_exists('jsonRespDump')) {
function jsonRespDump($resp){
$respArr = json_decode($resp);
foreach ( $respArr as $key => $value ){
echo "$key=". $value."<br />";
}
}
}
if (! function_exists('nicepay_res')) {
function nicepay_res($key, $data, $default_val='') {
$response_val = isset($data[$key]) ? $data[$key] : $default_val;
return ($response_val ? $response_val : $default_val);
}
}
/*
****************************************************************************************
* <authorization parameters init>
****************************************************************************************
*/
$response = "";
if($authResultCode === "0000"){
/*
****************************************************************************************
* <Hash encryption> (do not modify)
****************************************************************************************
*/
$ediDate = preg_replace('/[^0-9]/', '', G5_TIME_YMDHIS);
$merchantKey = $default['de_nicepay_key']; // 상점키
$signData = bin2hex(hash('sha256', $authToken . $mid . $amt . $ediDate . $merchantKey, true));
try{
$data = Array(
'TID' => $txTid,
'AuthToken' => $authToken,
'MID' => $mid,
'Amt' => $amt,
'EdiDate' => $ediDate,
'SignData' => $signData,
'CharSet' => 'utf-8'
);
/*
****************************************************************************************
* <authorization request>
* authorization through server to server communication.
****************************************************************************************
// 3001 : 신용카드 성공코드
// 4000 : 계좌이체 성공코드
// 4100 : 가상계좌 발급 성공코드
// A000 : 휴대폰 소액결제 성공코드
// 7001 : 현금영수증
// https://developers.nicepay.co.kr/manual-auth.php
*/
$response = nicepay_reqPost($data, $nextAppURL);
$respArr = json_decode($response, true);
$ResultCode = nicepay_res('ResultCode', $respArr);
$ResultMsg = nicepay_res('ResultMsg', $respArr);
$tno = nicepay_res('TID', $respArr);
$amount = (int) nicepay_res('Amt', $respArr, 0);
$app_time = nicepay_res('AuthDate', $respArr);
$pay_method = nicepay_res('PayMethod', $respArr);
$od_app_no = $app_no = nicepay_res('AuthCode', $respArr); // 승인 번호 (신용카드, 계좌이체, 휴대폰)
$pay_type = $NICEPAY_METHOD[$pay_method];
// 승인된 코드가 아니면 결제가 되지 않게 합니다.
if (! in_array($ResultCode, array('3001', '4000', '4100', 'A000', '7001'))) {
alert($ResultMsg.' 코드 : '.$ResultCode, G5_SHOP_URL);
die();
}
if ($ResultCode == '3001') { // 신용카드
$card_cd = nicepay_res('CardCode', $respArr); // 카드사 코드
$card_name = nicepay_res('CardName', $respArr); // 카드 종류
} else if ($ResultCode == '4100') { // 가상계좌
$bank_name = $bankname = nicepay_res('VbankBankName', $respArr);
$account = nicepay_res('VbankNum', $respArr);
$va_date = nicepay_res('VbankExpDate', $respArr).' '.nicepay_res('VbankExpTime', $respArr); // 가상계좌 입금마감시간
$app_no = nicepay_res('VbankNum', $respArr);
if ($default['de_escrow_use'] == 1)
$escw_yn = 'Y';
} else if ($ResultCode == '4000') { // 계좌이체
$bank_name = $bankname = nicepay_res('BankName', $respArr);
$bank_code = nicepay_res('BankCode', $respArr);
$RcptType = nicepay_res('RcptType', $respArr); // 현금영수증타입 (0:발행안함,1:소득공제,2:지출증빙)
$RcptTID = nicepay_res('RcptTID', $respArr); // 현금영수증 TID, 현금영수증 거래인 경우 리턴
$RcptAuthCode = nicepay_res('RcptAuthCode', $respArr); // 현금영수증 승인번호, 현금영수증 거래인 경우 리턴
$AuthDate = nicepay_res('AuthDate', $respArr); // 현금영수증 승인번호, 현금영수증 거래인 경우 리턴
// 현금영수증 발급시 1 또는 2 이면
if ($RcptType) {
$pg_receipt_infos['od_cash'] = 1; // 현금영수증 발급인것으로 처리
$pg_receipt_infos['od_cash_no'] = $RcptAuthCode; // 현금영수증 승인번호
$pg_receipt_infos['od_cash_info'] = serialize(array('TID'=>$RcptTID, 'ApplNum'=>$RcptAuthCode, 'AuthDate'=>$AuthDate));
}
if ($default['de_escrow_use'] == 1)
$escw_yn = 'Y';
}
$depositor = ''; // 입금할 계좌 예금주 (나이스페이 경우 가상계좌의 예금주명을 리턴받지 못합니다. )
$account = nicepay_res('VbankNum', $respArr);
$commid = ''; // 통신사 코드
$mobile_no = ''; // 휴대폰결제시 휴대폰번호 (나이스페이 경우 결제한 휴대폰번호를 리턴받지 못합니다.)
$card_name = nicepay_res('CardName', $respArr);
} catch(Exception $e) {
$e->getMessage();
$data = Array(
'TID' => $txTid,
'AuthToken' => $authToken,
'MID' => $mid,
'Amt' => $amt,
'EdiDate' => $ediDate,
'SignData' => $signData,
'NetCancel' => '1',
'CharSet' => 'utf-8'
);
/*
*************************************************************************************
* <NET CANCEL>
* If an exception occurs during communication, cancelation is recommended
*************************************************************************************
*/
$response = nicepay_reqPost($data, $netCancelURL);
// jsonRespDump($response);
alert("결제 오류로 더 이상 진행할수 없습니다.");
}
} else {
//When authentication fail
$ResultCode = $authResultCode;
$ResultMsg = $authResultMsg;
alert($ResultMsg.' 실패 코드 : '.$ResultCode);
}
+140
View File
@@ -0,0 +1,140 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<!-- PC payment window only (not required for mobile payment window)-->
<script src="https://web.nicepay.co.kr/v3/webstd/js/nicepay-3.0.js" type="text/javascript"></script>
<script type="text/javascript">
//It is executed when call payment window.
function nicepayStart(f){
if(checkPlatform(window.navigator.userAgent) == "mobile"){
document.sm_form.action = "https://web.nicepay.co.kr/v3/v3Payment.jsp";
document.sm_form.acceptCharset="euc-kr";
document.sm_form.submit();
}else{
goPay(document.sm_form);
}
}
//[PC Only]When pc payment window is closed, nicepay-3.0.js call back nicepaySubmit() function <<'nicepaySubmit()' DO NOT CHANGE>>
function nicepaySubmit(){
document.sm_form.submit();
}
//[PC Only]payment window close function <<'nicepayClose()' DO NOT CHANGE>>
function nicepayClose(){
alert("payment window is closed");
}
//pc, mobile chack script (sample code)
function checkPlatform(ua) {
if(ua === undefined) {
ua = window.navigator.userAgent;
}
ua = ua.toLowerCase();
var platform = {};
var matched = {};
var userPlatform = "pc";
var platform_match = /(ipad)/.exec(ua) || /(ipod)/.exec(ua)
|| /(windows phone)/.exec(ua) || /(iphone)/.exec(ua)
|| /(kindle)/.exec(ua) || /(silk)/.exec(ua) || /(android)/.exec(ua)
|| /(win)/.exec(ua) || /(mac)/.exec(ua) || /(linux)/.exec(ua)
|| /(cros)/.exec(ua) || /(playbook)/.exec(ua)
|| /(bb)/.exec(ua) || /(blackberry)/.exec(ua)
|| [];
matched.platform = platform_match[0] || "";
if(matched.platform) {
platform[matched.platform] = true;
}
if(platform.android || platform.bb || platform.blackberry
|| platform.ipad || platform.iphone
|| platform.ipod || platform.kindle
|| platform.playbook || platform.silk
|| platform["windows phone"]) {
userPlatform = "mobile";
}
if(platform.cros || platform.mac || platform.linux || platform.win) {
userPlatform = "pc";
}
return userPlatform;
}
function nicepay_create_signdata(frm)
{
// 데이터 암호화 처리
var result = true;
$.ajax({
url: g5_url+"/shop/nicepay/createsigndata.php",
type: "POST",
data: {
price : frm.good_mny.value
},
dataType: "json",
async: false,
cache: false,
success: function(data) {
if(data.error == "") {
frm.EdiDate.value = data.ediDate;
frm.SignData.value = data.SignData;
} else {
alert(data.error);
result = false;
}
}
});
return result;
}
</script>
<form name="sm_form" method="post" action="" accept-charset="euc-kr">
<input type="hidden" name="PayMethod" value="CARD">
<input type="hidden" name="GoodsName" value="<?php echo get_text($goods); ?>">
<input type="hidden" name="Amt" value="<?php echo $tot_price; ?>">
<input type="hidden" name="MID" value="<?php echo $default['de_nicepay_mid']; ?>">
<input type="hidden" name="Moid" value="<?php echo $od_id; ?>">
<input type="hidden" name="BuyerName" value="">
<input type="hidden" name="BuyerEmail" value="">
<input type="hidden" name="BuyerTel" value="">
<input type="hidden" name="ReturnURL" value="<?php echo $nicepay_returnURL; ?>">
<input type="hidden" name="VbankExpDate" value="">
<input type="hidden" name="NpLang" value="KO"> <!-- EN:English, CN:Chinese, KO:Korean -->
<input type="hidden" name="GoodsCl" value="1"> <!-- products(1), contents(0)) -->
<input type="hidden" name="TransType" value="<?php echo $default['de_escrow_use'] ? '1' : '0';?>"> <!-- USE escrow false(0)/true(1) -->
<input type="hidden" name="CharSet" value="utf-8"> <!-- Return CharSet -->
<input type="hidden" name="ReqReserved" value=""> <!-- mall custom field -->
<input type="hidden" name="EdiDate" value=""> <!-- YYYYMMDDHHMISS -->
<input type="hidden" name="SignData" value=""> <!-- EncryptData -->
<input type="hidden" name="DirectShowOpt" value="">
<input type="hidden" name="SelectCardCode" value=""> <!-- 카드사 노출 제한, 카드코드 값(ex 비씨:01, 삼성:04) -->
<input type="hidden" name="NicepayReserved" value=""> <!-- 간편결제 (카카오페이에 사용됨) -->
<input type="hidden" name="DirectEasyPay"> <!-- 간편결제 요청 값 (네이버페이에 사용됨) -->
<input type="hidden" name="EasyPayMethod"> <!-- 간편결제 (네이버페이에 사용됨) -->
<input type="hidden" name="EasyPayCardCode"> <!-- 간편결제 카드 코드 -->
<input type="hidden" name="EasyPayQuota"> <!-- 간편결제 할부개월 (3개월일 경우 03 으로 설정) -->
<input type="hidden" name="MultiEasyPayQuota"> <!-- 간편결제 할부개월 다중 설정 옵션 PAYCO와 네이버페이만 가능 -->
<input type="hidden" name="good_mny" value="<?php echo $tot_price; ?>" >
<?php if ($default['de_tax_flag_use']) { ?>
<!-- 필드명:SupplyAmt / 사이즈:12 / 설명:공급가 액 -->
<input type="hidden" name="SupplyAmt" value="<?php echo $comm_tax_mny; ?>"> <!-- 과세금액 -->
<!-- 필드명:GoodsVat / 사이즈:12 / 설명:부가가 치세 -->
<input type="hidden" name="GoodsVat" value="<?php echo $comm_vat_mny; ?>"> <!-- 부가세 -->
<!-- 필드명:ServiceAmt / 사이즈:12 / 설명:봉사료 -->
<input type="hidden" name="ServiceAmt" value="0">
<!-- 필드명:TaxFreeAmt / 사이즈:12 / 설명:면세 금액 -->
<input type="hidden" name="TaxFreeAmt" value="<?php echo $comm_free_mny; ?>">
<input type="hidden" name="comm_tax_mny" value="<?php echo $comm_tax_mny; ?>"> <!-- 과세금액 -->
<input type="hidden" name="comm_vat_mny" value="<?php echo $comm_vat_mny; ?>"> <!-- 부가세 -->
<input type="hidden" name="comm_free_mny" value="<?php echo $comm_free_mny; ?>"> <!-- 비과세 금액 -->
<?php } ?>
</form>
+17
View File
@@ -0,0 +1,17 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<input type="hidden" name="good_mny" value="<?php echo $tot_price ?>" >
<?php if($default['de_tax_flag_use']) { ?>
<input type="hidden" name="comm_tax_mny" value="<?php echo $comm_tax_mny; ?>"> <!-- 과세금액 -->
<input type="hidden" name="comm_vat_mny" value="<?php echo $comm_vat_mny; ?>"> <!-- 부가세 -->
<input type="hidden" name="comm_free_mny" value="<?php echo $comm_free_mny; ?>"> <!-- 비과세 금액 -->
<?php } ?>
<div id="display_pay_button" class="btn_confirm">
<span id="show_req_btn"><input type="button" name="submitChecked" onClick="pay_approval();" value="결제등록" class="btn_submit"></span>
<span id="show_pay_btn" style="display:none;"><input type="button" onClick="forderform_check();" value="주문하기" class="btn_submit"></span>
<a href="<?php echo G5_SHOP_URL; ?>" class="btn_cancel">취소</a>
</div>
+2
View File
@@ -0,0 +1,2 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가;
+87
View File
@@ -0,0 +1,87 @@
<?php
include_once('./_common.php');
include_once(G5_MSHOP_PATH.'/settle_nicepay.inc.php');
$authResultCode = isset($_POST['AuthResultCode']) ? clean_xss_tags($_POST['AuthResultCode']) : ''; // authentication result code 0000:success
$authResultMsg = isset($_POST['AuthResultMsg']) ? clean_xss_tags($_POST['AuthResultMsg']) : ''; // authentication result message
$mid = isset($_POST['MID']) ? clean_xss_tags($_POST['MID']) : ''; // merchant id
$moid = isset($_POST['Moid']) ? clean_xss_tags($_POST['Moid']) : ''; // order number
$sql = " select * from {$g5['g5_shop_order_data_table']} where od_id = '$moid' ";
$row = sql_fetch($sql);
if (empty($row)) {
die('');
}
$data = unserialize(base64_decode($row['dt_data']));
if(isset($data['pp_id']) && $data['pp_id']) {
$order_action_url = G5_HTTPS_MSHOP_URL.'/personalpayformupdate.php';
$page_return_url = G5_SHOP_URL.'/personalpayform.php?pp_id='.$data['pp_id'];
} else {
$order_action_url = G5_HTTPS_MSHOP_URL.'/orderformupdate.php';
$page_return_url = G5_SHOP_URL.'/orderform.php';
if($_SESSION['ss_direct'])
$page_return_url .= '?sw_direct=1';
}
$params = array();
$var_datas = array();
foreach($data as $key=>$value) {
if(is_array($value)) {
foreach($value as $k=>$v) {
$_POST[$key][$k] = $params[$key][$k] = clean_xss_tags(strip_tags($v));
}
} else {
if(in_array($key, array('od_memo'))){
$_POST[$key] = $params[$key] = clean_xss_tags(strip_tags($value), 0, 0, 0, 0);
} else {
$_POST[$key] = $params[$key] = clean_xss_tags(strip_tags($value));
}
}
}
// 성공했다면
if ($authResultCode === '0000') {
if(isset($data['pp_id']) && $data['pp_id']) { //개인결제
foreach($params as $key=>$value){
if( in_array($key, shop_order_data_fields(1)) ){
$var_datas[$key] = $value;
$$key = $value;
}
}
include_once(G5_MSHOP_PATH.'/personalpayformupdate.php');
} else { //상점주문
foreach($params as $key=>$value){
if( in_array($key, shop_order_data_fields()) ){
$var_datas[$key] = $value;
$$key = $value;
}
}
$od_send_cost = (int) $_POST['od_send_cost'];
$od_send_cost2 = (int) $_POST['od_send_cost2'];
include_once(G5_MSHOP_PATH.'/orderformupdate.php');
}
} else {
// 실패시
alert('오류 : '.$authResultMsg.' 코드 : '.$authResultCode, $page_return_url);
}
+127 -12
View File
@@ -613,19 +613,49 @@ if($is_kakaopay_use) {
$multi_settle++; $multi_settle++;
if($default['de_pg_service'] === 'kcp' && isset($default['de_easy_pay_services']) && $default['de_easy_pay_services']){ if (in_array($default['de_pg_service'], array('kcp', 'nicepay')) && isset($default['de_easy_pay_services']) && $default['de_easy_pay_services']) {
$de_easy_pay_service_array = explode(',', $default['de_easy_pay_services']); $de_easy_pay_service_array = explode(',', $default['de_easy_pay_services']);
if( in_array('nhnkcp_payco', $de_easy_pay_service_array) ){
$easypay_prints['nhnkcp_payco'] = '<li><input type="radio" id="od_settle_nhnkcp_payco" name="od_settle_case" data-pay="payco" value="간편결제"> <label for="od_settle_nhnkcp_payco" class="PAYCO nhnkcp_payco lb_icon" title="NHN_KCP - PAYCO">PAYCO</label></li>'; if ($default['de_pg_service'] === 'kcp') {
if( in_array('nhnkcp_payco', $de_easy_pay_service_array) ){
$easypay_prints['nhnkcp_payco'] = '<li><input type="radio" id="od_settle_nhnkcp_payco" name="od_settle_case" data-pay="payco" value="간편결제"> <label for="od_settle_nhnkcp_payco" class="PAYCO nhnkcp_payco lb_icon" title="NHN_KCP - PAYCO">PAYCO</label></li>';
}
if( in_array('nhnkcp_naverpay', $de_easy_pay_service_array) ){
$easypay_prints['nhnkcp_naverpay'] = '<li><input type="radio" id="od_settle_nhnkcp_naverpay" name="od_settle_case" data-pay="naverpay" value="간편결제" > <label for="od_settle_nhnkcp_naverpay" class="naverpay_icon nhnkcp_naverpay lb_icon" title="NHN_KCP - 네이버페이">네이버페이</label></li>';
}
if( in_array('nhnkcp_kakaopay', $de_easy_pay_service_array) ){
$easypay_prints['nhnkcp_kakaopay'] = '<li><input type="radio" id="od_settle_nhnkcp_kakaopay" name="od_settle_case" data-pay="kakaopay" value="간편결제" > <label for="od_settle_nhnkcp_kakaopay" class="kakaopay_icon nhnkcp_kakaopay lb_icon" title="NHN_KCP - 카카오페이">카카오페이</label></li>';
}
} else if ($default['de_pg_service'] === 'nicepay') {
if( in_array('nicepay_samsungpay', $de_easy_pay_service_array) ){
$easypay_prints['nicepay_samsungpay'] = '<li><input type="radio" id="od_settle_nicepay_samsungpay" name="od_settle_case" data-pay="nice_samsungpay" value="간편결제"> <label for="od_settle_nicepay_samsungpay" class="samsung_pay nice_samsungpay lb_icon" title="NICEPAY - 삼성페이">삼성페이</label></li>';
}
if( in_array('nicepay_naverpay', $de_easy_pay_service_array) ){
$easypay_prints['nicepay_naverpay'] = '<li><input type="radio" id="od_settle_nicepay_naverpay" name="od_settle_case" data-pay="nice_naverpay" value="간편결제" > <label for="od_settle_nicepay_naverpay" class="naverpay_icon nicepay_naverpay lb_icon" title="NICEPAY - 네이버페이">네이버페이</label></li>';
}
if( in_array('nicepay_kakaopay', $de_easy_pay_service_array) ){
$easypay_prints['nicepay_kakaopay'] = '<li><input type="radio" id="od_settle_nicepay_kakaopay" name="od_settle_case" data-pay="nice_kakaopay" value="간편결제" > <label for="od_settle_nicepay_kakaopay" class="kakaopay_icon nicepay_kakaopay lb_icon" title="NICEPAY - 카카오페이">카카오페이</label></li>';
}
if( in_array('nicepay_paycopay', $de_easy_pay_service_array) ){
$easypay_prints['nicepay_paycopay'] = '<li><input type="radio" id="od_settle_nicepay_paycopay" name="od_settle_case" data-pay="nice_paycopay" value="간편결제" > <label for="od_settle_nicepay_paycopay" class="paycopay_icon nicepay_paycopay lb_icon" title="NICEPAY - 페이코">페이코</label></li>';
}
if( in_array('nicepay_skpay', $de_easy_pay_service_array) ){
$easypay_prints['nicepay_skpay'] = '<li><input type="radio" id="od_settle_nicepay_skpay" name="od_settle_case" data-pay="nice_skpay" value="간편결제" > <label for="od_settle_nicepay_skpay" class="skpay_icon nicepay_skpay lb_icon" title="NICEPAY - SK페이">SK페이</label></li>';
}
if( in_array('nicepay_ssgpay', $de_easy_pay_service_array) ){
$easypay_prints['nicepay_ssgpay'] = '<li><input type="radio" id="od_settle_nicepay_ssgpay" name="od_settle_case" data-pay="nice_ssgpay" value="간편결제" > <label for="od_settle_nicepay_ssgpay" class="ssgpay_icon nicepay_ssgpay lb_icon" title="NICEPAY - SSGPAY">SSGPAY</label></li>';
}
if( in_array('nicepay_lpay', $de_easy_pay_service_array) ){
$easypay_prints['nicepay_lpay'] = '<li><input type="radio" id="od_settle_nicepay_lpay" name="od_settle_case" data-pay="nice_lpay" value="간편결제" > <label for="od_settle_nicepay_lpay" class="lpay_icon nicepay_lpay lb_icon" title="NICEPAY - LPAY">LPAY</label></li>';
}
} }
if( in_array('nhnkcp_naverpay', $de_easy_pay_service_array) ){
$easypay_prints['nhnkcp_naverpay'] = '<li><input type="radio" id="od_settle_nhnkcp_naverpay" name="od_settle_case" data-pay="naverpay" value="간편결제" > <label for="od_settle_nhnkcp_naverpay" class="naverpay_icon nhnkcp_naverpay lb_icon" title="NHN_KCP - 네이버페이">네이버페이</label></li>'; if( (in_array('nhnkcp_applepay', $de_easy_pay_service_array) || in_array('nicepay_applepay', $de_easy_pay_service_array)) && preg_match('~^(?:(?:(?:Mozilla/\d\.\d\s*\()+|Mobile\s*Safari\s*\d+\.\d+(\.\d+)?\s*)(?:iPhone(?:\s+Simulator)?|iPad|iPod);\s*(?:U;\s*)?(?:[a-z]+(?:-[a-z]+)?;\s*)?CPU\s*(?:iPhone\s*)?(?:OS\s*\d+_\d+(?:_\d+)?\s*)?(?:like|comme)\s*Mac\s*O?S?\s*X(?:;\s*[a-z]+(?:-[a-z]+)?)?\)\s*)?(?:AppleWebKit/\d+(?:\.\d+(?:\.\d+)?|\s*\+)?\s*)?(?:\(KHTML,\s*(?:like|comme)\s*Gecko\s*\)\s*)?(?:Version/\d+\.\d+(?:\.\d+)?\s*)?(?:Mobile/\w+\s*)?(?:Safari/\d+\.\d+(?:\.\d+)?.*)?$~', $_SERVER['HTTP_USER_AGENT']) ){
} if ($default['de_pg_service'] === 'kcp' && in_array('nhnkcp_applepay', $de_easy_pay_service_array)) {
if( in_array('nhnkcp_kakaopay', $de_easy_pay_service_array) ){ $easypay_prints['nhnkcp_applepay'] = '<li><input type="radio" id="od_settle_nhnkcp_applepay" name="od_settle_case" data-pay="applepay" value="간편결제" > <label for="od_settle_nhnkcp_applepay" class="applepay_icon nhnkcp_applepay lb_icon" title="NHN_KCP - 애플페이">애플페이</label></li>';
$easypay_prints['nhnkcp_kakaopay'] = '<li><input type="radio" id="od_settle_nhnkcp_kakaopay" name="od_settle_case" data-pay="kakaopay" value="간편결제" > <label for="od_settle_nhnkcp_kakaopay" class="kakaopay_icon nhnkcp_kakaopay lb_icon" title="NHN_KCP - 카카오페이">카카오페이</label></li>'; } else if ($default['de_pg_service'] === 'nicepay' && in_array('nicepay_applepay', $de_easy_pay_service_array)) {
} $easypay_prints['nicepay_applepay'] = '<li><input type="radio" id="od_settle_nicepay_applepay" name="od_settle_case" data-pay="nice_applepay" value="간편결제" > <label for="od_settle_nicepay_applepay" class="applepay_icon nicepay_applepay lb_icon" title="NICEPAY - 애플페이">애플페이</label></li>';
if( in_array('nhnkcp_applepay', $de_easy_pay_service_array) && preg_match('~^(?:(?:(?:Mozilla/\d\.\d\s*\()+|Mobile\s*Safari\s*\d+\.\d+(\.\d+)?\s*)(?:iPhone(?:\s+Simulator)?|iPad|iPod);\s*(?:U;\s*)?(?:[a-z]+(?:-[a-z]+)?;\s*)?CPU\s*(?:iPhone\s*)?(?:OS\s*\d+_\d+(?:_\d+)?\s*)?(?:like|comme)\s*Mac\s*O?S?\s*X(?:;\s*[a-z]+(?:-[a-z]+)?)?\)\s*)?(?:AppleWebKit/\d+(?:\.\d+(?:\.\d+)?|\s*\+)?\s*)?(?:\(KHTML,\s*(?:like|comme)\s*Gecko\s*\)\s*)?(?:Version/\d+\.\d+(?:\.\d+)?\s*)?(?:Mobile/\w+\s*)?(?:Safari/\d+\.\d+(?:\.\d+)?.*)?$~', $_SERVER['HTTP_USER_AGENT']) ){ }
$easypay_prints['nhnkcp_applepay'] = '<li><input type="radio" id="od_settle_nhnkcp_applepay" name="od_settle_case" data-pay="applepay" value="간편결제" > <label for="od_settle_nhnkcp_applepay" class="applepay_icon nhnkcp_applepay lb_icon" title="NHN_KCP - 애플페이">애플페이</label></li>';
} }
} else { } else {
$easypay_prints[strtolower($pg_easy_pay_name)] = '<li><input type="radio" id="od_settle_easy_pay" name="od_settle_case" value="간편결제" '.$checked.'> <label for="od_settle_easy_pay" class="'.$pg_easy_pay_name.' lb_icon">'.$pg_easy_pay_name.'</label></li>'; $easypay_prints[strtolower($pg_easy_pay_name)] = '<li><input type="radio" id="od_settle_easy_pay" name="od_settle_case" value="간편결제" '.$checked.'> <label for="od_settle_easy_pay" class="'.$pg_easy_pay_name.' lb_icon">'.$pg_easy_pay_name.'</label></li>';
@@ -1263,7 +1293,7 @@ function pay_approval()
var send_coupon = parseInt(pf.od_send_coupon.value); var send_coupon = parseInt(pf.od_send_coupon.value);
f.good_mny.value = od_price + send_cost + send_cost2 - send_coupon - temp_point; f.good_mny.value = od_price + send_cost + send_cost2 - send_coupon - temp_point;
} }
// 카카오페이 지불 // 카카오페이 지불
if(settle_method == "KAKAOPAY") { if(settle_method == "KAKAOPAY") {
<?php if($default['de_tax_flag_use']) { ?> <?php if($default['de_tax_flag_use']) { ?>
@@ -1417,6 +1447,86 @@ function pay_approval()
<?php } ?> <?php } ?>
f.P_RETURN_URL.value = "<?php echo $return_url.$od_id; ?>"; f.P_RETURN_URL.value = "<?php echo $return_url.$od_id; ?>";
f.action = "https://mobile.inicis.com/smart/" + paymethod + "/"; f.action = "https://mobile.inicis.com/smart/" + paymethod + "/";
<?php } else if($default['de_pg_service'] == 'nicepay') { ?>
f.Amt.value = f.good_mny.value;
f.BuyerName.value = pf.od_name.value;
f.BuyerEmail.value = pf.od_email.value;
f.BuyerTel.value = pf.od_hp.value ? pf.od_hp.value : pf.od_tel.value;
f.DirectShowOpt.value = ""; // 간편결제 요청 값 초기화
f.DirectEasyPay.value = ""; // 간편결제 요청 값 초기화
f.NicepayReserved.value = ""; // 간편결제 요청 값 초기화
f.EasyPayMethod.value = ""; // 간편결제 요청 값 초기화
<?php if ($default['de_escrow_use']) { // 간편결제시 에스크로값이 0이 되므로 기본설정값을 지정 ?>
f.TransType.value = "1";
<?php } ?>
switch(settle_method) {
case "계좌이체":
paymethod = "BANK";
break;
case "가상계좌":
paymethod = "VBANK";
break;
case "휴대폰":
paymethod = "CELLPHONE";
break;
case "신용카드":
paymethod = "CARD";
break;
case "간편결제":
paymethod = "CARD";
f.DirectShowOpt.value = "CARD";
f.TransType.value = "0"; // 간편결제의 경우 에스크로를 사용할수 없다.
var nicepay_easy_pay = jQuery("input[name='od_settle_case']:checked" ).attr("data-pay");
if(nicepay_easy_pay === "nice_naverpay"){
if(typeof f.DirectEasyPay !== "undefined") f.DirectEasyPay.value = "E020";
<?php
// * 카드 선택 시 전액 카드로 결제, 포인트 선택 시 전액 포인트로 결제.
// (카드와 포인트를 같이 사용하는 복합결제 형태의 결제는 불가함.)
// - 카드: EasyPayMethod=”E020=CARD”, 포인트: EasyPayMethod=”E020=POINT”
?>
if(typeof f.EasyPayMethod !== "undefined") f.EasyPayMethod.value = "E020=CARD";
} else if(nicepay_easy_pay === "nice_kakaopay"){
if(typeof f.NicepayReserved !== "undefined") f.NicepayReserved.value = "DirectKakao=Y";
} else if(nicepay_easy_pay === "nice_samsungpay"){
if(typeof f.DirectEasyPay !== "undefined") f.DirectEasyPay.value = "E021";
} else if(nicepay_easy_pay === "nice_applepay"){
if(typeof f.DirectEasyPay !== "undefined") f.DirectEasyPay.value = "E022";
} else if(nicepay_easy_pay === "nice_paycopay"){
if(typeof f.NicepayReserved !== "undefined") f.NicepayReserved.value = "DirectPayco=Y";
} else if(nicepay_easy_pay === "nice_skpay"){
if(typeof f.NicepayReserved !== "undefined") f.NicepayReserved.value = "DirectPay11=Y";
} else if(nicepay_easy_pay === "nice_ssgpay"){
if(typeof f.DirectEasyPay !== "undefined") f.DirectEasyPay.value = "E007";
} else if(nicepay_easy_pay === "nice_lpay"){
if(typeof f.DirectEasyPay !== "undefined") f.DirectEasyPay.value = "E018";
}
break;
default:
paymethod = "무통장";
break;
}
f.PayMethod.value = paymethod;
<?php if($default['de_tax_flag_use']) { ?>
f.SupplyAmt.value = pf.comm_tax_mny.value;
f.GoodsVat.value = pf.comm_vat_mny.value;
f.TaxFreeAmt.value = pf.comm_free_mny.value;
<?php } ?>
if (! nicepay_create_signdata(f)) {
return false;
}
<?php } ?> <?php } ?>
// 주문 정보 임시저장 // 주문 정보 임시저장
@@ -1438,6 +1548,11 @@ function pay_approval()
return false; return false;
} }
<?php if ($default['de_pg_service'] == 'nicepay') { ?>
nicepayStart(f);
return false;
<?php } ?>
f.submit(); f.submit();
} }
+33 -1
View File
@@ -335,6 +335,11 @@ $order_price = $tot_od_price + $send_cost + $send_cost2 - $tot_sc_cp_price - $od
$od_status = '주문'; $od_status = '주문';
$od_tno = ''; $od_tno = '';
if (function_exists('check_payment_method')) {
check_payment_method($od_settle_case);
}
if ($od_settle_case == "무통장") if ($od_settle_case == "무통장")
{ {
$od_receipt_point = $i_temp_point; $od_receipt_point = $i_temp_point;
@@ -355,6 +360,9 @@ else if ($od_settle_case == "계좌이체")
case 'inicis': case 'inicis':
include G5_MSHOP_PATH.'/inicis/pay_result.php'; include G5_MSHOP_PATH.'/inicis/pay_result.php';
break; break;
case 'nicepay':
include G5_MSHOP_PATH.'/nicepay/nicepay_result.php';
break;
default: default:
include G5_MSHOP_PATH.'/kcp/pp_ax_hub.php'; include G5_MSHOP_PATH.'/kcp/pp_ax_hub.php';
$bank_name = iconv("cp949", "utf-8", $bank_name); $bank_name = iconv("cp949", "utf-8", $bank_name);
@@ -381,6 +389,9 @@ else if ($od_settle_case == "가상계좌")
case 'inicis': case 'inicis':
include G5_MSHOP_PATH.'/inicis/pay_result.php'; include G5_MSHOP_PATH.'/inicis/pay_result.php';
break; break;
case 'nicepay':
include G5_MSHOP_PATH.'/nicepay/nicepay_result.php';
break;
default: default:
include G5_MSHOP_PATH.'/kcp/pp_ax_hub.php'; include G5_MSHOP_PATH.'/kcp/pp_ax_hub.php';
$bankname = iconv("cp949", "utf-8", $bankname); $bankname = iconv("cp949", "utf-8", $bankname);
@@ -407,6 +418,9 @@ else if ($od_settle_case == "휴대폰")
case 'inicis': case 'inicis':
include G5_MSHOP_PATH.'/inicis/pay_result.php'; include G5_MSHOP_PATH.'/inicis/pay_result.php';
break; break;
case 'nicepay':
include G5_MSHOP_PATH.'/nicepay/nicepay_result.php';
break;
default: default:
include G5_MSHOP_PATH.'/kcp/pp_ax_hub.php'; include G5_MSHOP_PATH.'/kcp/pp_ax_hub.php';
break; break;
@@ -431,6 +445,9 @@ else if ($od_settle_case == "신용카드")
case 'inicis': case 'inicis':
include G5_MSHOP_PATH.'/inicis/pay_result.php'; include G5_MSHOP_PATH.'/inicis/pay_result.php';
break; break;
case 'nicepay':
include G5_MSHOP_PATH.'/nicepay/nicepay_result.php';
break;
default: default:
include G5_MSHOP_PATH.'/kcp/pp_ax_hub.php'; include G5_MSHOP_PATH.'/kcp/pp_ax_hub.php';
$card_name = iconv("cp949", "utf-8", $card_name); $card_name = iconv("cp949", "utf-8", $card_name);
@@ -457,6 +474,9 @@ else if ($od_settle_case == "간편결제")
case 'inicis': case 'inicis':
include G5_MSHOP_PATH.'/inicis/pay_result.php'; include G5_MSHOP_PATH.'/inicis/pay_result.php';
break; break;
case 'nicepay':
include G5_MSHOP_PATH.'/nicepay/nicepay_result.php';
break;
default: default:
include G5_MSHOP_PATH.'/kcp/pp_ax_hub.php'; include G5_MSHOP_PATH.'/kcp/pp_ax_hub.php';
$card_name = iconv("cp949", "utf-8", $card_name); $card_name = iconv("cp949", "utf-8", $card_name);
@@ -525,6 +545,10 @@ if($tno) {
case 'inicis': case 'inicis':
include G5_SHOP_PATH.'/inicis/inipay_cancel.php'; include G5_SHOP_PATH.'/inicis/inipay_cancel.php';
break; break;
case 'nicepay':
$cancelAmt = (int)$pg_price;
include G5_SHOP_PATH.'/nicepay/cancel_process.php';
break;
case 'KAKAOPAY': case 'KAKAOPAY':
$_REQUEST['TID'] = $tno; $_REQUEST['TID'] = $tno;
$_REQUEST['Amt'] = $amount; $_REQUEST['Amt'] = $amount;
@@ -674,6 +698,10 @@ if(! $result || ! (isset($exists_order['od_id']) && $od_id && $exists_order['od_
case 'inicis': case 'inicis':
include G5_SHOP_PATH.'/inicis/inipay_cancel.php'; include G5_SHOP_PATH.'/inicis/inipay_cancel.php';
break; break;
case 'nicepay':
$cancelAmt = (int)$pg_price;
include G5_SHOP_PATH.'/nicepay/cancel_process.php';
break;
case 'KAKAOPAY': case 'KAKAOPAY':
$_REQUEST['TID'] = $tno; $_REQUEST['TID'] = $tno;
$_REQUEST['Amt'] = $amount; $_REQUEST['Amt'] = $amount;
@@ -732,6 +760,10 @@ if(!$result) {
case 'inicis': case 'inicis':
include G5_SHOP_PATH.'/inicis/inipay_cancel.php'; include G5_SHOP_PATH.'/inicis/inipay_cancel.php';
break; break;
case 'nicepay':
$cancelAmt = (int)$pg_price;
include G5_SHOP_PATH.'/nicepay/cancel_process.php';
break;
case 'KAKAOPAY': case 'KAKAOPAY':
$_REQUEST['TID'] = $tno; $_REQUEST['TID'] = $tno;
$_REQUEST['Amt'] = $amount; $_REQUEST['Amt'] = $amount;
@@ -838,7 +870,7 @@ if($config['cf_sms_use'] && ($default['de_sms_use2'] || $default['de_sms_use3'])
$sms_content = str_replace("{보낸분}", $od_name, $sms_content); $sms_content = str_replace("{보낸분}", $od_name, $sms_content);
$sms_content = str_replace("{받는분}", $od_b_name, $sms_content); $sms_content = str_replace("{받는분}", $od_b_name, $sms_content);
$sms_content = str_replace("{주문번호}", $od_id, $sms_content); $sms_content = str_replace("{주문번호}", $od_id, $sms_content);
$sms_content = str_replace("{주문금액}", number_format($tot_ct_price + $od_send_cost + $od_send_cost2), $sms_content); $sms_content = str_replace("{주문금액}", number_format($tot_ct_price + $od_send_cost + (int) $od_send_cost2), $sms_content);
$sms_content = str_replace("{회원아이디}", $member['mb_id'], $sms_content); $sms_content = str_replace("{회원아이디}", $member['mb_id'], $sms_content);
$sms_content = str_replace("{회사명}", $default['de_admin_company_name'], $sms_content); $sms_content = str_replace("{회사명}", $default['de_admin_company_name'], $sms_content);
+16 -7
View File
@@ -1,5 +1,7 @@
<?php <?php
include_once('./_common.php'); if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$od_id = isset($_REQUEST['od_id']) ? safe_replace_regex($_REQUEST['od_id'], 'od_id') : '';
// 테마에 orderinquiryview.php 있으면 include // 테마에 orderinquiryview.php 있으면 include
if(defined('G5_THEME_MSHOP_PATH')) { if(defined('G5_THEME_MSHOP_PATH')) {
@@ -246,6 +248,7 @@ if($od['od_pg'] == 'lg') {
$app_no_subj = '승인번호'; $app_no_subj = '승인번호';
$app_no = $od['od_app_no']; $app_no = $od['od_app_no'];
$disp_bank = false; $disp_bank = false;
$disp_receipt = true;
} else if($od['od_settle_case'] == '휴대폰') { } else if($od['od_settle_case'] == '휴대폰') {
$app_no_subj = '휴대폰번호'; $app_no_subj = '휴대폰번호';
$app_no = $od['od_bank_account']; $app_no = $od['od_bank_account'];
@@ -295,7 +298,7 @@ if($od['od_pg'] == 'lg') {
} }
// 승인번호, 휴대폰번호, 거래번호 // 승인번호, 휴대폰번호, 거래번호
if($app_no_subj && $app_no) if($app_no_subj && trim($app_no))
{ {
?> ?>
<tr> <tr>
@@ -337,6 +340,8 @@ if($od['od_pg'] == 'lg') {
$hp_receipt_script = 'showReceiptByTID(\''.$LGD_MID.'\', \''.$LGD_TID.'\', \''.$LGD_HASHDATA.'\');'; $hp_receipt_script = 'showReceiptByTID(\''.$LGD_MID.'\', \''.$LGD_TID.'\', \''.$LGD_HASHDATA.'\');';
} else if($od['od_pg'] == 'inicis') { } else if($od['od_pg'] == 'inicis') {
$hp_receipt_script = 'window.open(\'https://iniweb.inicis.com/DefaultWebApp/mall/cr/cm/mCmReceipt_head.jsp?noTid='.$od['od_tno'].'&noMethod=1\',\'receipt\',\'width=430,height=700\');'; $hp_receipt_script = 'window.open(\'https://iniweb.inicis.com/DefaultWebApp/mall/cr/cm/mCmReceipt_head.jsp?noTid='.$od['od_tno'].'&noMethod=1\',\'receipt\',\'width=430,height=700\');';
} else if($od['od_pg'] == 'nicepay') {
$hp_receipt_script = 'window.open(\'https://npg.nicepay.co.kr/issue/IssueLoader.do?type=0&TID='.$od['od_tno'].'&noMethod=1\',\'receipt\',\'width=430,height=700\');';
} else { } else {
$hp_receipt_script = 'window.open(\''.G5_BILL_RECEIPT_URL.'mcash_bill&tno='.$od['od_tno'].'&order_no='.$od['od_id'].'&trade_mony='.$od['od_receipt_price'].'\', \'winreceipt\', \'width=500,height=690,scrollbars=yes,resizable=yes\');'; $hp_receipt_script = 'window.open(\''.G5_BILL_RECEIPT_URL.'mcash_bill&tno='.$od['od_tno'].'&order_no='.$od['od_id'].'&trade_mony='.$od['od_receipt_price'].'\', \'winreceipt\', \'width=500,height=690,scrollbars=yes,resizable=yes\');';
} }
@@ -345,7 +350,7 @@ if($od['od_pg'] == 'lg') {
<?php <?php
} }
if($od['od_settle_case'] == '신용카드' || is_inicis_order_pay($od['od_settle_case']) || (shop_is_taxsave($od, true) && $misu_price == 0) ) if($od['od_settle_case'] == '신용카드' || $od['od_settle_case'] == '간편결제' || is_inicis_order_pay($od['od_settle_case']) || (shop_is_taxsave($od, true) && $misu_price == 0) )
{ {
if($od['od_pg'] == 'lg') { if($od['od_pg'] == 'lg') {
require_once G5_SHOP_PATH.'/settle_lg.inc.php'; require_once G5_SHOP_PATH.'/settle_lg.inc.php';
@@ -354,6 +359,8 @@ if($od['od_pg'] == 'lg') {
$LGD_HASHDATA = md5($LGD_MID.$LGD_TID.$LGD_MERTKEY); $LGD_HASHDATA = md5($LGD_MID.$LGD_TID.$LGD_MERTKEY);
$card_receipt_script = 'showReceiptByTID(\''.$LGD_MID.'\', \''.$LGD_TID.'\', \''.$LGD_HASHDATA.'\');'; $card_receipt_script = 'showReceiptByTID(\''.$LGD_MID.'\', \''.$LGD_TID.'\', \''.$LGD_HASHDATA.'\');';
} else if($od['od_pg'] == 'nicepay') {
$card_receipt_script = 'window.open(\'https://npg.nicepay.co.kr/issue/IssueLoader.do?type=0&TID='.$od['od_tno'].'&noMethod=1\',\'receipt\',\'width=430,height=700\');';
} else if($od['od_pg'] == 'inicis') { } else if($od['od_pg'] == 'inicis') {
$card_receipt_script = 'window.open(\'https://iniweb.inicis.com/DefaultWebApp/mall/cr/cm/mCmReceipt_head.jsp?noTid='.$od['od_tno'].'&noMethod=1\',\'receipt\',\'width=430,height=700\');'; $card_receipt_script = 'window.open(\'https://iniweb.inicis.com/DefaultWebApp/mall/cr/cm/mCmReceipt_head.jsp?noTid='.$od['od_tno'].'&noMethod=1\',\'receipt\',\'width=430,height=700\');';
} else { } else {
@@ -399,10 +406,10 @@ if($od['od_pg'] == 'lg') {
<?php <?php
} }
// 현금영수증 발급을 사용하는 경우에만 // 현금영수증 발급을 사용하는 경우 또는 현금영수증 발급을 한 주문건이면
if (function_exists('shop_is_taxsave') && shop_is_taxsave($od)) { if ((function_exists('shop_is_taxsave') && shop_is_taxsave($od)) || (function_exists('is_order_cashreceipt') && is_order_cashreceipt($od))) {
// 미수금이 없고 현금일 경우에만 현금영수증을 발급 할 수 있습니다. // 미수금이 없고 현금일 경우에만 현금영수증을 발급 할 수 있습니다.
if ($misu_price == 0 && $od['od_receipt_price'] && ($od['od_settle_case'] == '무통장' || $od['od_settle_case'] == '계좌이체' || $od['od_settle_case'] == '가상계좌')) { if ($misu_price == 0 && is_order_cashreceipt($od)) {
?> ?>
<tr> <tr>
<th scope="row">현금영수증</th> <th scope="row">현금영수증</th>
@@ -428,6 +435,8 @@ if($od['od_pg'] == 'lg') {
} else if($od['od_pg'] == 'inicis') { } else if($od['od_pg'] == 'inicis') {
$cash = unserialize($od['od_cash_info']); $cash = unserialize($od['od_cash_info']);
$cash_receipt_script = 'window.open(\'https://iniweb.inicis.com/DefaultWebApp/mall/cr/cm/Cash_mCmReceipt.jsp?noTid='.$cash['TID'].'&clpaymethod=22\',\'showreceipt\',\'width=380,height=540,scrollbars=no,resizable=no\');'; $cash_receipt_script = 'window.open(\'https://iniweb.inicis.com/DefaultWebApp/mall/cr/cm/Cash_mCmReceipt.jsp?noTid='.$cash['TID'].'&clpaymethod=22\',\'showreceipt\',\'width=380,height=540,scrollbars=no,resizable=no\');';
} else if($od['od_pg'] == 'nicepay') {
$cash_receipt_script = 'window.open(\'https://npg.nicepay.co.kr/issue/IssueLoader.do?type=1&TID='.$od['od_tno'].'&noMethod=1\',\'receipt\',\'width=430,height=700\');';
} else { } else {
require_once G5_SHOP_PATH.'/settle_kcp.inc.php'; require_once G5_SHOP_PATH.'/settle_kcp.inc.php';
@@ -438,7 +447,7 @@ if($od['od_pg'] == 'lg') {
<a href="javascript:;" onclick="<?php echo $cash_receipt_script; ?>">현금영수증 확인하기</a> <a href="javascript:;" onclick="<?php echo $cash_receipt_script; ?>">현금영수증 확인하기</a>
<?php <?php
} }
else else if (shop_is_taxsave($od))
{ {
?> ?>
<a href="javascript:;" onclick="window.open('<?php echo G5_SHOP_URL; ?>/taxsave.php?od_id=<?php echo $od_id; ?>', 'taxsave', 'width=550,height=400,scrollbars=1,menus=0');">현금영수증을 발급하시려면 클릭하십시오.</a> <a href="javascript:;" onclick="window.open('<?php echo G5_SHOP_URL; ?>/taxsave.php?od_id=<?php echo $od_id; ?>', 'taxsave', 'width=550,height=400,scrollbars=1,menus=0');">현금영수증을 발급하시려면 클릭하십시오.</a>
+51
View File
@@ -206,6 +206,52 @@ function pay_approval()
<?php } ?> <?php } ?>
f.P_RETURN_URL.value = "<?php echo $return_url.$pp_id; ?>"; f.P_RETURN_URL.value = "<?php echo $return_url.$pp_id; ?>";
f.action = "https://mobile.inicis.com/smart/" + paymethod + "/"; f.action = "https://mobile.inicis.com/smart/" + paymethod + "/";
<?php } else if($default['de_pg_service'] == 'nicepay') { ?>
f.Amt.value = f.good_mny.value;
f.BuyerName.value = pf.pp_name.value;
f.BuyerEmail.value = pf.pp_email.value;
f.BuyerTel.value = pf.pp_hp.value;
f.DirectShowOpt.value = ""; // 간편결제 요청 값 초기화
f.DirectEasyPay.value = ""; // 간편결제 요청 값 초기화
f.NicepayReserved.value = ""; // 간편결제 요청 값 초기화
f.EasyPayMethod.value = ""; // 간편결제 요청 값 초기화
<?php if ($default['de_escrow_use']) { // 간편결제시 에스크로값이 0이 되므로 기본설정값을 지정 ?>
f.TransType.value = "1";
<?php } ?>
switch(settle_method) {
case "계좌이체":
paymethod = "BANK";
break;
case "가상계좌":
paymethod = "VBANK";
break;
case "휴대폰":
paymethod = "CELLPHONE";
break;
case "신용카드":
paymethod = "CARD";
break;
default:
paymethod = "무통장";
break;
}
f.PayMethod.value = paymethod;
<?php if($default['de_tax_flag_use']) { ?>
f.SupplyAmt.value = pf.comm_tax_mny.value;
f.GoodsVat.value = pf.comm_vat_mny.value;
f.TaxFreeAmt.value = pf.comm_free_mny.value;
<?php } ?>
if (! nicepay_create_signdata(f)) {
return false;
}
<?php } ?> <?php } ?>
//var new_win = window.open("about:blank", "tar_opener", "scrollbars=yes,resizable=yes"); //var new_win = window.open("about:blank", "tar_opener", "scrollbars=yes,resizable=yes");
@@ -229,7 +275,12 @@ function pay_approval()
alert(save_result); alert(save_result);
return false; return false;
} }
<?php if($default['de_pg_service'] == 'nicepay') { ?>
nicepayStart(f);
return;
<?php } ?>
f.submit(); f.submit();
} }
+16
View File
@@ -57,6 +57,9 @@ if ($pp_settle_case == "계좌이체")
case 'inicis': case 'inicis':
include G5_MSHOP_PATH.'/inicis/pay_result.php'; include G5_MSHOP_PATH.'/inicis/pay_result.php';
break; break;
case 'nicepay':
include G5_MSHOP_PATH.'/nicepay/nicepay_result.php';
break;
default: default:
include G5_MSHOP_PATH.'/kcp/pp_ax_hub.php'; include G5_MSHOP_PATH.'/kcp/pp_ax_hub.php';
$bank_name = iconv("cp949", "utf-8", $bank_name); $bank_name = iconv("cp949", "utf-8", $bank_name);
@@ -79,6 +82,9 @@ else if ($pp_settle_case == "가상계좌")
case 'inicis': case 'inicis':
include G5_MSHOP_PATH.'/inicis/pay_result.php'; include G5_MSHOP_PATH.'/inicis/pay_result.php';
break; break;
case 'nicepay':
include G5_MSHOP_PATH.'/nicepay/nicepay_result.php';
break;
default: default:
include G5_MSHOP_PATH.'/kcp/pp_ax_hub.php'; include G5_MSHOP_PATH.'/kcp/pp_ax_hub.php';
$bankname = iconv("cp949", "utf-8", $bankname); $bankname = iconv("cp949", "utf-8", $bankname);
@@ -102,6 +108,9 @@ else if ($pp_settle_case == "휴대폰")
case 'inicis': case 'inicis':
include G5_MSHOP_PATH.'/inicis/pay_result.php'; include G5_MSHOP_PATH.'/inicis/pay_result.php';
break; break;
case 'nicepay':
include G5_MSHOP_PATH.'/nicepay/nicepay_result.php';
break;
default: default:
include G5_MSHOP_PATH.'/kcp/pp_ax_hub.php'; include G5_MSHOP_PATH.'/kcp/pp_ax_hub.php';
break; break;
@@ -122,6 +131,9 @@ else if ($pp_settle_case == "신용카드")
case 'inicis': case 'inicis':
include G5_MSHOP_PATH.'/inicis/pay_result.php'; include G5_MSHOP_PATH.'/inicis/pay_result.php';
break; break;
case 'nicepay':
include G5_MSHOP_PATH.'/nicepay/nicepay_result.php';
break;
default: default:
include G5_MSHOP_PATH.'/kcp/pp_ax_hub.php'; include G5_MSHOP_PATH.'/kcp/pp_ax_hub.php';
$card_name = iconv("cp949", "utf-8", $card_name); $card_name = iconv("cp949", "utf-8", $card_name);
@@ -150,6 +162,10 @@ if((int)$pp['pp_price'] !== (int)$pg_price) {
case 'inicis': case 'inicis':
include G5_SHOP_PATH.'/inicis/inipay_cancel.php'; include G5_SHOP_PATH.'/inicis/inipay_cancel.php';
break; break;
case 'nicepay':
$cancelAmt = (int)$pg_price;
include G5_SHOP_PATH.'/nicepay/cancel_process.php';
break;
default: default:
include G5_SHOP_PATH.'/kcp/pp_ax_hub_cancel.php'; include G5_SHOP_PATH.'/kcp/pp_ax_hub_cancel.php';
break; break;
+6
View File
@@ -147,6 +147,8 @@ if($pp['pp_pg'] == 'lg') {
$hp_receipt_script = 'showReceiptByTID(\''.$LGD_MID.'\', \''.$LGD_TID.'\', \''.$LGD_HASHDATA.'\');'; $hp_receipt_script = 'showReceiptByTID(\''.$LGD_MID.'\', \''.$LGD_TID.'\', \''.$LGD_HASHDATA.'\');';
} else if($pp['pp_pg'] == 'inicis') { } else if($pp['pp_pg'] == 'inicis') {
$hp_receipt_script = 'window.open(\'https://iniweb.inicis.com/DefaultWebApp/mall/cr/cm/mCmReceipt_head.jsp?noTid='.$pp['pp_tno'].'&noMethod=1\',\'receipt\',\'width=430,height=700\');'; $hp_receipt_script = 'window.open(\'https://iniweb.inicis.com/DefaultWebApp/mall/cr/cm/mCmReceipt_head.jsp?noTid='.$pp['pp_tno'].'&noMethod=1\',\'receipt\',\'width=430,height=700\');';
} else if($pp['pp_pg'] == 'nicepay') {
$hp_receipt_script = 'window.open(\'https://npg.nicepay.co.kr/issue/IssueLoader.do?type=0&TID='.$pp['pp_tno'].'&noMethod=1\',\'receipt\',\'width=430,height=700\');';
} else { } else {
$hp_receipt_script = 'window.open(\''.G5_BILL_RECEIPT_URL.'mcash_bill&tno='.$pp['pp_tno'].'&order_no='.$pp['pp_id'].'&trade_mony='.$pp['pp_receipt_price'].'\', \'winreceipt\', \'width=500,height=690,scrollbars=yes,resizable=yes\');'; $hp_receipt_script = 'window.open(\''.G5_BILL_RECEIPT_URL.'mcash_bill&tno='.$pp['pp_tno'].'&order_no='.$pp['pp_id'].'&trade_mony='.$pp['pp_receipt_price'].'\', \'winreceipt\', \'width=500,height=690,scrollbars=yes,resizable=yes\');';
} }
@@ -164,6 +166,8 @@ if($pp['pp_pg'] == 'lg') {
$LGD_HASHDATA = md5($LGD_MID.$LGD_TID.$LGD_MERTKEY); $LGD_HASHDATA = md5($LGD_MID.$LGD_TID.$LGD_MERTKEY);
$card_receipt_script = 'showReceiptByTID(\''.$LGD_MID.'\', \''.$LGD_TID.'\', \''.$LGD_HASHDATA.'\');'; $card_receipt_script = 'showReceiptByTID(\''.$LGD_MID.'\', \''.$LGD_TID.'\', \''.$LGD_HASHDATA.'\');';
} else if($pp['pp_pg'] == 'nicepay') {
$card_receipt_script = 'window.open(\'https://npg.nicepay.co.kr/issue/IssueLoader.do?type=0&TID='.$pp['pp_tno'].'&noMethod=1\',\'receipt\',\'width=430,height=700\');';
} else if($pp['pp_pg'] == 'inicis') { } else if($pp['pp_pg'] == 'inicis') {
$card_receipt_script = 'window.open(\'https://iniweb.inicis.com/DefaultWebApp/mall/cr/cm/mCmReceipt_head.jsp?noTid='.$pp['pp_tno'].'&noMethod=1\',\'receipt\',\'width=430,height=700\');'; $card_receipt_script = 'window.open(\'https://iniweb.inicis.com/DefaultWebApp/mall/cr/cm/mCmReceipt_head.jsp?noTid='.$pp['pp_tno'].'&noMethod=1\',\'receipt\',\'width=430,height=700\');';
} else { } else {
@@ -220,6 +224,8 @@ if($pp['pp_pg'] == 'lg') {
} else if($pp['pp_pg'] == 'inicis') { } else if($pp['pp_pg'] == 'inicis') {
$cash = unserialize($pp['pp_cash_info']); $cash = unserialize($pp['pp_cash_info']);
$cash_receipt_script = 'window.open(\'https://iniweb.inicis.com/DefaultWebApp/mall/cr/cm/Cash_mCmReceipt.jsp?noTid='.$cash['TID'].'&clpaymethod=22\',\'showreceipt\',\'width=380,height=540,scrollbars=no,resizable=no\');'; $cash_receipt_script = 'window.open(\'https://iniweb.inicis.com/DefaultWebApp/mall/cr/cm/Cash_mCmReceipt.jsp?noTid='.$cash['TID'].'&clpaymethod=22\',\'showreceipt\',\'width=380,height=540,scrollbars=no,resizable=no\');';
} else if($pp['pp_pg'] == 'nicepay') {
$cash_receipt_script = 'window.open(\'https://npg.nicepay.co.kr/issue/IssueLoader.do?type=1&TID='.$od['od_tno'].'&noMethod=1\',\'receipt\',\'width=430,height=700\');';
} else { } else {
require_once G5_SHOP_PATH.'/settle_kcp.inc.php'; require_once G5_SHOP_PATH.'/settle_kcp.inc.php';
+6
View File
@@ -0,0 +1,6 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
include_once(G5_SHOP_PATH.'/settle_nicepay.inc.php');
$nicepay_returnURL = G5_MSHOP_URL.'/nicepay/return_url_result.php';
+2 -3
View File
@@ -8,11 +8,10 @@ add_javascript('<script src="'.G5_JS_URL.'/jquery.bxslider.js"></script>', 10);
<?php if($config['cf_kakao_js_apikey']) { ?> <?php if($config['cf_kakao_js_apikey']) { ?>
<script src="https://developers.kakao.com/sdk/js/kakao.min.js" async></script> <script src="https://developers.kakao.com/sdk/js/kakao.min.js" async></script>
<script src="<?php echo G5_JS_URL; ?>/kakaolink.js"></script>
<script> <script>
// 사용할 앱의 Javascript 키를 설정해 주세요. var kakao_javascript_apikey = "<?php echo $config['cf_kakao_js_apikey']; ?>";
Kakao.init("<?php echo $config['cf_kakao_js_apikey']; ?>");
</script> </script>
<script src="<?php echo G5_JS_URL; ?>/kakaolink.js?ver=<?php echo G5_JS_VER; ?>"></script>
<?php } ?> <?php } ?>
<form name="fitem" action="<?php echo $action_url; ?>" method="post" onsubmit="return fitem_submit(this);"> <form name="fitem" action="<?php echo $action_url; ?>" method="post" onsubmit="return fitem_submit(this);">
+2 -3
View File
@@ -10,11 +10,10 @@ add_javascript('<script src="'.G5_JS_URL.'/shop.list.action.js"></script>', 10);
<?php if(!defined('G5_IS_SHOP_AJAX_LIST') && $config['cf_kakao_js_apikey']) { ?> <?php if(!defined('G5_IS_SHOP_AJAX_LIST') && $config['cf_kakao_js_apikey']) { ?>
<script src="https://developers.kakao.com/sdk/js/kakao.min.js" async></script> <script src="https://developers.kakao.com/sdk/js/kakao.min.js" async></script>
<script src="<?php echo G5_JS_URL; ?>/kakaolink.js"></script>
<script> <script>
// 사용할 앱의 Javascript 키를 설정해 주세요. var kakao_javascript_apikey = "<?php echo $config['cf_kakao_js_apikey']; ?>";
Kakao.init("<?php echo $config['cf_kakao_js_apikey']; ?>");
</script> </script>
<script src="<?php echo G5_JS_URL; ?>/kakaolink.js?ver=<?php echo G5_JS_VER; ?>"></script>
<?php } ?> <?php } ?>
<!-- 메인상품진열 10 시작 { --> <!-- 메인상품진열 10 시작 { -->
+2 -3
View File
@@ -10,11 +10,10 @@ add_javascript('<script src="'.G5_JS_URL.'/shop.list.action.js"></script>', 10);
<?php if($config['cf_kakao_js_apikey']) { ?> <?php if($config['cf_kakao_js_apikey']) { ?>
<script src="https://developers.kakao.com/sdk/js/kakao.min.js" async></script> <script src="https://developers.kakao.com/sdk/js/kakao.min.js" async></script>
<script src="<?php echo G5_JS_URL; ?>/kakaolink.js"></script>
<script> <script>
// 사용할 앱의 Javascript 키를 설정해 주세요. var kakao_javascript_apikey = "<?php echo $config['cf_kakao_js_apikey']; ?>";
Kakao.init("<?php echo $config['cf_kakao_js_apikey']; ?>");
</script> </script>
<script src="<?php echo G5_JS_URL; ?>/kakaolink.js?ver=<?php echo G5_JS_VER; ?>"></script>
<?php } ?> <?php } ?>
<!-- 메인상품진열 10 시작 { --> <!-- 메인상품진열 10 시작 { -->
+2 -3
View File
@@ -11,11 +11,10 @@ add_javascript('<script src="'.G5_JS_URL.'/shop.list.action.js"></script>', 10);
<script src="<?php echo G5_JS_URL ?>/jquery.fancylist.js"></script> <script src="<?php echo G5_JS_URL ?>/jquery.fancylist.js"></script>
<?php if($config['cf_kakao_js_apikey']) { ?> <?php if($config['cf_kakao_js_apikey']) { ?>
<script src="https://developers.kakao.com/sdk/js/kakao.min.js" async></script> <script src="https://developers.kakao.com/sdk/js/kakao.min.js" async></script>
<script src="<?php echo G5_JS_URL; ?>/kakaolink.js"></script>
<script> <script>
// 사용할 앱의 Javascript 키를 설정해 주세요. var kakao_javascript_apikey = "<?php echo $config['cf_kakao_js_apikey']; ?>";
Kakao.init("<?php echo $config['cf_kakao_js_apikey']; ?>");
</script> </script>
<script src="<?php echo G5_JS_URL; ?>/kakaolink.js?ver=<?php echo G5_JS_VER; ?>"></script>
<?php } ?> <?php } ?>
<!-- 메인상품진열 20 시작 { --> <!-- 메인상품진열 20 시작 { -->
+2 -3
View File
@@ -11,11 +11,10 @@ add_javascript('<script src="'.G5_JS_URL.'/shop.list.action.js"></script>', 10);
<?php if($config['cf_kakao_js_apikey']) { ?> <?php if($config['cf_kakao_js_apikey']) { ?>
<script src="https://developers.kakao.com/sdk/js/kakao.min.js" async></script> <script src="https://developers.kakao.com/sdk/js/kakao.min.js" async></script>
<script src="<?php echo G5_JS_URL; ?>/kakaolink.js"></script>
<script> <script>
// 사용할 앱의 Javascript 키를 설정해 주세요. var kakao_javascript_apikey = "<?php echo $config['cf_kakao_js_apikey']; ?>";
Kakao.init("<?php echo $config['cf_kakao_js_apikey']; ?>");
</script> </script>
<script src="<?php echo G5_JS_URL; ?>/kakaolink.js?ver=<?php echo G5_JS_VER; ?>"></script>
<?php } ?> <?php } ?>
<div class="st_30_wr"> <div class="st_30_wr">
<!-- 메인상품진열 30 시작 { --> <!-- 메인상품진열 30 시작 { -->
+2 -3
View File
@@ -8,11 +8,10 @@ add_stylesheet('<link rel="stylesheet" href="'.G5_MSHOP_SKIN_URL.'/style.css">',
<script src="<?php echo G5_JS_URL ?>/jquery.fancylist.js"></script> <script src="<?php echo G5_JS_URL ?>/jquery.fancylist.js"></script>
<?php if($config['cf_kakao_js_apikey']) { ?> <?php if($config['cf_kakao_js_apikey']) { ?>
<script src="https://developers.kakao.com/sdk/js/kakao.min.js" async></script> <script src="https://developers.kakao.com/sdk/js/kakao.min.js" async></script>
<script src="<?php echo G5_JS_URL; ?>/kakaolink.js"></script>
<script> <script>
// 사용할 앱의 Javascript 키를 설정해 주세요. var kakao_javascript_apikey = "<?php echo $config['cf_kakao_js_apikey']; ?>";
Kakao.init("<?php echo $config['cf_kakao_js_apikey']; ?>");
</script> </script>
<script src="<?php echo G5_JS_URL; ?>/kakaolink.js?ver=<?php echo G5_JS_VER; ?>"></script>
<?php } ?> <?php } ?>
<!-- 상품진열 10 시작 { --> <!-- 상품진열 10 시작 { -->
File diff suppressed because it is too large. Load diff
+4 -4
View File
@@ -8,7 +8,7 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
*/ */
if( !class_exists('HTMLPurifier_Filter_Iframevideo') ){ if( !class_exists('HTMLPurifier_Filter_Iframevideo') ){
class HTMLPurifier_Filter_iframevideo extends HTMLPurifier_Filter class HTMLPurifier_Filter_Iframevideo extends HTMLPurifier_Filter
{ {
public $name = 'Iframevideo'; public $name = 'Iframevideo';
@@ -61,9 +61,9 @@ if( !class_exists('HTMLPurifier_Filter_Iframevideo') ){
protected function postFilterCallback($matches) protected function postFilterCallback($matches)
{ {
// Domain Whitelist // Domain Whitelist
$youTubeMatch = preg_match('#src="https?://www.youtube(-nocookie)?.com/#i', $matches[1]); $youTubeMatch = preg_match('#src="https?://www\.youtube(-nocookie)?\.com/#i', $matches[1]);
$vimeoMatch = preg_match('#src="https?://player.vimeo.com/#i', $matches[1]); $vimeoMatch = preg_match('#src="https?://player\.vimeo\.com/#i', $matches[1]);
$fackbookMatch = preg_match('#src="https?://www.facebook.com/#i', $matches[1]); $fackbookMatch = preg_match('#src="https?://www\.facebook\.com/#i', $matches[1]);
if ($youTubeMatch || $vimeoMatch || $fackbookMatch) { if ($youTubeMatch || $vimeoMatch || $fackbookMatch) {
$extra = ' frameborder="0"'; $extra = ' frameborder="0"';
if ($youTubeMatch || $fackbookMatch) { if ($youTubeMatch || $fackbookMatch) {
@@ -1,15 +1,15 @@
AutoFormat.RemoveEmpty.RemoveNbsp AutoFormat.RemoveEmpty.RemoveNbsp
TYPE: bool TYPE: bool
VERSION: 4.0.0 VERSION: 4.0.0
DEFAULT: false DEFAULT: false
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
When enabled, HTML Purifier will treat any elements that contain only When enabled, HTML Purifier will treat any elements that contain only
non-breaking spaces as well as regular whitespace as empty, and remove non-breaking spaces as well as regular whitespace as empty, and remove
them when %AutoFormat.RemoveEmpty is enabled. them when %AutoFormat.RemoveEmpty is enabled.
</p> </p>
<p> <p>
See %AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions for a list of elements See %AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions for a list of elements
that don't have this behavior applied to them. that don't have this behavior applied to them.
</p> </p>
--# vim: et sw=4 sts=4 --# vim: et sw=4 sts=4
@@ -1,12 +1,12 @@
Core.AllowParseManyTags Core.AllowParseManyTags
TYPE: bool TYPE: bool
DEFAULT: false DEFAULT: false
VERSION: 4.10.1 VERSION: 4.10.1
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
This directive allows parsing of many nested tags. This directive allows parsing of many nested tags.
If you set true, relaxes any hardcoded limit from the parser. If you set true, relaxes any hardcoded limit from the parser.
However, in that case it may cause a Dos attack. However, in that case it may cause a Dos attack.
Be careful when enabling it. Be careful when enabling it.
</p> </p>
--# vim: et sw=4 sts=4 --# vim: et sw=4 sts=4
@@ -1,160 +1,160 @@
Core.ColorKeywords Core.ColorKeywords
TYPE: hash TYPE: hash
VERSION: 2.0.0 VERSION: 2.0.0
--DEFAULT-- --DEFAULT--
array ( array (
'aliceblue' => '#F0F8FF', 'aliceblue' => '#F0F8FF',
'antiquewhite' => '#FAEBD7', 'antiquewhite' => '#FAEBD7',
'aqua' => '#00FFFF', 'aqua' => '#00FFFF',
'aquamarine' => '#7FFFD4', 'aquamarine' => '#7FFFD4',
'azure' => '#F0FFFF', 'azure' => '#F0FFFF',
'beige' => '#F5F5DC', 'beige' => '#F5F5DC',
'bisque' => '#FFE4C4', 'bisque' => '#FFE4C4',
'black' => '#000000', 'black' => '#000000',
'blanchedalmond' => '#FFEBCD', 'blanchedalmond' => '#FFEBCD',
'blue' => '#0000FF', 'blue' => '#0000FF',
'blueviolet' => '#8A2BE2', 'blueviolet' => '#8A2BE2',
'brown' => '#A52A2A', 'brown' => '#A52A2A',
'burlywood' => '#DEB887', 'burlywood' => '#DEB887',
'cadetblue' => '#5F9EA0', 'cadetblue' => '#5F9EA0',
'chartreuse' => '#7FFF00', 'chartreuse' => '#7FFF00',
'chocolate' => '#D2691E', 'chocolate' => '#D2691E',
'coral' => '#FF7F50', 'coral' => '#FF7F50',
'cornflowerblue' => '#6495ED', 'cornflowerblue' => '#6495ED',
'cornsilk' => '#FFF8DC', 'cornsilk' => '#FFF8DC',
'crimson' => '#DC143C', 'crimson' => '#DC143C',
'cyan' => '#00FFFF', 'cyan' => '#00FFFF',
'darkblue' => '#00008B', 'darkblue' => '#00008B',
'darkcyan' => '#008B8B', 'darkcyan' => '#008B8B',
'darkgoldenrod' => '#B8860B', 'darkgoldenrod' => '#B8860B',
'darkgray' => '#A9A9A9', 'darkgray' => '#A9A9A9',
'darkgrey' => '#A9A9A9', 'darkgrey' => '#A9A9A9',
'darkgreen' => '#006400', 'darkgreen' => '#006400',
'darkkhaki' => '#BDB76B', 'darkkhaki' => '#BDB76B',
'darkmagenta' => '#8B008B', 'darkmagenta' => '#8B008B',
'darkolivegreen' => '#556B2F', 'darkolivegreen' => '#556B2F',
'darkorange' => '#FF8C00', 'darkorange' => '#FF8C00',
'darkorchid' => '#9932CC', 'darkorchid' => '#9932CC',
'darkred' => '#8B0000', 'darkred' => '#8B0000',
'darksalmon' => '#E9967A', 'darksalmon' => '#E9967A',
'darkseagreen' => '#8FBC8F', 'darkseagreen' => '#8FBC8F',
'darkslateblue' => '#483D8B', 'darkslateblue' => '#483D8B',
'darkslategray' => '#2F4F4F', 'darkslategray' => '#2F4F4F',
'darkslategrey' => '#2F4F4F', 'darkslategrey' => '#2F4F4F',
'darkturquoise' => '#00CED1', 'darkturquoise' => '#00CED1',
'darkviolet' => '#9400D3', 'darkviolet' => '#9400D3',
'deeppink' => '#FF1493', 'deeppink' => '#FF1493',
'deepskyblue' => '#00BFFF', 'deepskyblue' => '#00BFFF',
'dimgray' => '#696969', 'dimgray' => '#696969',
'dimgrey' => '#696969', 'dimgrey' => '#696969',
'dodgerblue' => '#1E90FF', 'dodgerblue' => '#1E90FF',
'firebrick' => '#B22222', 'firebrick' => '#B22222',
'floralwhite' => '#FFFAF0', 'floralwhite' => '#FFFAF0',
'forestgreen' => '#228B22', 'forestgreen' => '#228B22',
'fuchsia' => '#FF00FF', 'fuchsia' => '#FF00FF',
'gainsboro' => '#DCDCDC', 'gainsboro' => '#DCDCDC',
'ghostwhite' => '#F8F8FF', 'ghostwhite' => '#F8F8FF',
'gold' => '#FFD700', 'gold' => '#FFD700',
'goldenrod' => '#DAA520', 'goldenrod' => '#DAA520',
'gray' => '#808080', 'gray' => '#808080',
'grey' => '#808080', 'grey' => '#808080',
'green' => '#008000', 'green' => '#008000',
'greenyellow' => '#ADFF2F', 'greenyellow' => '#ADFF2F',
'honeydew' => '#F0FFF0', 'honeydew' => '#F0FFF0',
'hotpink' => '#FF69B4', 'hotpink' => '#FF69B4',
'indianred' => '#CD5C5C', 'indianred' => '#CD5C5C',
'indigo' => '#4B0082', 'indigo' => '#4B0082',
'ivory' => '#FFFFF0', 'ivory' => '#FFFFF0',
'khaki' => '#F0E68C', 'khaki' => '#F0E68C',
'lavender' => '#E6E6FA', 'lavender' => '#E6E6FA',
'lavenderblush' => '#FFF0F5', 'lavenderblush' => '#FFF0F5',
'lawngreen' => '#7CFC00', 'lawngreen' => '#7CFC00',
'lemonchiffon' => '#FFFACD', 'lemonchiffon' => '#FFFACD',
'lightblue' => '#ADD8E6', 'lightblue' => '#ADD8E6',
'lightcoral' => '#F08080', 'lightcoral' => '#F08080',
'lightcyan' => '#E0FFFF', 'lightcyan' => '#E0FFFF',
'lightgoldenrodyellow' => '#FAFAD2', 'lightgoldenrodyellow' => '#FAFAD2',
'lightgray' => '#D3D3D3', 'lightgray' => '#D3D3D3',
'lightgrey' => '#D3D3D3', 'lightgrey' => '#D3D3D3',
'lightgreen' => '#90EE90', 'lightgreen' => '#90EE90',
'lightpink' => '#FFB6C1', 'lightpink' => '#FFB6C1',
'lightsalmon' => '#FFA07A', 'lightsalmon' => '#FFA07A',
'lightseagreen' => '#20B2AA', 'lightseagreen' => '#20B2AA',
'lightskyblue' => '#87CEFA', 'lightskyblue' => '#87CEFA',
'lightslategray' => '#778899', 'lightslategray' => '#778899',
'lightslategrey' => '#778899', 'lightslategrey' => '#778899',
'lightsteelblue' => '#B0C4DE', 'lightsteelblue' => '#B0C4DE',
'lightyellow' => '#FFFFE0', 'lightyellow' => '#FFFFE0',
'lime' => '#00FF00', 'lime' => '#00FF00',
'limegreen' => '#32CD32', 'limegreen' => '#32CD32',
'linen' => '#FAF0E6', 'linen' => '#FAF0E6',
'magenta' => '#FF00FF', 'magenta' => '#FF00FF',
'maroon' => '#800000', 'maroon' => '#800000',
'mediumaquamarine' => '#66CDAA', 'mediumaquamarine' => '#66CDAA',
'mediumblue' => '#0000CD', 'mediumblue' => '#0000CD',
'mediumorchid' => '#BA55D3', 'mediumorchid' => '#BA55D3',
'mediumpurple' => '#9370DB', 'mediumpurple' => '#9370DB',
'mediumseagreen' => '#3CB371', 'mediumseagreen' => '#3CB371',
'mediumslateblue' => '#7B68EE', 'mediumslateblue' => '#7B68EE',
'mediumspringgreen' => '#00FA9A', 'mediumspringgreen' => '#00FA9A',
'mediumturquoise' => '#48D1CC', 'mediumturquoise' => '#48D1CC',
'mediumvioletred' => '#C71585', 'mediumvioletred' => '#C71585',
'midnightblue' => '#191970', 'midnightblue' => '#191970',
'mintcream' => '#F5FFFA', 'mintcream' => '#F5FFFA',
'mistyrose' => '#FFE4E1', 'mistyrose' => '#FFE4E1',
'moccasin' => '#FFE4B5', 'moccasin' => '#FFE4B5',
'navajowhite' => '#FFDEAD', 'navajowhite' => '#FFDEAD',
'navy' => '#000080', 'navy' => '#000080',
'oldlace' => '#FDF5E6', 'oldlace' => '#FDF5E6',
'olive' => '#808000', 'olive' => '#808000',
'olivedrab' => '#6B8E23', 'olivedrab' => '#6B8E23',
'orange' => '#FFA500', 'orange' => '#FFA500',
'orangered' => '#FF4500', 'orangered' => '#FF4500',
'orchid' => '#DA70D6', 'orchid' => '#DA70D6',
'palegoldenrod' => '#EEE8AA', 'palegoldenrod' => '#EEE8AA',
'palegreen' => '#98FB98', 'palegreen' => '#98FB98',
'paleturquoise' => '#AFEEEE', 'paleturquoise' => '#AFEEEE',
'palevioletred' => '#DB7093', 'palevioletred' => '#DB7093',
'papayawhip' => '#FFEFD5', 'papayawhip' => '#FFEFD5',
'peachpuff' => '#FFDAB9', 'peachpuff' => '#FFDAB9',
'peru' => '#CD853F', 'peru' => '#CD853F',
'pink' => '#FFC0CB', 'pink' => '#FFC0CB',
'plum' => '#DDA0DD', 'plum' => '#DDA0DD',
'powderblue' => '#B0E0E6', 'powderblue' => '#B0E0E6',
'purple' => '#800080', 'purple' => '#800080',
'rebeccapurple' => '#663399', 'rebeccapurple' => '#663399',
'red' => '#FF0000', 'red' => '#FF0000',
'rosybrown' => '#BC8F8F', 'rosybrown' => '#BC8F8F',
'royalblue' => '#4169E1', 'royalblue' => '#4169E1',
'saddlebrown' => '#8B4513', 'saddlebrown' => '#8B4513',
'salmon' => '#FA8072', 'salmon' => '#FA8072',
'sandybrown' => '#F4A460', 'sandybrown' => '#F4A460',
'seagreen' => '#2E8B57', 'seagreen' => '#2E8B57',
'seashell' => '#FFF5EE', 'seashell' => '#FFF5EE',
'sienna' => '#A0522D', 'sienna' => '#A0522D',
'silver' => '#C0C0C0', 'silver' => '#C0C0C0',
'skyblue' => '#87CEEB', 'skyblue' => '#87CEEB',
'slateblue' => '#6A5ACD', 'slateblue' => '#6A5ACD',
'slategray' => '#708090', 'slategray' => '#708090',
'slategrey' => '#708090', 'slategrey' => '#708090',
'snow' => '#FFFAFA', 'snow' => '#FFFAFA',
'springgreen' => '#00FF7F', 'springgreen' => '#00FF7F',
'steelblue' => '#4682B4', 'steelblue' => '#4682B4',
'tan' => '#D2B48C', 'tan' => '#D2B48C',
'teal' => '#008080', 'teal' => '#008080',
'thistle' => '#D8BFD8', 'thistle' => '#D8BFD8',
'tomato' => '#FF6347', 'tomato' => '#FF6347',
'turquoise' => '#40E0D0', 'turquoise' => '#40E0D0',
'violet' => '#EE82EE', 'violet' => '#EE82EE',
'wheat' => '#F5DEB3', 'wheat' => '#F5DEB3',
'white' => '#FFFFFF', 'white' => '#FFFFFF',
'whitesmoke' => '#F5F5F5', 'whitesmoke' => '#F5F5F5',
'yellow' => '#FFFF00', 'yellow' => '#FFFF00',
'yellowgreen' => '#9ACD32' 'yellowgreen' => '#9ACD32'
) )
--DESCRIPTION-- --DESCRIPTION--
Lookup array of color names to six digit hexadecimal number corresponding Lookup array of color names to six digit hexadecimal number corresponding
to color, with preceding hash mark. Used when parsing colors. The lookup to color, with preceding hash mark. Used when parsing colors. The lookup
is done in a case-insensitive manner. is done in a case-insensitive manner.
--# vim: et sw=4 sts=4 --# vim: et sw=4 sts=4
@@ -1,11 +1,11 @@
HTML.Forms HTML.Forms
TYPE: bool TYPE: bool
VERSION: 4.13.0 VERSION: 4.13.0
DEFAULT: false DEFAULT: false
--DESCRIPTION-- --DESCRIPTION--
<p> <p>
Whether or not to permit form elements in the user input, regardless of Whether or not to permit form elements in the user input, regardless of
%HTML.Trusted value. Please be very careful when using this functionality, as %HTML.Trusted value. Please be very careful when using this functionality, as
enabling forms in untrusted documents may allow for phishing attacks. enabling forms in untrusted documents may allow for phishing attacks.
</p> </p>
--# vim: et sw=4 sts=4 --# vim: et sw=4 sts=4
File diff suppressed because it is too large. Load diff
@@ -1,451 +1,451 @@
<?php <?php
/** /**
* @todo Rewrite to use Interchange objects * @todo Rewrite to use Interchange objects
*/ */
class HTMLPurifier_Printer_ConfigForm extends HTMLPurifier_Printer class HTMLPurifier_Printer_ConfigForm extends HTMLPurifier_Printer
{ {
/** /**
* Printers for specific fields. * Printers for specific fields.
* @type HTMLPurifier_Printer[] * @type HTMLPurifier_Printer[]
*/ */
protected $fields = array(); protected $fields = array();
/** /**
* Documentation URL, can have fragment tagged on end. * Documentation URL, can have fragment tagged on end.
* @type string * @type string
*/ */
protected $docURL; protected $docURL;
/** /**
* Name of form element to stuff config in. * Name of form element to stuff config in.
* @type string * @type string
*/ */
protected $name; protected $name;
/** /**
* Whether or not to compress directive names, clipping them off * Whether or not to compress directive names, clipping them off
* after a certain amount of letters. False to disable or integer letters * after a certain amount of letters. False to disable or integer letters
* before clipping. * before clipping.
* @type bool * @type bool
*/ */
protected $compress = false; protected $compress = false;
/** /**
* @param string $name Form element name for directives to be stuffed into * @param string $name Form element name for directives to be stuffed into
* @param string $doc_url String documentation URL, will have fragment tagged on * @param string $doc_url String documentation URL, will have fragment tagged on
* @param bool $compress Integer max length before compressing a directive name, set to false to turn off * @param bool $compress Integer max length before compressing a directive name, set to false to turn off
*/ */
public function __construct( public function __construct(
$name, $name,
$doc_url = null, $doc_url = null,
$compress = false $compress = false
) { ) {
parent::__construct(); parent::__construct();
$this->docURL = $doc_url; $this->docURL = $doc_url;
$this->name = $name; $this->name = $name;
$this->compress = $compress; $this->compress = $compress;
// initialize sub-printers // initialize sub-printers
$this->fields[0] = new HTMLPurifier_Printer_ConfigForm_default(); $this->fields[0] = new HTMLPurifier_Printer_ConfigForm_default();
$this->fields[HTMLPurifier_VarParser::C_BOOL] = new HTMLPurifier_Printer_ConfigForm_bool(); $this->fields[HTMLPurifier_VarParser::C_BOOL] = new HTMLPurifier_Printer_ConfigForm_bool();
} }
/** /**
* Sets default column and row size for textareas in sub-printers * Sets default column and row size for textareas in sub-printers
* @param $cols Integer columns of textarea, null to use default * @param $cols Integer columns of textarea, null to use default
* @param $rows Integer rows of textarea, null to use default * @param $rows Integer rows of textarea, null to use default
*/ */
public function setTextareaDimensions($cols = null, $rows = null) public function setTextareaDimensions($cols = null, $rows = null)
{ {
if ($cols) { if ($cols) {
$this->fields['default']->cols = $cols; $this->fields['default']->cols = $cols;
} }
if ($rows) { if ($rows) {
$this->fields['default']->rows = $rows; $this->fields['default']->rows = $rows;
} }
} }
/** /**
* Retrieves styling, in case it is not accessible by webserver * Retrieves styling, in case it is not accessible by webserver
*/ */
public static function getCSS() public static function getCSS()
{ {
return file_get_contents(HTMLPURIFIER_PREFIX . '/HTMLPurifier/Printer/ConfigForm.css'); return file_get_contents(HTMLPURIFIER_PREFIX . '/HTMLPurifier/Printer/ConfigForm.css');
} }
/** /**
* Retrieves JavaScript, in case it is not accessible by webserver * Retrieves JavaScript, in case it is not accessible by webserver
*/ */
public static function getJavaScript() public static function getJavaScript()
{ {
return file_get_contents(HTMLPURIFIER_PREFIX . '/HTMLPurifier/Printer/ConfigForm.js'); return file_get_contents(HTMLPURIFIER_PREFIX . '/HTMLPurifier/Printer/ConfigForm.js');
} }
/** /**
* Returns HTML output for a configuration form * Returns HTML output for a configuration form
* @param HTMLPurifier_Config|array $config Configuration object of current form state, or an array * @param HTMLPurifier_Config|array $config Configuration object of current form state, or an array
* where [0] has an HTML namespace and [1] is being rendered. * where [0] has an HTML namespace and [1] is being rendered.
* @param array|bool $allowed Optional namespace(s) and directives to restrict form to. * @param array|bool $allowed Optional namespace(s) and directives to restrict form to.
* @param bool $render_controls * @param bool $render_controls
* @return string * @return string
*/ */
public function render($config, $allowed = true, $render_controls = true) public function render($config, $allowed = true, $render_controls = true)
{ {
if (is_array($config) && isset($config[0])) { if (is_array($config) && isset($config[0])) {
$gen_config = $config[0]; $gen_config = $config[0];
$config = $config[1]; $config = $config[1];
} else { } else {
$gen_config = $config; $gen_config = $config;
} }
$this->config = $config; $this->config = $config;
$this->genConfig = $gen_config; $this->genConfig = $gen_config;
$this->prepareGenerator($gen_config); $this->prepareGenerator($gen_config);
$allowed = HTMLPurifier_Config::getAllowedDirectivesForForm($allowed, $config->def); $allowed = HTMLPurifier_Config::getAllowedDirectivesForForm($allowed, $config->def);
$all = array(); $all = array();
foreach ($allowed as $key) { foreach ($allowed as $key) {
list($ns, $directive) = $key; list($ns, $directive) = $key;
$all[$ns][$directive] = $config->get($ns . '.' . $directive); $all[$ns][$directive] = $config->get($ns . '.' . $directive);
} }
$ret = ''; $ret = '';
$ret .= $this->start('table', array('class' => 'hp-config')); $ret .= $this->start('table', array('class' => 'hp-config'));
$ret .= $this->start('thead'); $ret .= $this->start('thead');
$ret .= $this->start('tr'); $ret .= $this->start('tr');
$ret .= $this->element('th', 'Directive', array('class' => 'hp-directive')); $ret .= $this->element('th', 'Directive', array('class' => 'hp-directive'));
$ret .= $this->element('th', 'Value', array('class' => 'hp-value')); $ret .= $this->element('th', 'Value', array('class' => 'hp-value'));
$ret .= $this->end('tr'); $ret .= $this->end('tr');
$ret .= $this->end('thead'); $ret .= $this->end('thead');
foreach ($all as $ns => $directives) { foreach ($all as $ns => $directives) {
$ret .= $this->renderNamespace($ns, $directives); $ret .= $this->renderNamespace($ns, $directives);
} }
if ($render_controls) { if ($render_controls) {
$ret .= $this->start('tbody'); $ret .= $this->start('tbody');
$ret .= $this->start('tr'); $ret .= $this->start('tr');
$ret .= $this->start('td', array('colspan' => 2, 'class' => 'controls')); $ret .= $this->start('td', array('colspan' => 2, 'class' => 'controls'));
$ret .= $this->elementEmpty('input', array('type' => 'submit', 'value' => 'Submit')); $ret .= $this->elementEmpty('input', array('type' => 'submit', 'value' => 'Submit'));
$ret .= '[<a href="?">Reset</a>]'; $ret .= '[<a href="?">Reset</a>]';
$ret .= $this->end('td'); $ret .= $this->end('td');
$ret .= $this->end('tr'); $ret .= $this->end('tr');
$ret .= $this->end('tbody'); $ret .= $this->end('tbody');
} }
$ret .= $this->end('table'); $ret .= $this->end('table');
return $ret; return $ret;
} }
/** /**
* Renders a single namespace * Renders a single namespace
* @param $ns String namespace name * @param $ns String namespace name
* @param array $directives array of directives to values * @param array $directives array of directives to values
* @return string * @return string
*/ */
protected function renderNamespace($ns, $directives) protected function renderNamespace($ns, $directives)
{ {
$ret = ''; $ret = '';
$ret .= $this->start('tbody', array('class' => 'namespace')); $ret .= $this->start('tbody', array('class' => 'namespace'));
$ret .= $this->start('tr'); $ret .= $this->start('tr');
$ret .= $this->element('th', $ns, array('colspan' => 2)); $ret .= $this->element('th', $ns, array('colspan' => 2));
$ret .= $this->end('tr'); $ret .= $this->end('tr');
$ret .= $this->end('tbody'); $ret .= $this->end('tbody');
$ret .= $this->start('tbody'); $ret .= $this->start('tbody');
foreach ($directives as $directive => $value) { foreach ($directives as $directive => $value) {
$ret .= $this->start('tr'); $ret .= $this->start('tr');
$ret .= $this->start('th'); $ret .= $this->start('th');
if ($this->docURL) { if ($this->docURL) {
$url = str_replace('%s', urlencode("$ns.$directive"), $this->docURL); $url = str_replace('%s', urlencode("$ns.$directive"), $this->docURL);
$ret .= $this->start('a', array('href' => $url)); $ret .= $this->start('a', array('href' => $url));
} }
$attr = array('for' => "{$this->name}:$ns.$directive"); $attr = array('for' => "{$this->name}:$ns.$directive");
// crop directive name if it's too long // crop directive name if it's too long
if (!$this->compress || (strlen($directive) < $this->compress)) { if (!$this->compress || (strlen($directive) < $this->compress)) {
$directive_disp = $directive; $directive_disp = $directive;
} else { } else {
$directive_disp = substr($directive, 0, $this->compress - 2) . '...'; $directive_disp = substr($directive, 0, $this->compress - 2) . '...';
$attr['title'] = $directive; $attr['title'] = $directive;
} }
$ret .= $this->element( $ret .= $this->element(
'label', 'label',
$directive_disp, $directive_disp,
// component printers must create an element with this id // component printers must create an element with this id
$attr $attr
); );
if ($this->docURL) { if ($this->docURL) {
$ret .= $this->end('a'); $ret .= $this->end('a');
} }
$ret .= $this->end('th'); $ret .= $this->end('th');
$ret .= $this->start('td'); $ret .= $this->start('td');
$def = $this->config->def->info["$ns.$directive"]; $def = $this->config->def->info["$ns.$directive"];
if (is_int($def)) { if (is_int($def)) {
$allow_null = $def < 0; $allow_null = $def < 0;
$type = abs($def); $type = abs($def);
} else { } else {
$type = $def->type; $type = $def->type;
$allow_null = isset($def->allow_null); $allow_null = isset($def->allow_null);
} }
if (!isset($this->fields[$type])) { if (!isset($this->fields[$type])) {
$type = 0; $type = 0;
} // default } // default
$type_obj = $this->fields[$type]; $type_obj = $this->fields[$type];
if ($allow_null) { if ($allow_null) {
$type_obj = new HTMLPurifier_Printer_ConfigForm_NullDecorator($type_obj); $type_obj = new HTMLPurifier_Printer_ConfigForm_NullDecorator($type_obj);
} }
$ret .= $type_obj->render($ns, $directive, $value, $this->name, array($this->genConfig, $this->config)); $ret .= $type_obj->render($ns, $directive, $value, $this->name, array($this->genConfig, $this->config));
$ret .= $this->end('td'); $ret .= $this->end('td');
$ret .= $this->end('tr'); $ret .= $this->end('tr');
} }
$ret .= $this->end('tbody'); $ret .= $this->end('tbody');
return $ret; return $ret;
} }
} }
/** /**
* Printer decorator for directives that accept null * Printer decorator for directives that accept null
*/ */
class HTMLPurifier_Printer_ConfigForm_NullDecorator extends HTMLPurifier_Printer class HTMLPurifier_Printer_ConfigForm_NullDecorator extends HTMLPurifier_Printer
{ {
/** /**
* Printer being decorated * Printer being decorated
* @type HTMLPurifier_Printer * @type HTMLPurifier_Printer
*/ */
protected $obj; protected $obj;
/** /**
* @param HTMLPurifier_Printer $obj Printer to decorate * @param HTMLPurifier_Printer $obj Printer to decorate
*/ */
public function __construct($obj) public function __construct($obj)
{ {
parent::__construct(); parent::__construct();
$this->obj = $obj; $this->obj = $obj;
} }
/** /**
* @param string $ns * @param string $ns
* @param string $directive * @param string $directive
* @param string $value * @param string $value
* @param string $name * @param string $name
* @param HTMLPurifier_Config|array $config * @param HTMLPurifier_Config|array $config
* @return string * @return string
*/ */
public function render($ns, $directive, $value, $name, $config) public function render($ns, $directive, $value, $name, $config)
{ {
if (is_array($config) && isset($config[0])) { if (is_array($config) && isset($config[0])) {
$gen_config = $config[0]; $gen_config = $config[0];
$config = $config[1]; $config = $config[1];
} else { } else {
$gen_config = $config; $gen_config = $config;
} }
$this->prepareGenerator($gen_config); $this->prepareGenerator($gen_config);
$ret = ''; $ret = '';
$ret .= $this->start('label', array('for' => "$name:Null_$ns.$directive")); $ret .= $this->start('label', array('for' => "$name:Null_$ns.$directive"));
$ret .= $this->element('span', "$ns.$directive:", array('class' => 'verbose')); $ret .= $this->element('span', "$ns.$directive:", array('class' => 'verbose'));
$ret .= $this->text(' Null/Disabled'); $ret .= $this->text(' Null/Disabled');
$ret .= $this->end('label'); $ret .= $this->end('label');
$attr = array( $attr = array(
'type' => 'checkbox', 'type' => 'checkbox',
'value' => '1', 'value' => '1',
'class' => 'null-toggle', 'class' => 'null-toggle',
'name' => "$name" . "[Null_$ns.$directive]", 'name' => "$name" . "[Null_$ns.$directive]",
'id' => "$name:Null_$ns.$directive", 'id' => "$name:Null_$ns.$directive",
'onclick' => "toggleWriteability('$name:$ns.$directive',checked)" // INLINE JAVASCRIPT!!!! 'onclick' => "toggleWriteability('$name:$ns.$directive',checked)" // INLINE JAVASCRIPT!!!!
); );
if ($this->obj instanceof HTMLPurifier_Printer_ConfigForm_bool) { if ($this->obj instanceof HTMLPurifier_Printer_ConfigForm_bool) {
// modify inline javascript slightly // modify inline javascript slightly
$attr['onclick'] = $attr['onclick'] =
"toggleWriteability('$name:Yes_$ns.$directive',checked);" . "toggleWriteability('$name:Yes_$ns.$directive',checked);" .
"toggleWriteability('$name:No_$ns.$directive',checked)"; "toggleWriteability('$name:No_$ns.$directive',checked)";
} }
if ($value === null) { if ($value === null) {
$attr['checked'] = 'checked'; $attr['checked'] = 'checked';
} }
$ret .= $this->elementEmpty('input', $attr); $ret .= $this->elementEmpty('input', $attr);
$ret .= $this->text(' or '); $ret .= $this->text(' or ');
$ret .= $this->elementEmpty('br'); $ret .= $this->elementEmpty('br');
$ret .= $this->obj->render($ns, $directive, $value, $name, array($gen_config, $config)); $ret .= $this->obj->render($ns, $directive, $value, $name, array($gen_config, $config));
return $ret; return $ret;
} }
} }
/** /**
* Swiss-army knife configuration form field printer * Swiss-army knife configuration form field printer
*/ */
class HTMLPurifier_Printer_ConfigForm_default extends HTMLPurifier_Printer class HTMLPurifier_Printer_ConfigForm_default extends HTMLPurifier_Printer
{ {
/** /**
* @type int * @type int
*/ */
public $cols = 18; public $cols = 18;
/** /**
* @type int * @type int
*/ */
public $rows = 5; public $rows = 5;
/** /**
* @param string $ns * @param string $ns
* @param string $directive * @param string $directive
* @param string $value * @param string $value
* @param string $name * @param string $name
* @param HTMLPurifier_Config|array $config * @param HTMLPurifier_Config|array $config
* @return string * @return string
*/ */
public function render($ns, $directive, $value, $name, $config) public function render($ns, $directive, $value, $name, $config)
{ {
if (is_array($config) && isset($config[0])) { if (is_array($config) && isset($config[0])) {
$gen_config = $config[0]; $gen_config = $config[0];
$config = $config[1]; $config = $config[1];
} else { } else {
$gen_config = $config; $gen_config = $config;
} }
$this->prepareGenerator($gen_config); $this->prepareGenerator($gen_config);
// this should probably be split up a little // this should probably be split up a little
$ret = ''; $ret = '';
$def = $config->def->info["$ns.$directive"]; $def = $config->def->info["$ns.$directive"];
if (is_int($def)) { if (is_int($def)) {
$type = abs($def); $type = abs($def);
} else { } else {
$type = $def->type; $type = $def->type;
} }
if (is_array($value)) { if (is_array($value)) {
switch ($type) { switch ($type) {
case HTMLPurifier_VarParser::LOOKUP: case HTMLPurifier_VarParser::LOOKUP:
$array = $value; $array = $value;
$value = array(); $value = array();
foreach ($array as $val => $b) { foreach ($array as $val => $b) {
$value[] = $val; $value[] = $val;
} }
//TODO does this need a break? //TODO does this need a break?
case HTMLPurifier_VarParser::ALIST: case HTMLPurifier_VarParser::ALIST:
$value = implode(PHP_EOL, $value); $value = implode(PHP_EOL, $value);
break; break;
case HTMLPurifier_VarParser::HASH: case HTMLPurifier_VarParser::HASH:
$nvalue = ''; $nvalue = '';
foreach ($value as $i => $v) { foreach ($value as $i => $v) {
if (is_array($v)) { if (is_array($v)) {
// HACK // HACK
$v = implode(";", $v); $v = implode(";", $v);
} }
$nvalue .= "$i:$v" . PHP_EOL; $nvalue .= "$i:$v" . PHP_EOL;
} }
$value = $nvalue; $value = $nvalue;
break; break;
default: default:
$value = ''; $value = '';
} }
} }
if ($type === HTMLPurifier_VarParser::C_MIXED) { if ($type === HTMLPurifier_VarParser::C_MIXED) {
return 'Not supported'; return 'Not supported';
$value = serialize($value); $value = serialize($value);
} }
$attr = array( $attr = array(
'name' => "$name" . "[$ns.$directive]", 'name' => "$name" . "[$ns.$directive]",
'id' => "$name:$ns.$directive" 'id' => "$name:$ns.$directive"
); );
if ($value === null) { if ($value === null) {
$attr['disabled'] = 'disabled'; $attr['disabled'] = 'disabled';
} }
if (isset($def->allowed)) { if (isset($def->allowed)) {
$ret .= $this->start('select', $attr); $ret .= $this->start('select', $attr);
foreach ($def->allowed as $val => $b) { foreach ($def->allowed as $val => $b) {
$attr = array(); $attr = array();
if ($value == $val) { if ($value == $val) {
$attr['selected'] = 'selected'; $attr['selected'] = 'selected';
} }
$ret .= $this->element('option', $val, $attr); $ret .= $this->element('option', $val, $attr);
} }
$ret .= $this->end('select'); $ret .= $this->end('select');
} elseif ($type === HTMLPurifier_VarParser::TEXT || } elseif ($type === HTMLPurifier_VarParser::TEXT ||
$type === HTMLPurifier_VarParser::ITEXT || $type === HTMLPurifier_VarParser::ITEXT ||
$type === HTMLPurifier_VarParser::ALIST || $type === HTMLPurifier_VarParser::ALIST ||
$type === HTMLPurifier_VarParser::HASH || $type === HTMLPurifier_VarParser::HASH ||
$type === HTMLPurifier_VarParser::LOOKUP) { $type === HTMLPurifier_VarParser::LOOKUP) {
$attr['cols'] = $this->cols; $attr['cols'] = $this->cols;
$attr['rows'] = $this->rows; $attr['rows'] = $this->rows;
$ret .= $this->start('textarea', $attr); $ret .= $this->start('textarea', $attr);
$ret .= $this->text($value); $ret .= $this->text($value);
$ret .= $this->end('textarea'); $ret .= $this->end('textarea');
} else { } else {
$attr['value'] = $value; $attr['value'] = $value;
$attr['type'] = 'text'; $attr['type'] = 'text';
$ret .= $this->elementEmpty('input', $attr); $ret .= $this->elementEmpty('input', $attr);
} }
return $ret; return $ret;
} }
} }
/** /**
* Bool form field printer * Bool form field printer
*/ */
class HTMLPurifier_Printer_ConfigForm_bool extends HTMLPurifier_Printer class HTMLPurifier_Printer_ConfigForm_bool extends HTMLPurifier_Printer
{ {
/** /**
* @param string $ns * @param string $ns
* @param string $directive * @param string $directive
* @param string $value * @param string $value
* @param string $name * @param string $name
* @param HTMLPurifier_Config|array $config * @param HTMLPurifier_Config|array $config
* @return string * @return string
*/ */
public function render($ns, $directive, $value, $name, $config) public function render($ns, $directive, $value, $name, $config)
{ {
if (is_array($config) && isset($config[0])) { if (is_array($config) && isset($config[0])) {
$gen_config = $config[0]; $gen_config = $config[0];
$config = $config[1]; $config = $config[1];
} else { } else {
$gen_config = $config; $gen_config = $config;
} }
$this->prepareGenerator($gen_config); $this->prepareGenerator($gen_config);
$ret = ''; $ret = '';
$ret .= $this->start('div', array('id' => "$name:$ns.$directive")); $ret .= $this->start('div', array('id' => "$name:$ns.$directive"));
$ret .= $this->start('label', array('for' => "$name:Yes_$ns.$directive")); $ret .= $this->start('label', array('for' => "$name:Yes_$ns.$directive"));
$ret .= $this->element('span', "$ns.$directive:", array('class' => 'verbose')); $ret .= $this->element('span', "$ns.$directive:", array('class' => 'verbose'));
$ret .= $this->text(' Yes'); $ret .= $this->text(' Yes');
$ret .= $this->end('label'); $ret .= $this->end('label');
$attr = array( $attr = array(
'type' => 'radio', 'type' => 'radio',
'name' => "$name" . "[$ns.$directive]", 'name' => "$name" . "[$ns.$directive]",
'id' => "$name:Yes_$ns.$directive", 'id' => "$name:Yes_$ns.$directive",
'value' => '1' 'value' => '1'
); );
if ($value === true) { if ($value === true) {
$attr['checked'] = 'checked'; $attr['checked'] = 'checked';
} }
if ($value === null) { if ($value === null) {
$attr['disabled'] = 'disabled'; $attr['disabled'] = 'disabled';
} }
$ret .= $this->elementEmpty('input', $attr); $ret .= $this->elementEmpty('input', $attr);
$ret .= $this->start('label', array('for' => "$name:No_$ns.$directive")); $ret .= $this->start('label', array('for' => "$name:No_$ns.$directive"));
$ret .= $this->element('span', "$ns.$directive:", array('class' => 'verbose')); $ret .= $this->element('span', "$ns.$directive:", array('class' => 'verbose'));
$ret .= $this->text(' No'); $ret .= $this->text(' No');
$ret .= $this->end('label'); $ret .= $this->end('label');
$attr = array( $attr = array(
'type' => 'radio', 'type' => 'radio',
'name' => "$name" . "[$ns.$directive]", 'name' => "$name" . "[$ns.$directive]",
'id' => "$name:No_$ns.$directive", 'id' => "$name:No_$ns.$directive",
'value' => '0' 'value' => '0'
); );
if ($value === false) { if ($value === false) {
$attr['checked'] = 'checked'; $attr['checked'] = 'checked';
} }
if ($value === null) { if ($value === null) {
$attr['disabled'] = 'disabled'; $attr['disabled'] = 'disabled';
} }
$ret .= $this->elementEmpty('input', $attr); $ret .= $this->elementEmpty('input', $attr);
$ret .= $this->end('div'); $ret .= $this->end('div');
return $ret; return $ret;
} }
} }
// vim: et sw=4 sts=4 // vim: et sw=4 sts=4
@@ -1,324 +1,324 @@
<?php <?php
class HTMLPurifier_Printer_HTMLDefinition extends HTMLPurifier_Printer class HTMLPurifier_Printer_HTMLDefinition extends HTMLPurifier_Printer
{ {
/** /**
* @type HTMLPurifier_HTMLDefinition, for easy access * @type HTMLPurifier_HTMLDefinition, for easy access
*/ */
protected $def; protected $def;
/** /**
* @param HTMLPurifier_Config $config * @param HTMLPurifier_Config $config
* @return string * @return string
*/ */
public function render($config) public function render($config)
{ {
$ret = ''; $ret = '';
$this->config =& $config; $this->config =& $config;
$this->def = $config->getHTMLDefinition(); $this->def = $config->getHTMLDefinition();
$ret .= $this->start('div', array('class' => 'HTMLPurifier_Printer')); $ret .= $this->start('div', array('class' => 'HTMLPurifier_Printer'));
$ret .= $this->renderDoctype(); $ret .= $this->renderDoctype();
$ret .= $this->renderEnvironment(); $ret .= $this->renderEnvironment();
$ret .= $this->renderContentSets(); $ret .= $this->renderContentSets();
$ret .= $this->renderInfo(); $ret .= $this->renderInfo();
$ret .= $this->end('div'); $ret .= $this->end('div');
return $ret; return $ret;
} }
/** /**
* Renders the Doctype table * Renders the Doctype table
* @return string * @return string
*/ */
protected function renderDoctype() protected function renderDoctype()
{ {
$doctype = $this->def->doctype; $doctype = $this->def->doctype;
$ret = ''; $ret = '';
$ret .= $this->start('table'); $ret .= $this->start('table');
$ret .= $this->element('caption', 'Doctype'); $ret .= $this->element('caption', 'Doctype');
$ret .= $this->row('Name', $doctype->name); $ret .= $this->row('Name', $doctype->name);
$ret .= $this->row('XML', $doctype->xml ? 'Yes' : 'No'); $ret .= $this->row('XML', $doctype->xml ? 'Yes' : 'No');
$ret .= $this->row('Default Modules', implode(', ', $doctype->modules)); $ret .= $this->row('Default Modules', implode(', ', $doctype->modules));
$ret .= $this->row('Default Tidy Modules', implode(', ', $doctype->tidyModules)); $ret .= $this->row('Default Tidy Modules', implode(', ', $doctype->tidyModules));
$ret .= $this->end('table'); $ret .= $this->end('table');
return $ret; return $ret;
} }
/** /**
* Renders environment table, which is miscellaneous info * Renders environment table, which is miscellaneous info
* @return string * @return string
*/ */
protected function renderEnvironment() protected function renderEnvironment()
{ {
$def = $this->def; $def = $this->def;
$ret = ''; $ret = '';
$ret .= $this->start('table'); $ret .= $this->start('table');
$ret .= $this->element('caption', 'Environment'); $ret .= $this->element('caption', 'Environment');
$ret .= $this->row('Parent of fragment', $def->info_parent); $ret .= $this->row('Parent of fragment', $def->info_parent);
$ret .= $this->renderChildren($def->info_parent_def->child); $ret .= $this->renderChildren($def->info_parent_def->child);
$ret .= $this->row('Block wrap name', $def->info_block_wrapper); $ret .= $this->row('Block wrap name', $def->info_block_wrapper);
$ret .= $this->start('tr'); $ret .= $this->start('tr');
$ret .= $this->element('th', 'Global attributes'); $ret .= $this->element('th', 'Global attributes');
$ret .= $this->element('td', $this->listifyAttr($def->info_global_attr), null, 0); $ret .= $this->element('td', $this->listifyAttr($def->info_global_attr), null, 0);
$ret .= $this->end('tr'); $ret .= $this->end('tr');
$ret .= $this->start('tr'); $ret .= $this->start('tr');
$ret .= $this->element('th', 'Tag transforms'); $ret .= $this->element('th', 'Tag transforms');
$list = array(); $list = array();
foreach ($def->info_tag_transform as $old => $new) { foreach ($def->info_tag_transform as $old => $new) {
$new = $this->getClass($new, 'TagTransform_'); $new = $this->getClass($new, 'TagTransform_');
$list[] = "<$old> with $new"; $list[] = "<$old> with $new";
} }
$ret .= $this->element('td', $this->listify($list)); $ret .= $this->element('td', $this->listify($list));
$ret .= $this->end('tr'); $ret .= $this->end('tr');
$ret .= $this->start('tr'); $ret .= $this->start('tr');
$ret .= $this->element('th', 'Pre-AttrTransform'); $ret .= $this->element('th', 'Pre-AttrTransform');
$ret .= $this->element('td', $this->listifyObjectList($def->info_attr_transform_pre)); $ret .= $this->element('td', $this->listifyObjectList($def->info_attr_transform_pre));
$ret .= $this->end('tr'); $ret .= $this->end('tr');
$ret .= $this->start('tr'); $ret .= $this->start('tr');
$ret .= $this->element('th', 'Post-AttrTransform'); $ret .= $this->element('th', 'Post-AttrTransform');
$ret .= $this->element('td', $this->listifyObjectList($def->info_attr_transform_post)); $ret .= $this->element('td', $this->listifyObjectList($def->info_attr_transform_post));
$ret .= $this->end('tr'); $ret .= $this->end('tr');
$ret .= $this->end('table'); $ret .= $this->end('table');
return $ret; return $ret;
} }
/** /**
* Renders the Content Sets table * Renders the Content Sets table
* @return string * @return string
*/ */
protected function renderContentSets() protected function renderContentSets()
{ {
$ret = ''; $ret = '';
$ret .= $this->start('table'); $ret .= $this->start('table');
$ret .= $this->element('caption', 'Content Sets'); $ret .= $this->element('caption', 'Content Sets');
foreach ($this->def->info_content_sets as $name => $lookup) { foreach ($this->def->info_content_sets as $name => $lookup) {
$ret .= $this->heavyHeader($name); $ret .= $this->heavyHeader($name);
$ret .= $this->start('tr'); $ret .= $this->start('tr');
$ret .= $this->element('td', $this->listifyTagLookup($lookup)); $ret .= $this->element('td', $this->listifyTagLookup($lookup));
$ret .= $this->end('tr'); $ret .= $this->end('tr');
} }
$ret .= $this->end('table'); $ret .= $this->end('table');
return $ret; return $ret;
} }
/** /**
* Renders the Elements ($info) table * Renders the Elements ($info) table
* @return string * @return string
*/ */
protected function renderInfo() protected function renderInfo()
{ {
$ret = ''; $ret = '';
$ret .= $this->start('table'); $ret .= $this->start('table');
$ret .= $this->element('caption', 'Elements ($info)'); $ret .= $this->element('caption', 'Elements ($info)');
ksort($this->def->info); ksort($this->def->info);
$ret .= $this->heavyHeader('Allowed tags', 2); $ret .= $this->heavyHeader('Allowed tags', 2);
$ret .= $this->start('tr'); $ret .= $this->start('tr');
$ret .= $this->element('td', $this->listifyTagLookup($this->def->info), array('colspan' => 2)); $ret .= $this->element('td', $this->listifyTagLookup($this->def->info), array('colspan' => 2));
$ret .= $this->end('tr'); $ret .= $this->end('tr');
foreach ($this->def->info as $name => $def) { foreach ($this->def->info as $name => $def) {
$ret .= $this->start('tr'); $ret .= $this->start('tr');
$ret .= $this->element('th', "<$name>", array('class' => 'heavy', 'colspan' => 2)); $ret .= $this->element('th', "<$name>", array('class' => 'heavy', 'colspan' => 2));
$ret .= $this->end('tr'); $ret .= $this->end('tr');
$ret .= $this->start('tr'); $ret .= $this->start('tr');
$ret .= $this->element('th', 'Inline content'); $ret .= $this->element('th', 'Inline content');
$ret .= $this->element('td', $def->descendants_are_inline ? 'Yes' : 'No'); $ret .= $this->element('td', $def->descendants_are_inline ? 'Yes' : 'No');
$ret .= $this->end('tr'); $ret .= $this->end('tr');
if (!empty($def->excludes)) { if (!empty($def->excludes)) {
$ret .= $this->start('tr'); $ret .= $this->start('tr');
$ret .= $this->element('th', 'Excludes'); $ret .= $this->element('th', 'Excludes');
$ret .= $this->element('td', $this->listifyTagLookup($def->excludes)); $ret .= $this->element('td', $this->listifyTagLookup($def->excludes));
$ret .= $this->end('tr'); $ret .= $this->end('tr');
} }
if (!empty($def->attr_transform_pre)) { if (!empty($def->attr_transform_pre)) {
$ret .= $this->start('tr'); $ret .= $this->start('tr');
$ret .= $this->element('th', 'Pre-AttrTransform'); $ret .= $this->element('th', 'Pre-AttrTransform');
$ret .= $this->element('td', $this->listifyObjectList($def->attr_transform_pre)); $ret .= $this->element('td', $this->listifyObjectList($def->attr_transform_pre));
$ret .= $this->end('tr'); $ret .= $this->end('tr');
} }
if (!empty($def->attr_transform_post)) { if (!empty($def->attr_transform_post)) {
$ret .= $this->start('tr'); $ret .= $this->start('tr');
$ret .= $this->element('th', 'Post-AttrTransform'); $ret .= $this->element('th', 'Post-AttrTransform');
$ret .= $this->element('td', $this->listifyObjectList($def->attr_transform_post)); $ret .= $this->element('td', $this->listifyObjectList($def->attr_transform_post));
$ret .= $this->end('tr'); $ret .= $this->end('tr');
} }
if (!empty($def->auto_close)) { if (!empty($def->auto_close)) {
$ret .= $this->start('tr'); $ret .= $this->start('tr');
$ret .= $this->element('th', 'Auto closed by'); $ret .= $this->element('th', 'Auto closed by');
$ret .= $this->element('td', $this->listifyTagLookup($def->auto_close)); $ret .= $this->element('td', $this->listifyTagLookup($def->auto_close));
$ret .= $this->end('tr'); $ret .= $this->end('tr');
} }
$ret .= $this->start('tr'); $ret .= $this->start('tr');
$ret .= $this->element('th', 'Allowed attributes'); $ret .= $this->element('th', 'Allowed attributes');
$ret .= $this->element('td', $this->listifyAttr($def->attr), array(), 0); $ret .= $this->element('td', $this->listifyAttr($def->attr), array(), 0);
$ret .= $this->end('tr'); $ret .= $this->end('tr');
if (!empty($def->required_attr)) { if (!empty($def->required_attr)) {
$ret .= $this->row('Required attributes', $this->listify($def->required_attr)); $ret .= $this->row('Required attributes', $this->listify($def->required_attr));
} }
$ret .= $this->renderChildren($def->child); $ret .= $this->renderChildren($def->child);
} }
$ret .= $this->end('table'); $ret .= $this->end('table');
return $ret; return $ret;
} }
/** /**
* Renders a row describing the allowed children of an element * Renders a row describing the allowed children of an element
* @param HTMLPurifier_ChildDef $def HTMLPurifier_ChildDef of pertinent element * @param HTMLPurifier_ChildDef $def HTMLPurifier_ChildDef of pertinent element
* @return string * @return string
*/ */
protected function renderChildren($def) protected function renderChildren($def)
{ {
$context = new HTMLPurifier_Context(); $context = new HTMLPurifier_Context();
$ret = ''; $ret = '';
$ret .= $this->start('tr'); $ret .= $this->start('tr');
$elements = array(); $elements = array();
$attr = array(); $attr = array();
if (isset($def->elements)) { if (isset($def->elements)) {
if ($def->type == 'strictblockquote') { if ($def->type == 'strictblockquote') {
$def->validateChildren(array(), $this->config, $context); $def->validateChildren(array(), $this->config, $context);
} }
$elements = $def->elements; $elements = $def->elements;
} }
if ($def->type == 'chameleon') { if ($def->type == 'chameleon') {
$attr['rowspan'] = 2; $attr['rowspan'] = 2;
} elseif ($def->type == 'empty') { } elseif ($def->type == 'empty') {
$elements = array(); $elements = array();
} elseif ($def->type == 'table') { } elseif ($def->type == 'table') {
$elements = array_flip( $elements = array_flip(
array( array(
'col', 'col',
'caption', 'caption',
'colgroup', 'colgroup',
'thead', 'thead',
'tfoot', 'tfoot',
'tbody', 'tbody',
'tr' 'tr'
) )
); );
} }
$ret .= $this->element('th', 'Allowed children', $attr); $ret .= $this->element('th', 'Allowed children', $attr);
if ($def->type == 'chameleon') { if ($def->type == 'chameleon') {
$ret .= $this->element( $ret .= $this->element(
'td', 'td',
'<em>Block</em>: ' . '<em>Block</em>: ' .
$this->escape($this->listifyTagLookup($def->block->elements)), $this->escape($this->listifyTagLookup($def->block->elements)),
null, null,
0 0
); );
$ret .= $this->end('tr'); $ret .= $this->end('tr');
$ret .= $this->start('tr'); $ret .= $this->start('tr');
$ret .= $this->element( $ret .= $this->element(
'td', 'td',
'<em>Inline</em>: ' . '<em>Inline</em>: ' .
$this->escape($this->listifyTagLookup($def->inline->elements)), $this->escape($this->listifyTagLookup($def->inline->elements)),
null, null,
0 0
); );
} elseif ($def->type == 'custom') { } elseif ($def->type == 'custom') {
$ret .= $this->element( $ret .= $this->element(
'td', 'td',
'<em>' . ucfirst($def->type) . '</em>: ' . '<em>' . ucfirst($def->type) . '</em>: ' .
$def->dtd_regex $def->dtd_regex
); );
} else { } else {
$ret .= $this->element( $ret .= $this->element(
'td', 'td',
'<em>' . ucfirst($def->type) . '</em>: ' . '<em>' . ucfirst($def->type) . '</em>: ' .
$this->escape($this->listifyTagLookup($elements)), $this->escape($this->listifyTagLookup($elements)),
null, null,
0 0
); );
} }
$ret .= $this->end('tr'); $ret .= $this->end('tr');
return $ret; return $ret;
} }
/** /**
* Listifies a tag lookup table. * Listifies a tag lookup table.
* @param array $array Tag lookup array in form of array('tagname' => true) * @param array $array Tag lookup array in form of array('tagname' => true)
* @return string * @return string
*/ */
protected function listifyTagLookup($array) protected function listifyTagLookup($array)
{ {
ksort($array); ksort($array);
$list = array(); $list = array();
foreach ($array as $name => $discard) { foreach ($array as $name => $discard) {
if ($name !== '#PCDATA' && !isset($this->def->info[$name])) { if ($name !== '#PCDATA' && !isset($this->def->info[$name])) {
continue; continue;
} }
$list[] = $name; $list[] = $name;
} }
return $this->listify($list); return $this->listify($list);
} }
/** /**
* Listifies a list of objects by retrieving class names and internal state * Listifies a list of objects by retrieving class names and internal state
* @param array $array List of objects * @param array $array List of objects
* @return string * @return string
* @todo Also add information about internal state * @todo Also add information about internal state
*/ */
protected function listifyObjectList($array) protected function listifyObjectList($array)
{ {
ksort($array); ksort($array);
$list = array(); $list = array();
foreach ($array as $obj) { foreach ($array as $obj) {
$list[] = $this->getClass($obj, 'AttrTransform_'); $list[] = $this->getClass($obj, 'AttrTransform_');
} }
return $this->listify($list); return $this->listify($list);
} }
/** /**
* Listifies a hash of attributes to AttrDef classes * Listifies a hash of attributes to AttrDef classes
* @param array $array Array hash in form of array('attrname' => HTMLPurifier_AttrDef) * @param array $array Array hash in form of array('attrname' => HTMLPurifier_AttrDef)
* @return string * @return string
*/ */
protected function listifyAttr($array) protected function listifyAttr($array)
{ {
ksort($array); ksort($array);
$list = array(); $list = array();
foreach ($array as $name => $obj) { foreach ($array as $name => $obj) {
if ($obj === false) { if ($obj === false) {
continue; continue;
} }
$list[] = "$name&nbsp;=&nbsp;<i>" . $this->getClass($obj, 'AttrDef_') . '</i>'; $list[] = "$name&nbsp;=&nbsp;<i>" . $this->getClass($obj, 'AttrDef_') . '</i>';
} }
return $this->listify($list); return $this->listify($list);
} }
/** /**
* Creates a heavy header row * Creates a heavy header row
* @param string $text * @param string $text
* @param int $num * @param int $num
* @return string * @return string
*/ */
protected function heavyHeader($text, $num = 1) protected function heavyHeader($text, $num = 1)
{ {
$ret = ''; $ret = '';
$ret .= $this->start('tr'); $ret .= $this->start('tr');
$ret .= $this->element('th', $text, array('colspan' => $num, 'class' => 'heavy')); $ret .= $this->element('th', $text, array('colspan' => $num, 'class' => 'heavy'));
$ret .= $this->end('tr'); $ret .= $this->end('tr');
return $ret; return $ret;
} }
} }
// vim: et sw=4 sts=4 // vim: et sw=4 sts=4
+12
View File
@@ -1,8 +1,12 @@
<?php <?php
include_once('./_common.php'); include_once('./_common.php');
require_once (dirname(__FILE__) .'/libs/KISA_SEED_CBC.php');
require_once (dirname(__FILE__) .'/libs/INILib.php');
$txId = isset($_POST['txId']) ? clean_xss_tags($_POST['txId'], 1, 1) : ''; $txId = isset($_POST['txId']) ? clean_xss_tags($_POST['txId'], 1, 1) : '';
$mid = substr($txId, 6, 10); $mid = substr($txId, 6, 10);
$SEEDKEY = isset($_POST['token']) ? clean_xss_tags($_POST['token'], 1, 1) : '';
$SEEDIV = 'SASHOSTSIRIAS000';
if ($txId && isset($_POST["resultCode"]) && $_POST["resultCode"] === "0000") { if ($txId && isset($_POST["resultCode"]) && $_POST["resultCode"] === "0000") {
@@ -41,6 +45,14 @@ if ($txId && isset($_POST["resultCode"]) && $_POST["resultCode"] === "0000") {
$birth_day = $res_data['userBirthday']; // 생년월일 $birth_day = $res_data['userBirthday']; // 생년월일
$ci = $res_data['userCi']; // CI $ci = $res_data['userCi']; // CI
if (defined('KGINICIS_USE_CERT_SEED') && KGINICIS_USE_CERT_SEED) {
// 개인정보SEED 암호화 된것을 복호화 합니다.
$user_name = decrypt_SEED($user_name, $SEEDKEY, $SEEDIV);
$phone_no = decrypt_SEED($phone_no, $SEEDKEY, $SEEDIV);
$birth_day = decrypt_SEED($birth_day, $SEEDKEY, $SEEDIV);
$ci = decrypt_SEED($ci, $SEEDKEY, $SEEDIV);
}
@insert_cert_history($member['mb_id'], 'inicis', $cert_type); // 인증성공 시 내역 기록 @insert_cert_history($member['mb_id'], 'inicis', $cert_type); // 인증성공 시 내역 기록
if(!$phone_no) if(!$phone_no)
+7 -4
View File
@@ -9,14 +9,16 @@ if(empty($max_cr_id)) $max_cr_id = 0;
if($config['cf_cert_use'] == 2) { // 실서비스 일때 if($config['cf_cert_use'] == 2) { // 실서비스 일때
$mid = 'SRA'.$config['cf_cert_kg_mid']; // 부여받은 MID(상점ID) 입력(영업담당자 문의) $mid = 'SRA'.$config['cf_cert_kg_mid']; // 부여받은 MID(상점ID) 입력(영업담당자 문의)
$apiKey = $config['cf_cert_kg_cd']; // 부여받은 MID 에 대한 apiKey $apiKey = $config['cf_cert_kg_cd']; // 부여받은 MID 에 대한 apiKey
$mTxId ='SIR_'.$max_cr_id; $mTxId ='SIR_'.substr($max_cr_id.'_'.round(microtime(true) * 1000), 0, 16);
certify_count_check($member['mb_id'], 'simple'); // 금일 인증시도 횟수 체크 certify_count_check($member['mb_id'], 'simple'); // 금일 인증시도 횟수 체크
} else { // 테스트 일때 } else { // 테스트 일때
$mid = "SRAiasTest"; $mid = "SRAiasTest";
$apiKey = "43700dfd4c795fe9550853aef3b6aaf1"; $apiKey = "43700dfd4c795fe9550853aef3b6aaf1";
$mTxId ='SIR_'.$max_cr_id; $mTxId ='SIR_'.substr($max_cr_id.'_'.round(microtime(true) * 1000), 0, 16);
} }
$reqSvcCd ='01';
$reqSvcCd ='01'; // 요청구분코드 ["01":간편인증, "02":전자서명]
$reservedMsg = (defined('KGINICIS_USE_CERT_SEED') && KGINICIS_USE_CERT_SEED) ? 'isUseToken=Y' : ''; // 결과조회 응답시 개인정보SEED 암호화 처리 요청
// 등록가맹점 확인 // 등록가맹점 확인
$plainText1 = hash("sha256",(string)$mid.(string)$mTxId.(string)$apiKey); $plainText1 = hash("sha256",(string)$mid.(string)$mTxId.(string)$apiKey);
@@ -66,7 +68,8 @@ include_once(G5_PATH.'/head.sub.php');
<input type="hidden" name="userPhone" value="<?php echo $userPhone ?>"> <input type="hidden" name="userPhone" value="<?php echo $userPhone ?>">
<input type="hidden" name="userBirth" value="<?php echo $userBirth ?>"> <input type="hidden" name="userBirth" value="<?php echo $userBirth ?>">
<input type="hidden" name="userHash" value="<?php echo $userHash ?>"> <input type="hidden" name="userHash" value="<?php echo $userHash ?>">
<input type="hidden" name="mbId" value="<?php echo $member['mb_id'] ?>"> <input type="hidden" name="reservedMsg" value="<?php echo $reservedMsg; ?>">
<input type="hidden" name="mbId" value="<?php echo $member['mb_id']; ?>">
<input type="hidden" name="directAgency" value="<?php echo isset($_GET['directAgency']) ? clean_xss_tags($_GET['directAgency'], 1, 1) : ''; ?>"> <input type="hidden" name="directAgency" value="<?php echo isset($_GET['directAgency']) ? clean_xss_tags($_GET['directAgency'], 1, 1) : ''; ?>">
<input type="hidden" name="successUrl" value="<?php echo $resultUrl; ?>"> <!-- 필수 값 --> <input type="hidden" name="successUrl" value="<?php echo $resultUrl; ?>"> <!-- 필수 값 -->
+20 -1
View File
@@ -1,8 +1,12 @@
<?php <?php
include_once('./_common.php'); include_once('./_common.php');
require_once (dirname(__FILE__) .'/libs/KISA_SEED_CBC.php');
require_once (dirname(__FILE__) .'/libs/INILib.php');
$txId = isset($_POST['txId']) ? clean_xss_tags($_POST['txId'], 1, 1) : ''; $txId = isset($_POST['txId']) ? clean_xss_tags($_POST['txId'], 1, 1) : '';
$mid = substr($txId, 6, 10); $mid = substr($txId, 6, 10);
$SEEDKEY = isset($_POST['token']) ? clean_xss_tags($_POST['token'], 1, 1) : '';
$SEEDIV = 'SASHOSTSIRIAS000';
if ($txId && isset($_POST["resultCode"]) && $_POST["resultCode"] === "0000") { if ($txId && isset($_POST["resultCode"]) && $_POST["resultCode"] === "0000") {
@@ -14,8 +18,15 @@ if ($txId && isset($_POST["resultCode"]) && $_POST["resultCode"] === "0000") {
$post_data = json_encode($data); $post_data = json_encode($data);
$authRequestUrl = isset($_POST["authRequestUrl"]) ? is_inicis_url_return($_POST["authRequestUrl"]) : ''; $authRequestUrl = isset($_POST["authRequestUrl"]) ? is_inicis_url_return($_POST["authRequestUrl"]) : '';
if(!$authRequestUrl){
// SaSample 에 나와있는대로 url을 검증합니다.
if (!(strpos($authRequestUrl,"https://kssa.inicis.com") == 0 || strpos($authRequestUrl,"https://fcsa.inicis.com") == 0)) {
$authRequestUrl = '';
}
if (! $authRequestUrl) {
alert('잘못된 요청입니다.', G5_URL); alert('잘못된 요청입니다.', G5_URL);
exit;
} }
// curl 통신 시작 // curl 통신 시작
@@ -42,6 +53,14 @@ if ($txId && isset($_POST["resultCode"]) && $_POST["resultCode"] === "0000") {
$user_name = $res_data['userName']; // 이름 $user_name = $res_data['userName']; // 이름
$birth_day = $res_data['userBirthday']; // 생년월일 $birth_day = $res_data['userBirthday']; // 생년월일
$ci = $res_data['userCi']; // CI $ci = $res_data['userCi']; // CI
if (defined('KGINICIS_USE_CERT_SEED') && KGINICIS_USE_CERT_SEED) {
// 개인정보SEED 암호화 된것을 복호화 합니다.
$user_name = decrypt_SEED($user_name, $SEEDKEY, $SEEDIV);
$phone_no = decrypt_SEED($phone_no, $SEEDKEY, $SEEDIV);
$birth_day = decrypt_SEED($birth_day, $SEEDKEY, $SEEDIV);
$ci = decrypt_SEED($ci, $SEEDKEY, $SEEDIV);
}
@insert_cert_history($member['mb_id'], 'inicis', $cert_type); // 인증성공 시 내역 기록 @insert_cert_history($member['mb_id'], 'inicis', $cert_type); // 인증성공 시 내역 기록
+78
View File
@@ -0,0 +1,78 @@
<?php
function String2Hex($string) {
$hex = array();
for ($i = 0; $i < strlen($string); $i++) {
$hex[] = dechex(ord($string[$i]));
}
return $hex;
}
function Hex2String($hex) {
$str = "";
for ($i = 0; $i < count($hex); $i++) {
$str .= chr(hexdec($hex[$i]));
}
return $str;
}
function encrypt_SEED($str, $bszUser_key, $bszIV) {
$planBytes = String2Hex($str);
$keyBytes = String2Hex(base64_decode($bszUser_key));
$IVBytes = String2Hex(($bszIV));
for ($i = 0; $i < 16; $i++) {
$keyBytes[$i] = hexdec(($keyBytes[$i]));
$IVBytes[$i] = hexdec(($IVBytes[$i]));
}
for ($i = 0; $i < count($planBytes); $i++) {
$planBytes[$i] = hexdec($planBytes[$i]);
}
if (count($planBytes) == 0) {
return $str;
}
$ret = null;
$bszChiperText = null;
$pdwRoundKey = array_pad(array(), 32, 0);
$bszChiperText = KISA_SEED_CBC::SEED_CBC_Encrypt($keyBytes, $IVBytes, $planBytes, 0, count($planBytes));
$r = count($bszChiperText);
for ($i = 0; $i < $r; $i++) {
$ret[] = sprintf("%02X", $bszChiperText[$i]);
}
return base64_encode(Hex2String($ret));
}
function decrypt_SEED($str, $bszUser_key, $bszIV) {
$planBytes = String2Hex(base64_decode($str));
$keyBytes = String2Hex(base64_decode($bszUser_key));
$IVBytes = String2Hex(($bszIV));
for ($i = 0; $i < 16; $i++) {
$keyBytes[$i] = hexdec(($keyBytes[$i]));
$IVBytes[$i] = hexdec(($IVBytes[$i]));
}
for ($i = 0; $i < count($planBytes); $i++) {
$planBytes[$i] = hexdec($planBytes[$i]);
}
if (count($planBytes) == 0) {
return $str;
}
$pdwRoundKey = array_pad(array(), 32, 0);
$bszPlainText = null;
$planBytresMessage = array();
// 방법 1
$bszPlainText = KISA_SEED_CBC::SEED_CBC_Decrypt($keyBytes, $IVBytes, $planBytes, 0, count($planBytes));
for ($i = 0; $i < sizeof((array) $bszPlainText); $i++) {
$planBytresMessage[] = sprintf("%02X", $bszPlainText[$i]);
}
return Hex2String($planBytresMessage);
}
+822
View File
@@ -0,0 +1,822 @@
<?php
/*
@file KISA_SEED_CBC.php
@brief SEED CBC 암호 알고리즘
@author Copyright (c) 2013 by KISA
@remarks http://seed.kisa.or.kr/
*/
if (!defined('_KISA_COMMON_LIB')) {
define('_KISA_COMMON_LIB', 1);
function isLittleEndian() {
$testint = 0x00FF;
$p = pack('S', $testint);
return $testint === current(unpack('v', $p));
}
$_kisa_common_is_little_endian = isLittleEndian();
if (!defined('_KISA_COMMON_IS_LITTLE_ENDIAN')) {
define('_KISA_COMMON_IS_LITTLE_ENDIAN', $_kisa_common_is_little_endian);
}
class Common {
static function arraycopy(&$dst, &$src, $length) {
for ($i = 0; $i < $length; $i++) {
$dst[$i] = $src[$i];
}
}
static function arraycopy_offset(&$dst, $dst_offset, &$src, $src_offset, $length) {
for ($i = 0; $i < $length; $i++) {
$dst[$dst_offset + $i] = $src[$src_offset + $i];
}
}
static function arraycopy_system(&$src, $src_offset, &$dst, $dst_offset, $length) {
for ($i = 0; $i < $length; $i++) {
$dst[$dst_offset + $i] = $src[$src_offset + $i];
}
}
static function arrayinit(&$dst, $value, $length) {
for ($i = 0; $i < $length; $i++) {
$dst[$i] = $value;
}
}
static function arrayinit_offset(&$dst, $dst_offset, $value, $length) {
for ($i = 0; $i < $length; $i++) {
$dst[$dst_offset + $i] = $value;
}
}
static function memcpy_byte2int(&$dst, &$src, $length) {
$iLen = (int) ($length / 4);
for ($i = 0; $i < $iLen; $i++) {
Common::byte_to_int($dst, $i, $src, $i * 4);
}
}
static function memcpy_int2int(&$dst, &$src, $src_offset, $length) {
$iLen = (int) ($length / 4);
for ($i = 0; $i < $iLen; $i++) {
$dst[$i] = $src[$src_offset + $i];
}
}
static function set_byte_for_int(&$dst, $b_offset, $value) {
if (_KISA_COMMON_IS_LITTLE_ENDIAN == true) {
$shift_value = (3 - $b_offset % 4) * 8;
$mask_value = 0x0ff << $shift_value;
$mask_value2 = ~$mask_value;
$value2 = ($value & 0x0ff) << $shift_value;
$dst[(int) ($b_offset / 4)] = ($dst[(int) ($b_offset / 4)] & $mask_value2) | ($value2 & $mask_value);
} else {
$shift_value = ($b_offset % 4) * 8;
$mask_value = 0x0ff << $shift_value;
$mask_value2 = ~$mask_value;
$value2 = ($value & 0x0ff) << $shift_value;
$dst[(int) ($b_offset / 4)] = ($dst[(int) ($b_offset / 4)] & $mask_value2) | ($value2 & $mask_value);
}
}
static function get_byte_for_int(&$src, $b_offset) {
if (_KISA_COMMON_IS_LITTLE_ENDIAN == true) {
$shift_value = (3 - $b_offset % 4) * 8;
$mask_value = 0x0ff << $shift_value;
$value = ($src[(int) ($b_offset / 4)] & $mask_value) >> $shift_value;
return $value & 0x0ff;
} else {
$shift_value = ($b_offset % 4) * 8;
$mask_value = 0x0ff << $shift_value;
$value = ($src[(int) ($b_offset / 4)] & $mask_value) >> $shift_value;
return $value & 0x0ff;
}
}
static function byte_to_int(&$dst, $dst_offset, &$src, $src_offset) {
if (_KISA_COMMON_IS_LITTLE_ENDIAN == true) {
$dst[$dst_offset] = ((0x0ff & $src[$src_offset]) << 24) | ((0x0ff & $src[$src_offset + 1]) << 16) | ((0x0ff & $src[$src_offset + 2]) << 8) | ((0x0ff & $src[$src_offset + 3]));
} else {
$dst[$dst_offset] = ((0x0ff & $src[$src_offset])) | ((0x0ff & $src[$src_offset + 1]) << 8) | ((0x0ff & $src[$src_offset + 2]) << 16) | ((0x0ff & $src[$src_offset + 3]) << 24);
}
}
static function get_byte_to_int(&$src, $src_offset) {
if (_KISA_COMMON_IS_LITTLE_ENDIAN == true) {
return ((0x0ff & $src[$src_offset]) << 24) | ((0x0ff & $src[$src_offset + 1]) << 16) | ((0x0ff & $src[$src_offset + 2]) << 8) | ((0x0ff & $src[$src_offset + 3]));
} else {
return ((0x0ff & $src[$src_offset])) | ((0x0ff & $src[$src_offset + 1]) << 8) | ((0x0ff & $src[$src_offset + 2]) << 16) | ((0x0ff & $src[$src_offset + 3]) << 24);
}
}
static function int_to_byte(&$dst, $dst_offset, &$src, $src_offset) {
Common::int_to_byte_unit($dst, $dst_offset, $src[$src_offset]);
}
static function int_to_byte_unit(&$dst, $dst_offset, $src) {
if (_KISA_COMMON_IS_LITTLE_ENDIAN == true) {
$dst[$dst_offset] = (($src >> 24) & 0x0ff);
$dst[$dst_offset + 1] = (($src >> 16) & 0x0ff);
$dst[$dst_offset + 2] = (($src >> 8) & 0x0ff);
$dst[$dst_offset + 3] = (($src) & 0x0ff);
} else {
$dst[$dst_offset] = (($src) & 0x0ff);
$dst[$dst_offset + 1] = (($src >> 8) & 0x0ff);
$dst[$dst_offset + 2] = (($src >> 16) & 0x0ff);
$dst[$dst_offset + 3] = (($src >> 24) & 0x0ff);
}
}
static function URShift($x, $n) {
if ($n == 0)
return $x;
if ($n >= 32)
return 0;
$v = $x >> $n;
$v_mask = ~(0x80000000 >> ($n - 1));
return $v & $v_mask;
}
static function intToUnsigned($x) {
if ($x >= 0)
return $x;
return $x + pow(2, 32);
}
}
}
if (!defined('_KISA_ENC_DEC_')) {
define('_KISA_ENC_DEC_', '1');
class KISA_ENC_DEC {
const KISA_DECRYPT = 0;
const KISA_ENCRYPT = 1;
}
}
if (!defined('_KISA_SEED_KEY_')) {
define('_KISA_SEED_KEY_', '1');
class KISA_SEED_KEY {
var $key_data = null;
function __construct() {
$this->key_data = array_pad(array(), 32, 0);
}
}
}
if (!defined('_KISA_SEED_INFO_')) {
define('_KISA_SEED_INFO_', '1');
class KISA_SEED_INFO {
var $encrypt = 0;
var $ivec = null;
var $seed_key = null;
var $cbc_buffer = null;
var $buffer_length = 0;
var $cbc_last_block = null;
var $last_block_flag = 0;
function __construct() {
$this->ivec = array_pad(array(), 4, 0);
$this->seed_key = new KISA_SEED_KEY();
$this->cbc_buffer = array_pad(array(), 4, 0);
$this->cbc_last_block = array_pad(array(), 4, 0);
}
}
}
if (!defined('_KISA_LR_VAR')) {
define('LR_L0', 0);
define('LR_L1', 1);
define('LR_R0', 2);
define('LR_R1', 3);
}
class KISA_SEED_CBC {
static $SS0 = array(
0x02989a1a8, 0x005858184, 0x016c6d2d4, 0x013c3d3d0, 0x014445054, 0x01d0d111c, 0x02c8ca0ac, 0x025052124,
0x01d4d515c, 0x003434340, 0x018081018, 0x01e0e121c, 0x011415150, 0x03cccf0fc, 0x00acac2c8, 0x023436360,
0x028082028, 0x004444044, 0x020002020, 0x01d8d919c, 0x020c0e0e0, 0x022c2e2e0, 0x008c8c0c8, 0x017071314,
0x02585a1a4, 0x00f8f838c, 0x003030300, 0x03b4b7378, 0x03b8bb3b8, 0x013031310, 0x012c2d2d0, 0x02ecee2ec,
0x030407070, 0x00c8c808c, 0x03f0f333c, 0x02888a0a8, 0x032023230, 0x01dcdd1dc, 0x036c6f2f4, 0x034447074,
0x02ccce0ec, 0x015859194, 0x00b0b0308, 0x017475354, 0x01c4c505c, 0x01b4b5358, 0x03d8db1bc, 0x001010100,
0x024042024, 0x01c0c101c, 0x033437370, 0x018889098, 0x010001010, 0x00cccc0cc, 0x032c2f2f0, 0x019c9d1d8,
0x02c0c202c, 0x027c7e3e4, 0x032427270, 0x003838380, 0x01b8b9398, 0x011c1d1d0, 0x006868284, 0x009c9c1c8,
0x020406060, 0x010405050, 0x02383a3a0, 0x02bcbe3e8, 0x00d0d010c, 0x03686b2b4, 0x01e8e929c, 0x00f4f434c,
0x03787b3b4, 0x01a4a5258, 0x006c6c2c4, 0x038487078, 0x02686a2a4, 0x012021210, 0x02f8fa3ac, 0x015c5d1d4,
0x021416160, 0x003c3c3c0, 0x03484b0b4, 0x001414140, 0x012425250, 0x03d4d717c, 0x00d8d818c, 0x008080008,
0x01f0f131c, 0x019899198, 0x000000000, 0x019091118, 0x004040004, 0x013435350, 0x037c7f3f4, 0x021c1e1e0,
0x03dcdf1fc, 0x036467274, 0x02f0f232c, 0x027072324, 0x03080b0b0, 0x00b8b8388, 0x00e0e020c, 0x02b8ba3a8,
0x02282a2a0, 0x02e4e626c, 0x013839390, 0x00d4d414c, 0x029496168, 0x03c4c707c, 0x009090108, 0x00a0a0208,
0x03f8fb3bc, 0x02fcfe3ec, 0x033c3f3f0, 0x005c5c1c4, 0x007878384, 0x014041014, 0x03ecef2fc, 0x024446064,
0x01eced2dc, 0x02e0e222c, 0x00b4b4348, 0x01a0a1218, 0x006060204, 0x021012120, 0x02b4b6368, 0x026466264,
0x002020200, 0x035c5f1f4, 0x012829290, 0x00a8a8288, 0x00c0c000c, 0x03383b3b0, 0x03e4e727c, 0x010c0d0d0,
0x03a4a7278, 0x007474344, 0x016869294, 0x025c5e1e4, 0x026062224, 0x000808080, 0x02d8da1ac, 0x01fcfd3dc,
0x02181a1a0, 0x030003030, 0x037073334, 0x02e8ea2ac, 0x036063234, 0x015051114, 0x022022220, 0x038083038,
0x034c4f0f4, 0x02787a3a4, 0x005454144, 0x00c4c404c, 0x001818180, 0x029c9e1e8, 0x004848084, 0x017879394,
0x035053134, 0x00bcbc3c8, 0x00ecec2cc, 0x03c0c303c, 0x031417170, 0x011011110, 0x007c7c3c4, 0x009898188,
0x035457174, 0x03bcbf3f8, 0x01acad2d8, 0x038c8f0f8, 0x014849094, 0x019495158, 0x002828280, 0x004c4c0c4,
0x03fcff3fc, 0x009494148, 0x039093138, 0x027476364, 0x000c0c0c0, 0x00fcfc3cc, 0x017c7d3d4, 0x03888b0b8,
0x00f0f030c, 0x00e8e828c, 0x002424240, 0x023032320, 0x011819190, 0x02c4c606c, 0x01bcbd3d8, 0x02484a0a4,
0x034043034, 0x031c1f1f0, 0x008484048, 0x002c2c2c0, 0x02f4f636c, 0x03d0d313c, 0x02d0d212c, 0x000404040,
0x03e8eb2bc, 0x03e0e323c, 0x03c8cb0bc, 0x001c1c1c0, 0x02a8aa2a8, 0x03a8ab2b8, 0x00e4e424c, 0x015455154,
0x03b0b3338, 0x01cccd0dc, 0x028486068, 0x03f4f737c, 0x01c8c909c, 0x018c8d0d8, 0x00a4a4248, 0x016465254,
0x037477374, 0x02080a0a0, 0x02dcde1ec, 0x006464244, 0x03585b1b4, 0x02b0b2328, 0x025456164, 0x03acaf2f8,
0x023c3e3e0, 0x03989b1b8, 0x03181b1b0, 0x01f8f939c, 0x01e4e525c, 0x039c9f1f8, 0x026c6e2e4, 0x03282b2b0,
0x031013130, 0x02acae2e8, 0x02d4d616c, 0x01f4f535c, 0x024c4e0e4, 0x030c0f0f0, 0x00dcdc1cc, 0x008888088,
0x016061214, 0x03a0a3238, 0x018485058, 0x014c4d0d4, 0x022426260, 0x029092128, 0x007070304, 0x033033330,
0x028c8e0e8, 0x01b0b1318, 0x005050104, 0x039497178, 0x010809090, 0x02a4a6268, 0x02a0a2228, 0x01a8a9298
);
static $SS1 = array(
0x038380830, 0x0e828c8e0, 0x02c2d0d21, 0x0a42686a2, 0x0cc0fcfc3, 0x0dc1eced2, 0x0b03383b3, 0x0b83888b0,
0x0ac2f8fa3, 0x060204060, 0x054154551, 0x0c407c7c3, 0x044044440, 0x06c2f4f63, 0x0682b4b63, 0x0581b4b53,
0x0c003c3c3, 0x060224262, 0x030330333, 0x0b43585b1, 0x028290921, 0x0a02080a0, 0x0e022c2e2, 0x0a42787a3,
0x0d013c3d3, 0x090118191, 0x010110111, 0x004060602, 0x01c1c0c10, 0x0bc3c8cb0, 0x034360632, 0x0480b4b43,
0x0ec2fcfe3, 0x088088880, 0x06c2c4c60, 0x0a82888a0, 0x014170713, 0x0c404c4c0, 0x014160612, 0x0f434c4f0,
0x0c002c2c2, 0x044054541, 0x0e021c1e1, 0x0d416c6d2, 0x03c3f0f33, 0x03c3d0d31, 0x08c0e8e82, 0x098188890,
0x028280820, 0x04c0e4e42, 0x0f436c6f2, 0x03c3e0e32, 0x0a42585a1, 0x0f839c9f1, 0x00c0d0d01, 0x0dc1fcfd3,
0x0d818c8d0, 0x0282b0b23, 0x064264662, 0x0783a4a72, 0x024270723, 0x02c2f0f23, 0x0f031c1f1, 0x070324272,
0x040024242, 0x0d414c4d0, 0x040014141, 0x0c000c0c0, 0x070334373, 0x064274763, 0x0ac2c8ca0, 0x0880b8b83,
0x0f437c7f3, 0x0ac2d8da1, 0x080008080, 0x01c1f0f13, 0x0c80acac2, 0x02c2c0c20, 0x0a82a8aa2, 0x034340430,
0x0d012c2d2, 0x0080b0b03, 0x0ec2ecee2, 0x0e829c9e1, 0x05c1d4d51, 0x094148490, 0x018180810, 0x0f838c8f0,
0x054174753, 0x0ac2e8ea2, 0x008080800, 0x0c405c5c1, 0x010130313, 0x0cc0dcdc1, 0x084068682, 0x0b83989b1,
0x0fc3fcff3, 0x07c3d4d71, 0x0c001c1c1, 0x030310131, 0x0f435c5f1, 0x0880a8a82, 0x0682a4a62, 0x0b03181b1,
0x0d011c1d1, 0x020200020, 0x0d417c7d3, 0x000020202, 0x020220222, 0x004040400, 0x068284860, 0x070314171,
0x004070703, 0x0d81bcbd3, 0x09c1d8d91, 0x098198991, 0x060214161, 0x0bc3e8eb2, 0x0e426c6e2, 0x058194951,
0x0dc1dcdd1, 0x050114151, 0x090108090, 0x0dc1cccd0, 0x0981a8a92, 0x0a02383a3, 0x0a82b8ba3, 0x0d010c0d0,
0x080018181, 0x00c0f0f03, 0x044074743, 0x0181a0a12, 0x0e023c3e3, 0x0ec2ccce0, 0x08c0d8d81, 0x0bc3f8fb3,
0x094168692, 0x0783b4b73, 0x05c1c4c50, 0x0a02282a2, 0x0a02181a1, 0x060234363, 0x020230323, 0x04c0d4d41,
0x0c808c8c0, 0x09c1e8e92, 0x09c1c8c90, 0x0383a0a32, 0x00c0c0c00, 0x02c2e0e22, 0x0b83a8ab2, 0x06c2e4e62,
0x09c1f8f93, 0x0581a4a52, 0x0f032c2f2, 0x090128292, 0x0f033c3f3, 0x048094941, 0x078384870, 0x0cc0cccc0,
0x014150511, 0x0f83bcbf3, 0x070304070, 0x074354571, 0x07c3f4f73, 0x034350531, 0x010100010, 0x000030303,
0x064244460, 0x06c2d4d61, 0x0c406c6c2, 0x074344470, 0x0d415c5d1, 0x0b43484b0, 0x0e82acae2, 0x008090901,
0x074364672, 0x018190911, 0x0fc3ecef2, 0x040004040, 0x010120212, 0x0e020c0e0, 0x0bc3d8db1, 0x004050501,
0x0f83acaf2, 0x000010101, 0x0f030c0f0, 0x0282a0a22, 0x05c1e4e52, 0x0a82989a1, 0x054164652, 0x040034343,
0x084058581, 0x014140410, 0x088098981, 0x0981b8b93, 0x0b03080b0, 0x0e425c5e1, 0x048084840, 0x078394971,
0x094178793, 0x0fc3cccf0, 0x01c1e0e12, 0x080028282, 0x020210121, 0x08c0c8c80, 0x0181b0b13, 0x05c1f4f53,
0x074374773, 0x054144450, 0x0b03282b2, 0x01c1d0d11, 0x024250521, 0x04c0f4f43, 0x000000000, 0x044064642,
0x0ec2dcde1, 0x058184850, 0x050124252, 0x0e82bcbe3, 0x07c3e4e72, 0x0d81acad2, 0x0c809c9c1, 0x0fc3dcdf1,
0x030300030, 0x094158591, 0x064254561, 0x03c3c0c30, 0x0b43686b2, 0x0e424c4e0, 0x0b83b8bb3, 0x07c3c4c70,
0x00c0e0e02, 0x050104050, 0x038390931, 0x024260622, 0x030320232, 0x084048480, 0x068294961, 0x090138393,
0x034370733, 0x0e427c7e3, 0x024240420, 0x0a42484a0, 0x0c80bcbc3, 0x050134353, 0x0080a0a02, 0x084078783,
0x0d819c9d1, 0x04c0c4c40, 0x080038383, 0x08c0f8f83, 0x0cc0ecec2, 0x0383b0b33, 0x0480a4a42, 0x0b43787b3
);
static $SS2 = array(
0x0a1a82989, 0x081840585, 0x0d2d416c6, 0x0d3d013c3, 0x050541444, 0x0111c1d0d, 0x0a0ac2c8c, 0x021242505,
0x0515c1d4d, 0x043400343, 0x010181808, 0x0121c1e0e, 0x051501141, 0x0f0fc3ccc, 0x0c2c80aca, 0x063602343,
0x020282808, 0x040440444, 0x020202000, 0x0919c1d8d, 0x0e0e020c0, 0x0e2e022c2, 0x0c0c808c8, 0x013141707,
0x0a1a42585, 0x0838c0f8f, 0x003000303, 0x073783b4b, 0x0b3b83b8b, 0x013101303, 0x0d2d012c2, 0x0e2ec2ece,
0x070703040, 0x0808c0c8c, 0x0333c3f0f, 0x0a0a82888, 0x032303202, 0x0d1dc1dcd, 0x0f2f436c6, 0x070743444,
0x0e0ec2ccc, 0x091941585, 0x003080b0b, 0x053541747, 0x0505c1c4c, 0x053581b4b, 0x0b1bc3d8d, 0x001000101,
0x020242404, 0x0101c1c0c, 0x073703343, 0x090981888, 0x010101000, 0x0c0cc0ccc, 0x0f2f032c2, 0x0d1d819c9,
0x0202c2c0c, 0x0e3e427c7, 0x072703242, 0x083800383, 0x093981b8b, 0x0d1d011c1, 0x082840686, 0x0c1c809c9,
0x060602040, 0x050501040, 0x0a3a02383, 0x0e3e82bcb, 0x0010c0d0d, 0x0b2b43686, 0x0929c1e8e, 0x0434c0f4f,
0x0b3b43787, 0x052581a4a, 0x0c2c406c6, 0x070783848, 0x0a2a42686, 0x012101202, 0x0a3ac2f8f, 0x0d1d415c5,
0x061602141, 0x0c3c003c3, 0x0b0b43484, 0x041400141, 0x052501242, 0x0717c3d4d, 0x0818c0d8d, 0x000080808,
0x0131c1f0f, 0x091981989, 0x000000000, 0x011181909, 0x000040404, 0x053501343, 0x0f3f437c7, 0x0e1e021c1,
0x0f1fc3dcd, 0x072743646, 0x0232c2f0f, 0x023242707, 0x0b0b03080, 0x083880b8b, 0x0020c0e0e, 0x0a3a82b8b,
0x0a2a02282, 0x0626c2e4e, 0x093901383, 0x0414c0d4d, 0x061682949, 0x0707c3c4c, 0x001080909, 0x002080a0a,
0x0b3bc3f8f, 0x0e3ec2fcf, 0x0f3f033c3, 0x0c1c405c5, 0x083840787, 0x010141404, 0x0f2fc3ece, 0x060642444,
0x0d2dc1ece, 0x0222c2e0e, 0x043480b4b, 0x012181a0a, 0x002040606, 0x021202101, 0x063682b4b, 0x062642646,
0x002000202, 0x0f1f435c5, 0x092901282, 0x082880a8a, 0x0000c0c0c, 0x0b3b03383, 0x0727c3e4e, 0x0d0d010c0,
0x072783a4a, 0x043440747, 0x092941686, 0x0e1e425c5, 0x022242606, 0x080800080, 0x0a1ac2d8d, 0x0d3dc1fcf,
0x0a1a02181, 0x030303000, 0x033343707, 0x0a2ac2e8e, 0x032343606, 0x011141505, 0x022202202, 0x030383808,
0x0f0f434c4, 0x0a3a42787, 0x041440545, 0x0404c0c4c, 0x081800181, 0x0e1e829c9, 0x080840484, 0x093941787,
0x031343505, 0x0c3c80bcb, 0x0c2cc0ece, 0x0303c3c0c, 0x071703141, 0x011101101, 0x0c3c407c7, 0x081880989,
0x071743545, 0x0f3f83bcb, 0x0d2d81aca, 0x0f0f838c8, 0x090941484, 0x051581949, 0x082800282, 0x0c0c404c4,
0x0f3fc3fcf, 0x041480949, 0x031383909, 0x063642747, 0x0c0c000c0, 0x0c3cc0fcf, 0x0d3d417c7, 0x0b0b83888,
0x0030c0f0f, 0x0828c0e8e, 0x042400242, 0x023202303, 0x091901181, 0x0606c2c4c, 0x0d3d81bcb, 0x0a0a42484,
0x030343404, 0x0f1f031c1, 0x040480848, 0x0c2c002c2, 0x0636c2f4f, 0x0313c3d0d, 0x0212c2d0d, 0x040400040,
0x0b2bc3e8e, 0x0323c3e0e, 0x0b0bc3c8c, 0x0c1c001c1, 0x0a2a82a8a, 0x0b2b83a8a, 0x0424c0e4e, 0x051541545,
0x033383b0b, 0x0d0dc1ccc, 0x060682848, 0x0737c3f4f, 0x0909c1c8c, 0x0d0d818c8, 0x042480a4a, 0x052541646,
0x073743747, 0x0a0a02080, 0x0e1ec2dcd, 0x042440646, 0x0b1b43585, 0x023282b0b, 0x061642545, 0x0f2f83aca,
0x0e3e023c3, 0x0b1b83989, 0x0b1b03181, 0x0939c1f8f, 0x0525c1e4e, 0x0f1f839c9, 0x0e2e426c6, 0x0b2b03282,
0x031303101, 0x0e2e82aca, 0x0616c2d4d, 0x0535c1f4f, 0x0e0e424c4, 0x0f0f030c0, 0x0c1cc0dcd, 0x080880888,
0x012141606, 0x032383a0a, 0x050581848, 0x0d0d414c4, 0x062602242, 0x021282909, 0x003040707, 0x033303303,
0x0e0e828c8, 0x013181b0b, 0x001040505, 0x071783949, 0x090901080, 0x062682a4a, 0x022282a0a, 0x092981a8a
);
static $SS3 = array(
0x008303838, 0x0c8e0e828, 0x00d212c2d, 0x086a2a426, 0x0cfc3cc0f, 0x0ced2dc1e, 0x083b3b033, 0x088b0b838,
0x08fa3ac2f, 0x040606020, 0x045515415, 0x0c7c3c407, 0x044404404, 0x04f636c2f, 0x04b63682b, 0x04b53581b,
0x0c3c3c003, 0x042626022, 0x003333033, 0x085b1b435, 0x009212829, 0x080a0a020, 0x0c2e2e022, 0x087a3a427,
0x0c3d3d013, 0x081919011, 0x001111011, 0x006020406, 0x00c101c1c, 0x08cb0bc3c, 0x006323436, 0x04b43480b,
0x0cfe3ec2f, 0x088808808, 0x04c606c2c, 0x088a0a828, 0x007131417, 0x0c4c0c404, 0x006121416, 0x0c4f0f434,
0x0c2c2c002, 0x045414405, 0x0c1e1e021, 0x0c6d2d416, 0x00f333c3f, 0x00d313c3d, 0x08e828c0e, 0x088909818,
0x008202828, 0x04e424c0e, 0x0c6f2f436, 0x00e323c3e, 0x085a1a425, 0x0c9f1f839, 0x00d010c0d, 0x0cfd3dc1f,
0x0c8d0d818, 0x00b23282b, 0x046626426, 0x04a72783a, 0x007232427, 0x00f232c2f, 0x0c1f1f031, 0x042727032,
0x042424002, 0x0c4d0d414, 0x041414001, 0x0c0c0c000, 0x043737033, 0x047636427, 0x08ca0ac2c, 0x08b83880b,
0x0c7f3f437, 0x08da1ac2d, 0x080808000, 0x00f131c1f, 0x0cac2c80a, 0x00c202c2c, 0x08aa2a82a, 0x004303434,
0x0c2d2d012, 0x00b03080b, 0x0cee2ec2e, 0x0c9e1e829, 0x04d515c1d, 0x084909414, 0x008101818, 0x0c8f0f838,
0x047535417, 0x08ea2ac2e, 0x008000808, 0x0c5c1c405, 0x003131013, 0x0cdc1cc0d, 0x086828406, 0x089b1b839,
0x0cff3fc3f, 0x04d717c3d, 0x0c1c1c001, 0x001313031, 0x0c5f1f435, 0x08a82880a, 0x04a62682a, 0x081b1b031,
0x0c1d1d011, 0x000202020, 0x0c7d3d417, 0x002020002, 0x002222022, 0x004000404, 0x048606828, 0x041717031,
0x007030407, 0x0cbd3d81b, 0x08d919c1d, 0x089919819, 0x041616021, 0x08eb2bc3e, 0x0c6e2e426, 0x049515819,
0x0cdd1dc1d, 0x041515011, 0x080909010, 0x0ccd0dc1c, 0x08a92981a, 0x083a3a023, 0x08ba3a82b, 0x0c0d0d010,
0x081818001, 0x00f030c0f, 0x047434407, 0x00a12181a, 0x0c3e3e023, 0x0cce0ec2c, 0x08d818c0d, 0x08fb3bc3f,
0x086929416, 0x04b73783b, 0x04c505c1c, 0x082a2a022, 0x081a1a021, 0x043636023, 0x003232023, 0x04d414c0d,
0x0c8c0c808, 0x08e929c1e, 0x08c909c1c, 0x00a32383a, 0x00c000c0c, 0x00e222c2e, 0x08ab2b83a, 0x04e626c2e,
0x08f939c1f, 0x04a52581a, 0x0c2f2f032, 0x082929012, 0x0c3f3f033, 0x049414809, 0x048707838, 0x0ccc0cc0c,
0x005111415, 0x0cbf3f83b, 0x040707030, 0x045717435, 0x04f737c3f, 0x005313435, 0x000101010, 0x003030003,
0x044606424, 0x04d616c2d, 0x0c6c2c406, 0x044707434, 0x0c5d1d415, 0x084b0b434, 0x0cae2e82a, 0x009010809,
0x046727436, 0x009111819, 0x0cef2fc3e, 0x040404000, 0x002121012, 0x0c0e0e020, 0x08db1bc3d, 0x005010405,
0x0caf2f83a, 0x001010001, 0x0c0f0f030, 0x00a22282a, 0x04e525c1e, 0x089a1a829, 0x046525416, 0x043434003,
0x085818405, 0x004101414, 0x089818809, 0x08b93981b, 0x080b0b030, 0x0c5e1e425, 0x048404808, 0x049717839,
0x087939417, 0x0ccf0fc3c, 0x00e121c1e, 0x082828002, 0x001212021, 0x08c808c0c, 0x00b13181b, 0x04f535c1f,
0x047737437, 0x044505414, 0x082b2b032, 0x00d111c1d, 0x005212425, 0x04f434c0f, 0x000000000, 0x046424406,
0x0cde1ec2d, 0x048505818, 0x042525012, 0x0cbe3e82b, 0x04e727c3e, 0x0cad2d81a, 0x0c9c1c809, 0x0cdf1fc3d,
0x000303030, 0x085919415, 0x045616425, 0x00c303c3c, 0x086b2b436, 0x0c4e0e424, 0x08bb3b83b, 0x04c707c3c,
0x00e020c0e, 0x040505010, 0x009313839, 0x006222426, 0x002323032, 0x084808404, 0x049616829, 0x083939013,
0x007333437, 0x0c7e3e427, 0x004202424, 0x084a0a424, 0x0cbc3c80b, 0x043535013, 0x00a02080a, 0x087838407,
0x0c9d1d819, 0x04c404c0c, 0x083838003, 0x08f838c0f, 0x0cec2cc0e, 0x00b33383b, 0x04a42480a, 0x087b3b437
);
const BLOCK_SIZE_SEED = 16;
const BLOCK_SIZE_SEED_INT = 4;
static function GetB0($A) {
return 0x000000ff & $A;
}
static function GetB1($A) {
return 0x000000ff & ( $A >> 8 );
}
static function GetB2($A) {
return 0x000000ff & ( $A >> 16 );
}
static function GetB3($A) {
return 0x000000ff & ( $A >> 24 );
}
static function Round(&$x, $i7, $i6, $i5, $i4, $i3, $i2, $i1, $i0, $key, $key_offset) {
$x[$i1] = ($x[$i1] + ((KISA_SEED_CBC::$F1[$x[$i0]] ^ $key[$key_offset + 0]) & 0x0ff)) & 0x0ff;
$x[$i3] = ($x[$i3] ^ ((KISA_SEED_CBC::$F0[$x[$i2]] + $key[$key_offset + 1]) & 0x0ff)) & 0x0ff;
$x[$i5] = ($x[$i5] + ((KISA_SEED_CBC::$F1[$x[$i4]] ^ $key[$key_offset + 2]) & 0x0ff)) & 0x0ff;
$x[$i7] = ($x[$i7] ^ ((KISA_SEED_CBC::$F0[$x[$i6]] + $key[$key_offset + 3]) & 0x0ff)) & 0x0ff;
}
static function SeedRound(&$T, &$LR, $L0, $L1, $R0, $R1, &$K, $K_offset) {
$T[0] = $LR[$R0] ^ $K[$K_offset + 0];
$T[1] = $LR[$R1] ^ $K[$K_offset + 1];
$T[1] ^= $T[0];
$T[1] = KISA_SEED_CBC::$SS0[KISA_SEED_CBC::GetB0($T[1]) & 0x0ff] ^ KISA_SEED_CBC::$SS1[KISA_SEED_CBC::GetB1($T[1]) & 0x0ff] ^
KISA_SEED_CBC::$SS2[KISA_SEED_CBC::GetB2($T[1]) & 0x0ff] ^ KISA_SEED_CBC::$SS3[KISA_SEED_CBC::GetB3($T[1]) & 0x0ff];
$T[0] = ($T[0] + $T[1]) & 0x0ffffffff;
$T[0] = KISA_SEED_CBC::$SS0[KISA_SEED_CBC::GetB0($T[0]) & 0x0ff] ^ KISA_SEED_CBC::$SS1[KISA_SEED_CBC::GetB1($T[0]) & 0x0ff] ^
KISA_SEED_CBC::$SS2[KISA_SEED_CBC::GetB2($T[0]) & 0x0ff] ^ KISA_SEED_CBC::$SS3[KISA_SEED_CBC::GetB3($T[0]) & 0x0ff];
$T[1] = ($T[1] + $T[0]) & 0x0ffffffff;
$T[1] = KISA_SEED_CBC::$SS0[KISA_SEED_CBC::GetB0($T[1]) & 0x0ff] ^ KISA_SEED_CBC::$SS1[KISA_SEED_CBC::GetB1($T[1]) & 0x0ff] ^
KISA_SEED_CBC::$SS2[KISA_SEED_CBC::GetB2($T[1]) & 0x0ff] ^ KISA_SEED_CBC::$SS3[KISA_SEED_CBC::GetB3($T[1]) & 0x0ff];
$T[0] = ($T[0] + $T[1]) & 0x0ffffffff;
$LR[$L0] ^= $T[0];
$LR[$L1] ^= $T[1];
}
static function EndianChange($dwS) {
return ((((($dwS) << (8)) | ((($dwS) >> (32 - (8))) & 0x000000ff)) & 0x00ff00ff) | (((($dwS) << (24)) | ((($dwS) >> (32 - (24))) & 0x00ffffff)) & 0xff00ff00) );
}
static $KC0 = 0x9e3779b9;
static $KC1 = 0x3c6ef373;
static $KC2 = 0x78dde6e6;
static $KC3 = 0xf1bbcdcc;
static $KC4 = 0xe3779b99;
static $KC5 = 0xc6ef3733;
static $KC6 = 0x8dde6e67;
static $KC7 = 0x1bbcdccf;
static $KC8 = 0x3779b99e;
static $KC9 = 0x6ef3733c;
static $KC10 = 0xdde6e678;
static $KC11 = 0xbbcdccf1;
static $KC12 = 0x779b99e3;
static $KC13 = 0xef3733c6;
static $KC14 = 0xde6e678d;
static $KC15 = 0xbcdccf1b;
static $ABCD_A = 0;
static $ABCD_B = 1;
static $ABCD_C = 2;
static $ABCD_D = 3;
static function RoundKeyUpdate0(&$T, &$K, $K_offset, &$ABCD, $KC) {
$T[0] = (($ABCD[KISA_SEED_CBC::$ABCD_A] & 0x0ffffffff) + ($ABCD[KISA_SEED_CBC::$ABCD_C] & 0x0ffffffff) - ($KC & 0x0ffffffff)) & 0x0ffffffff;
$T[1] = (($ABCD[KISA_SEED_CBC::$ABCD_B] & 0x0ffffffff) + ($KC & 0x0ffffffff) - ($ABCD[KISA_SEED_CBC::$ABCD_D] & 0x0ffffffff)) & 0x0ffffffff;
$K[$K_offset + 0] = KISA_SEED_CBC::$SS0[KISA_SEED_CBC::GetB0($T[0]) & 0x0ff] ^ KISA_SEED_CBC::$SS1[KISA_SEED_CBC::GetB1($T[0]) & 0x0ff] ^ KISA_SEED_CBC::$SS2[KISA_SEED_CBC::GetB2($T[0]) & 0x0ff] ^ KISA_SEED_CBC::$SS3[KISA_SEED_CBC::GetB3($T[0]) & 0x0ff];
$K[$K_offset + 1] = KISA_SEED_CBC::$SS0[KISA_SEED_CBC::GetB0($T[1]) & 0x0ff] ^ KISA_SEED_CBC::$SS1[KISA_SEED_CBC::GetB1($T[1]) & 0x0ff] ^ KISA_SEED_CBC::$SS2[KISA_SEED_CBC::GetB2($T[1]) & 0x0ff] ^ KISA_SEED_CBC::$SS3[KISA_SEED_CBC::GetB3($T[1]) & 0x0ff];
$T[0] = $ABCD[KISA_SEED_CBC::$ABCD_A];
$ABCD[KISA_SEED_CBC::$ABCD_A] = (($ABCD[KISA_SEED_CBC::$ABCD_A] >> 8) & 0x00ffffff) ^ ($ABCD[KISA_SEED_CBC::$ABCD_B] << 24);
$ABCD[KISA_SEED_CBC::$ABCD_B] = (($ABCD[KISA_SEED_CBC::$ABCD_B] >> 8) & 0x00ffffff) ^ ($T[0] << 24);
}
// 0xFFFFFFFF 를 & 연산 시키는 이유: 64bit OS에 설치된 PHP의 정수형 데이터 타입의 크기 차이로 인한 오버플로우 처리 오류
static function RoundKeyUpdate1(&$T, &$K, $K_offset, &$ABCD, $KC) {
$T[0] = (($ABCD[KISA_SEED_CBC::$ABCD_A] & 0xFFFFFFFF) + ($ABCD[KISA_SEED_CBC::$ABCD_C] & 0xFFFFFFFF) - ($KC & 0xFFFFFFFF)) & 0x0ffffffff;
$T[1] = (($ABCD[KISA_SEED_CBC::$ABCD_B] & 0xFFFFFFFF) + ($KC & 0xFFFFFFFF) - ($ABCD[KISA_SEED_CBC::$ABCD_D] & 0xFFFFFFFF)) & 0x0ffffffff;
$K[$K_offset + 0] = KISA_SEED_CBC::$SS0[KISA_SEED_CBC::GetB0($T[0]) & 0x0ff] ^ KISA_SEED_CBC::$SS1[KISA_SEED_CBC::GetB1($T[0]) & 0x0ff] ^ KISA_SEED_CBC::$SS2[KISA_SEED_CBC::GetB2($T[0]) & 0x0ff] ^ KISA_SEED_CBC::$SS3[KISA_SEED_CBC::GetB3($T[0]) & 0x0ff];
$K[$K_offset + 1] = KISA_SEED_CBC::$SS0[KISA_SEED_CBC::GetB0($T[1]) & 0x0ff] ^ KISA_SEED_CBC::$SS1[KISA_SEED_CBC::GetB1($T[1]) & 0x0ff] ^ KISA_SEED_CBC::$SS2[KISA_SEED_CBC::GetB2($T[1]) & 0x0ff] ^ KISA_SEED_CBC::$SS3[KISA_SEED_CBC::GetB3($T[1]) & 0x0ff];
$T[0] = $ABCD[KISA_SEED_CBC::$ABCD_C];
$ABCD[KISA_SEED_CBC::$ABCD_C] = (($ABCD[KISA_SEED_CBC::$ABCD_C] << 8) & 0xFFFFFFFF) ^ (($ABCD[KISA_SEED_CBC::$ABCD_D] >> 24) & 0x000000ff);
$ABCD[KISA_SEED_CBC::$ABCD_D] = (($ABCD[KISA_SEED_CBC::$ABCD_D] << 8) & 0xFFFFFFFF) ^ (($T[0] >> 24) & 0x000000ff);
}
static function BLOCK_XOR_CBC(&$OUT_VALUE, $OUT_VALUE_offset, &$IN_VALUE1, $IN_VALUE1_offset, &$IN_VALUE2, $IN_VALUE2_offset) {
$OUT_VALUE[$OUT_VALUE_offset + 0] = ($IN_VALUE1_offset < count($IN_VALUE1) ? $IN_VALUE1[$IN_VALUE1_offset + 0] : 0) ^ ($IN_VALUE2_offset < count($IN_VALUE2) ? $IN_VALUE2[$IN_VALUE2_offset + 0] : 0);
$OUT_VALUE[$OUT_VALUE_offset + 1] = ($IN_VALUE1_offset + 1 < count($IN_VALUE1) ? $IN_VALUE1[$IN_VALUE1_offset + 1] : 0) ^ ($IN_VALUE2_offset + 1 < count($IN_VALUE2) ? $IN_VALUE2[$IN_VALUE2_offset + 1] : 0);
$OUT_VALUE[$OUT_VALUE_offset + 2] = ($IN_VALUE1_offset + 2 < count($IN_VALUE1) ? $IN_VALUE1[$IN_VALUE1_offset + 2] : 0) ^ ($IN_VALUE2_offset + 2 < count($IN_VALUE2) ? $IN_VALUE2[$IN_VALUE2_offset + 2] : 0);
$OUT_VALUE[$OUT_VALUE_offset + 3] = ($IN_VALUE1_offset + 3 < count($IN_VALUE1) ? $IN_VALUE1[$IN_VALUE1_offset + 3] : 0) ^ ($IN_VALUE2_offset + 3 < count($IN_VALUE2) ? $IN_VALUE2[$IN_VALUE2_offset + 3] : 0);
}
static function KISA_SEED_Encrypt_Block_forCBC(&$in, $in_offset, &$out, $out_offset, &$ks) {
$LR = array_pad(array(), 4, 0); // Iuput/output values at each rounds
$T = array_pad(array(), 2, 0); // Temporary variables for round function F
$K = &$ks->key_data; // Pointer of round keys
$LR[LR_L0] = $in[$in_offset + 0];
$LR[LR_L1] = $in[$in_offset + 1];
$LR[LR_R0] = $in[$in_offset + 2];
$LR[LR_R1] = $in[$in_offset + 3];
if (_KISA_COMMON_IS_LITTLE_ENDIAN == false) {
$LR[LR_L0] = KISA_SEED_CBC::EndianChange($LR[LR_L0]);
$LR[LR_L1] = KISA_SEED_CBC::EndianChange($LR[LR_L1]);
$LR[LR_R0] = KISA_SEED_CBC::EndianChange($LR[LR_R0]);
$LR[LR_R1] = KISA_SEED_CBC::EndianChange($LR[LR_R1]);
}
KISA_SEED_CBC::SeedRound($T, $LR, LR_L0, LR_L1, LR_R0, LR_R1, $K, 0); // Round 1
KISA_SEED_CBC::SeedRound($T, $LR, LR_R0, LR_R1, LR_L0, LR_L1, $K, 2); // Round 2
KISA_SEED_CBC::SeedRound($T, $LR, LR_L0, LR_L1, LR_R0, LR_R1, $K, 4); // Round 3
KISA_SEED_CBC::SeedRound($T, $LR, LR_R0, LR_R1, LR_L0, LR_L1, $K, 6); // Round 4
KISA_SEED_CBC::SeedRound($T, $LR, LR_L0, LR_L1, LR_R0, LR_R1, $K, 8); // Round 5
KISA_SEED_CBC::SeedRound($T, $LR, LR_R0, LR_R1, LR_L0, LR_L1, $K, 10); // Round 6
KISA_SEED_CBC::SeedRound($T, $LR, LR_L0, LR_L1, LR_R0, LR_R1, $K, 12); // Round 7
KISA_SEED_CBC::SeedRound($T, $LR, LR_R0, LR_R1, LR_L0, LR_L1, $K, 14); // Round 8
KISA_SEED_CBC::SeedRound($T, $LR, LR_L0, LR_L1, LR_R0, LR_R1, $K, 16); // Round 9
KISA_SEED_CBC::SeedRound($T, $LR, LR_R0, LR_R1, LR_L0, LR_L1, $K, 18); // Round 10
KISA_SEED_CBC::SeedRound($T, $LR, LR_L0, LR_L1, LR_R0, LR_R1, $K, 20); // Round 11
KISA_SEED_CBC::SeedRound($T, $LR, LR_R0, LR_R1, LR_L0, LR_L1, $K, 22); // Round 12
KISA_SEED_CBC::SeedRound($T, $LR, LR_L0, LR_L1, LR_R0, LR_R1, $K, 24); // Round 13
KISA_SEED_CBC::SeedRound($T, $LR, LR_R0, LR_R1, LR_L0, LR_L1, $K, 26); // Round 14
KISA_SEED_CBC::SeedRound($T, $LR, LR_L0, LR_L1, LR_R0, LR_R1, $K, 28); // Round 15
KISA_SEED_CBC::SeedRound($T, $LR, LR_R0, LR_R1, LR_L0, LR_L1, $K, 30); // Round 16
if (_KISA_COMMON_IS_LITTLE_ENDIAN == false) {
$LR[LR_L0] = KISA_SEED_CBC::EndianChange($LR[LR_L0]);
$LR[LR_L1] = KISA_SEED_CBC::EndianChange($LR[LR_L1]);
$LR[LR_R0] = KISA_SEED_CBC::EndianChange($LR[LR_R0]);
$LR[LR_R1] = KISA_SEED_CBC::EndianChange($LR[LR_R1]);
}
$out[$out_offset + 0] = $LR[LR_R0];
$out[$out_offset + 1] = $LR[LR_R1];
$out[$out_offset + 2] = $LR[LR_L0];
$out[$out_offset + 3] = $LR[LR_L1];
}
static function KISA_SEED_Decrypt_Block_forCBC(&$in, $in_offset, &$out, $out_offset, &$ks) {
$LR = array_pad(array(), 4, 0); // Iuput/output values at each rounds
$T = array_pad(array(), 2, 0); // Temporary variables for round function F
$K = &$ks->key_data; // Pointer of round keys
$LR[LR_L0] = $in[$in_offset + 0];
$LR[LR_L1] = $in[$in_offset + 1];
$LR[LR_R0] = $in[$in_offset + 2];
$LR[LR_R1] = $in[$in_offset + 3];
if (_KISA_COMMON_IS_LITTLE_ENDIAN == false) {
$LR[LR_L0] = KISA_SEED_CBC::EndianChange($LR[LR_L0]);
$LR[LR_L1] = KISA_SEED_CBC::EndianChange($LR[LR_L1]);
$LR[LR_R0] = KISA_SEED_CBC::EndianChange($LR[LR_R0]);
$LR[LR_R1] = KISA_SEED_CBC::EndianChange($LR[LR_R1]);
}
KISA_SEED_CBC::SeedRound($T, $LR, LR_L0, LR_L1, LR_R0, LR_R1, $K, 30); // Round 1
KISA_SEED_CBC::SeedRound($T, $LR, LR_R0, LR_R1, LR_L0, LR_L1, $K, 28); // Round 2
KISA_SEED_CBC::SeedRound($T, $LR, LR_L0, LR_L1, LR_R0, LR_R1, $K, 26); // Round 3
KISA_SEED_CBC::SeedRound($T, $LR, LR_R0, LR_R1, LR_L0, LR_L1, $K, 24); // Round 4
KISA_SEED_CBC::SeedRound($T, $LR, LR_L0, LR_L1, LR_R0, LR_R1, $K, 22); // Round 5
KISA_SEED_CBC::SeedRound($T, $LR, LR_R0, LR_R1, LR_L0, LR_L1, $K, 20); // Round 6
KISA_SEED_CBC::SeedRound($T, $LR, LR_L0, LR_L1, LR_R0, LR_R1, $K, 18); // Round 7
KISA_SEED_CBC::SeedRound($T, $LR, LR_R0, LR_R1, LR_L0, LR_L1, $K, 16); // Round 8
KISA_SEED_CBC::SeedRound($T, $LR, LR_L0, LR_L1, LR_R0, LR_R1, $K, 14); // Round 9
KISA_SEED_CBC::SeedRound($T, $LR, LR_R0, LR_R1, LR_L0, LR_L1, $K, 12); // Round 10
KISA_SEED_CBC::SeedRound($T, $LR, LR_L0, LR_L1, LR_R0, LR_R1, $K, 10); // Round 11
KISA_SEED_CBC::SeedRound($T, $LR, LR_R0, LR_R1, LR_L0, LR_L1, $K, 8); // Round 12
KISA_SEED_CBC::SeedRound($T, $LR, LR_L0, LR_L1, LR_R0, LR_R1, $K, 6); // Round 13
KISA_SEED_CBC::SeedRound($T, $LR, LR_R0, LR_R1, LR_L0, LR_L1, $K, 4); // Round 14
KISA_SEED_CBC::SeedRound($T, $LR, LR_L0, LR_L1, LR_R0, LR_R1, $K, 2); // Round 15
KISA_SEED_CBC::SeedRound($T, $LR, LR_R0, LR_R1, LR_L0, LR_L1, $K, 0); // Round 16
if (_KISA_COMMON_IS_LITTLE_ENDIAN == false) {
$LR[LR_L0] = KISA_SEED_CBC::EndianChange($LR[LR_L0]);
$LR[LR_L1] = KISA_SEED_CBC::EndianChange($LR[LR_L1]);
$LR[LR_R0] = KISA_SEED_CBC::EndianChange($LR[LR_R0]);
$LR[LR_R1] = KISA_SEED_CBC::EndianChange($LR[LR_R1]);
}
$out[$out_offset + 0] = $LR[LR_R0];
$out[$out_offset + 1] = $LR[LR_R1];
$out[$out_offset + 2] = $LR[LR_L0];
$out[$out_offset + 3] = $LR[LR_L1];
}
static function chartoint32_for_SEED_CBC(&$in, $inLen) {
$data = null;
$len = 0;
$i = 0;
if ($inLen % 4 > 0)
$len = (0x0ff & ((int) ($inLen / 4))) + 1;
else
$len = (0x0ff & ((int) ($inLen / 4)));
$data = array_pad(array(), $len, 0);
for ($i = 0; $i < $len; $i++) {
Common::byte_to_int($data, $i, $in, $i * 4);
}
return $data;
}
static function int32tochar_for_SEED_CBC(&$in, $inLen) {
$data = null;
$i = 0;
$data = array_pad(array(), $inLen, 0);
if (_KISA_COMMON_IS_LITTLE_ENDIAN == false) {
for ($i = 0; $i < $inLen; $i++) {
$data[$i] = 0x0ff & ($in[(int) ($i / 4)] >> (($i % 4) * 8));
}
} else {
for ($i = 0; $i < $inLen; $i++) {
$data[$i] = 0x0ff & ($in[(int) ($i / 4)] >> ((3 - ($i % 4)) * 8));
}
}
return $data;
}
// 0xFFFFFFFF 를 & 연산 시키는 이유: 64bit OS에 설치된 PHP의 정수형 데이터 타입의 크기 차이로 인한 오버플로우 처리 오류
static function SEED_CBC_init(&$pInfo, $enc, &$pbszUserKey, &$pbszIV) {
$ABCD = array_pad(array(), 4, 0); // Iuput/output values at each rounds
$T = array_pad(array(), 2, 0); // Temporary variable
$K = null;
if (null == $pInfo ||
null == $pbszUserKey ||
null == $pbszIV)
return 0;
$K = &$pInfo->seed_key->key_data; // Pointer of round keys
$pInfo->encrypt = $enc;
Common::memcpy_byte2int($pInfo->ivec, $pbszIV, 16);
$pInfo->last_block_flag = $pInfo->buffer_length = 0;
$ABCD[KISA_SEED_CBC::$ABCD_A] = Common::get_byte_to_int($pbszUserKey, 0 * 4);
$ABCD[KISA_SEED_CBC::$ABCD_B] = Common::get_byte_to_int($pbszUserKey, 1 * 4);
$ABCD[KISA_SEED_CBC::$ABCD_C] = Common::get_byte_to_int($pbszUserKey, 2 * 4);
$ABCD[KISA_SEED_CBC::$ABCD_D] = Common::get_byte_to_int($pbszUserKey, 3 * 4);
if (_KISA_COMMON_IS_LITTLE_ENDIAN == false) {
$ABCD[KISA_SEED_CBC::$ABCD_A] = KISA_SEED_CBC::EndianChange($ABCD[KISA_SEED_CBC::$ABCD_A]);
$ABCD[KISA_SEED_CBC::$ABCD_B] = KISA_SEED_CBC::EndianChange($ABCD[KISA_SEED_CBC::$ABCD_B]);
$ABCD[KISA_SEED_CBC::$ABCD_C] = KISA_SEED_CBC::EndianChange($ABCD[KISA_SEED_CBC::$ABCD_C]);
$ABCD[KISA_SEED_CBC::$ABCD_D] = KISA_SEED_CBC::EndianChange($ABCD[KISA_SEED_CBC::$ABCD_D]);
}
KISA_SEED_CBC::RoundKeyUpdate0($T, $K, 0, $ABCD, KISA_SEED_CBC::$KC0); // K_1,0 and K_1,1
KISA_SEED_CBC::RoundKeyUpdate1($T, $K, 2, $ABCD, KISA_SEED_CBC::$KC1); // K_2,0 and K_2,1
KISA_SEED_CBC::RoundKeyUpdate0($T, $K, 4, $ABCD, KISA_SEED_CBC::$KC2); // K_3,0 and K_3,1
KISA_SEED_CBC::RoundKeyUpdate1($T, $K, 6, $ABCD, KISA_SEED_CBC::$KC3); // K_4,0 and K_4,1
KISA_SEED_CBC::RoundKeyUpdate0($T, $K, 8, $ABCD, KISA_SEED_CBC::$KC4); // K_5,0 and K_5,1
KISA_SEED_CBC::RoundKeyUpdate1($T, $K, 10, $ABCD, KISA_SEED_CBC::$KC5); // K_6,0 and K_6,1
KISA_SEED_CBC::RoundKeyUpdate0($T, $K, 12, $ABCD, KISA_SEED_CBC::$KC6); // K_7,0 and K_7,1
KISA_SEED_CBC::RoundKeyUpdate1($T, $K, 14, $ABCD, KISA_SEED_CBC::$KC7); // K_8,0 and K_8,1
KISA_SEED_CBC::RoundKeyUpdate0($T, $K, 16, $ABCD, KISA_SEED_CBC::$KC8); // K_9,0 and K_9,1
KISA_SEED_CBC::RoundKeyUpdate1($T, $K, 18, $ABCD, KISA_SEED_CBC::$KC9); // K_10,0 and K_10,1
KISA_SEED_CBC::RoundKeyUpdate0($T, $K, 20, $ABCD, KISA_SEED_CBC::$KC10); // K_11,0 and K_11,1
KISA_SEED_CBC::RoundKeyUpdate1($T, $K, 22, $ABCD, KISA_SEED_CBC::$KC11); // K_12,0 and K_12,1
KISA_SEED_CBC::RoundKeyUpdate0($T, $K, 24, $ABCD, KISA_SEED_CBC::$KC12); // K_13,0 and K_13,1
KISA_SEED_CBC::RoundKeyUpdate1($T, $K, 26, $ABCD, KISA_SEED_CBC::$KC13); // K_14,0 and K_14,1
KISA_SEED_CBC::RoundKeyUpdate0($T, $K, 28, $ABCD, KISA_SEED_CBC::$KC14); // K_15,0 and K_15,1
$T[0] = (($ABCD[KISA_SEED_CBC::$ABCD_A] & 0xFFFFFFFF) + ($ABCD[KISA_SEED_CBC::$ABCD_C] & 0xFFFFFFFF) - KISA_SEED_CBC::$KC15) & 0x0ffffffff;
$T[1] = (($ABCD[KISA_SEED_CBC::$ABCD_B] & 0xFFFFFFFF) - ($ABCD[KISA_SEED_CBC::$ABCD_D] & 0xFFFFFFFF) + KISA_SEED_CBC::$KC15) & 0x0ffffffff;
$K[30] = KISA_SEED_CBC::$SS0[KISA_SEED_CBC::GetB0($T[0]) & 0x0ff] ^ KISA_SEED_CBC::$SS1[KISA_SEED_CBC::GetB1($T[0]) & 0x0ff] ^ // K_16,0
KISA_SEED_CBC::$SS2[KISA_SEED_CBC::GetB2($T[0]) & 0x0ff] ^ KISA_SEED_CBC::$SS3[KISA_SEED_CBC::GetB3($T[0]) & 0x0ff];
$K[31] = KISA_SEED_CBC::$SS0[KISA_SEED_CBC::GetB0($T[1]) & 0x0ff] ^ KISA_SEED_CBC::$SS1[KISA_SEED_CBC::GetB1($T[1]) & 0x0ff] ^ // K_16,1
KISA_SEED_CBC::$SS2[KISA_SEED_CBC::GetB2($T[1]) & 0x0ff] ^ KISA_SEED_CBC::$SS3[KISA_SEED_CBC::GetB3($T[1]) & 0x0ff];
return 1;
}
static function SEED_CBC_Process(&$pInfo, &$in, $inLen, &$out, &$outLen) {
$nCurrentCount = KISA_SEED_CBC::BLOCK_SIZE_SEED;
$pdwXOR = null;
$in_offset = 0;
$out_offset = 0;
$pdwXOR_offset = 0;
if (null == $pInfo ||
null == $in ||
null == $out ||
0 > $inLen)
return 0;
if (KISA_ENC_DEC::KISA_ENCRYPT == $pInfo->encrypt) {
$pdwXOR = &$pInfo->ivec;
$in_offset = 0;
$out_offset = 0;
$pdwXOR_offset = 0;
while ($nCurrentCount <= $inLen) {
KISA_SEED_CBC::BLOCK_XOR_CBC($out, $out_offset, $in, $in_offset, $pdwXOR, $pdwXOR_offset);
KISA_SEED_CBC::KISA_SEED_Encrypt_Block_forCBC($out, $out_offset, $out, $out_offset, $pInfo->seed_key);
$pdwXOR = &$out;
$pdwXOR_offset = $out_offset;
$nCurrentCount += KISA_SEED_CBC::BLOCK_SIZE_SEED;
$in_offset += KISA_SEED_CBC::BLOCK_SIZE_SEED_INT;
$out_offset += KISA_SEED_CBC::BLOCK_SIZE_SEED_INT;
}
$outLen = $nCurrentCount - KISA_SEED_CBC::BLOCK_SIZE_SEED;
$pInfo->buffer_length = $inLen - $outLen;
Common::memcpy_int2int($pInfo->ivec, $pdwXOR, $pdwXOR_offset, KISA_SEED_CBC::BLOCK_SIZE_SEED);
Common::arraycopy_system($in, $in_offset, $pInfo->cbc_buffer, 0, $pInfo->buffer_length);
} else {
$pdwXOR = $pInfo->ivec;
$in_offset = 0;
$out_offset = 0;
$pdwXOR_offset = 0;
while ($nCurrentCount <= $inLen) {
KISA_SEED_CBC::KISA_SEED_Decrypt_Block_forCBC($in, $in_offset, $out, $out_offset, $pInfo->seed_key);
KISA_SEED_CBC::BLOCK_XOR_CBC($out, $out_offset, $out, $out_offset, $pdwXOR, $pdwXOR_offset);
$pdwXOR = &$in;
$pdwXOR_offset = $in_offset;
$nCurrentCount += KISA_SEED_CBC::BLOCK_SIZE_SEED;
$in_offset += KISA_SEED_CBC::BLOCK_SIZE_SEED_INT;
$out_offset += KISA_SEED_CBC::BLOCK_SIZE_SEED_INT;
}
$outLen = $nCurrentCount - KISA_SEED_CBC::BLOCK_SIZE_SEED;
Common::memcpy_int2int($pInfo->ivec, $pdwXOR, $pdwXOR_offset, KISA_SEED_CBC::BLOCK_SIZE_SEED);
Common::memcpy_int2int($pInfo->cbc_last_block, $out, $out_offset - KISA_SEED_CBC::BLOCK_SIZE_SEED_INT, KISA_SEED_CBC::BLOCK_SIZE_SEED);
}
return 1;
}
static function SEED_CBC_Close(&$pInfo, &$out, $out_offset, &$outLen) {
$nPaddngLeng = null;
$i = null;
$outLen = 0;
if (null == $out)
return 0;
if (KISA_ENC_DEC::KISA_ENCRYPT == $pInfo->encrypt) {
$nPaddngLeng = KISA_SEED_CBC::BLOCK_SIZE_SEED - $pInfo->buffer_length;
for ($i = $pInfo->buffer_length; $i < KISA_SEED_CBC::BLOCK_SIZE_SEED; $i++) {
Common::set_byte_for_int($pInfo->cbc_buffer, $i, $nPaddngLeng);
}
KISA_SEED_CBC::BLOCK_XOR_CBC($pInfo->cbc_buffer, 0, $pInfo->cbc_buffer, 0, $pInfo->ivec, 0);
KISA_SEED_CBC::KISA_SEED_Encrypt_Block_forCBC($pInfo->cbc_buffer, 0, $out, $out_offset / 4, $pInfo->seed_key);
$outLen = KISA_SEED_CBC::BLOCK_SIZE_SEED;
} else {
$nPaddngLeng = Common::get_byte_for_int($pInfo->cbc_last_block, KISA_SEED_CBC::BLOCK_SIZE_SEED - 1);
if ($nPaddngLeng > 0 && $nPaddngLeng <= KISA_SEED_CBC::BLOCK_SIZE_SEED) {
for ($i = $nPaddngLeng; $i > 0; $i--) {
Common::set_byte_for_int($out, $out_offset - $i, 0);
}
$outLen = $nPaddngLeng;
} else {
return 0;
}
}
return 1;
}
static function SEED_CBC_Encrypt(&$pbszUserKey, &$pbszIV, &$message, $message_offset, $message_length) {
$info = new KISA_SEED_INFO();
$outbuf = null;
$data = null;
$cdata = null;
$outlen = 0;
$nRetOutLeng = 0;
$nPaddingLeng = 0;
$pbszPlainText = array_pad(array(), $message_length, 0);
Common::arraycopy_system($message, $message_offset, $pbszPlainText, 0, $message_length);
$nPlainTextLen = count($pbszPlainText);
$nPlainTextPadding = (KISA_SEED_CBC::BLOCK_SIZE_SEED - ($nPlainTextLen % KISA_SEED_CBC::BLOCK_SIZE_SEED));
$newpbszPlainText = array_pad(array(), $nPlainTextLen + $nPlainTextPadding, 0);
Common::arraycopy($newpbszPlainText, $pbszPlainText, $nPlainTextLen);
$pbszCipherText = array_pad(array(), count($newpbszPlainText), 0);
KISA_SEED_CBC::SEED_CBC_init($info, KISA_ENC_DEC::KISA_ENCRYPT, $pbszUserKey, $pbszIV);
$outlen = ( ((int) ($nPlainTextLen / 16)) + 1 ) * 4;
$outbuf = array_pad(array(), $outlen, 0);
$data = KISA_SEED_CBC::chartoint32_for_SEED_CBC($newpbszPlainText, $nPlainTextLen);
KISA_SEED_CBC::SEED_CBC_Process($info, $data, $nPlainTextLen, $outbuf, $nRetOutLeng);
KISA_SEED_CBC::SEED_CBC_Close($info, $outbuf, $nRetOutLeng, $nPaddingLeng);
$cdata = KISA_SEED_CBC::int32tochar_for_SEED_CBC($outbuf, $nRetOutLeng + $nPaddingLeng);
Common::arraycopy($pbszCipherText, $cdata, $nRetOutLeng + $nPaddingLeng);
$data = null;
$cdata = null;
$outbuf = null;
return $pbszCipherText;
}
static function SEED_CBC_Decrypt(&$pbszUserKey, &$pbszIV, &$message, $message_offset, $message_length) {
$info = new KISA_SEED_INFO();
$outbuf = null;
$data = null;
$cdata = null;
$outlen = 0;
$nRetOutLeng = 0;
$nPaddingLeng = 0;
$pbszCipherText = array_pad(array(), $message_length, 0);
Common::arraycopy_system($message, $message_offset, $pbszCipherText, 0, $message_length);
$nCipherTextLen = count($pbszCipherText);
$result = null;
if ($nCipherTextLen % KISA_SEED_CBC::BLOCK_SIZE_SEED) {
return $result;
}
$newpbszCipherText = array_pad(array(), $nCipherTextLen, 0);
Common::arraycopy($newpbszCipherText, $pbszCipherText, $nCipherTextLen);
$pbszPlainText = array_pad(array(), count($newpbszCipherText), 0);
$nCipherTextLen = count($newpbszCipherText);
KISA_SEED_CBC::SEED_CBC_init($info, KISA_ENC_DEC::KISA_DECRYPT, $pbszUserKey, $pbszIV);
$outlen = (($nCipherTextLen / 16)) * 4;
$outbuf = array_pad(array(), $outlen, 0);
$data = KISA_SEED_CBC::chartoint32_for_SEED_CBC($newpbszCipherText, $nCipherTextLen);
KISA_SEED_CBC::SEED_CBC_Process($info, $data, $nCipherTextLen, $outbuf, $nRetOutLeng);
if (KISA_SEED_CBC::SEED_CBC_Close($info, $outbuf, $nRetOutLeng, $nPaddingLeng)) {
$cdata = KISA_SEED_CBC::int32tochar_for_SEED_CBC($outbuf, $nRetOutLeng - $nPaddingLeng);
Common::arraycopy($pbszPlainText, $cdata, $nRetOutLeng - $nPaddingLeng);
$message_length = $nRetOutLeng - $nPaddingLeng;
if ($message_length < 0)
$message_length = 0;
$result = array_pad(array(), $message_length, 0);
Common::arraycopy_system($pbszPlainText, 0, $result, 0, $message_length);
}
$data = null;
$cdata = null;
$outbuf = null;
return $result;
}
}
?>
Binary file not shown.
Binary file not shown.
Binary file not shown.
+3
View File
@@ -14,12 +14,15 @@ $web_siteid = '';
if ($config['cf_cert_use'] == 2) { // 실서비스 if ($config['cf_cert_use'] == 2) { // 실서비스
$site_cd = 'SM'.$config['cf_cert_kcp_cd']; $site_cd = 'SM'.$config['cf_cert_kcp_cd'];
$cert_url = 'https://cert.kcp.co.kr/kcp_cert/cert_view.jsp'; $cert_url = 'https://cert.kcp.co.kr/kcp_cert/cert_view.jsp';
$kcp_enc_key = $config['cf_cert_kcp_enckey'];
} else if ($config['cf_cert_use'] == 1) { // 테스트사용 } else if ($config['cf_cert_use'] == 1) { // 테스트사용
$site_cd = 'S6186'; $site_cd = 'S6186';
$cert_url = 'https://testcert.kcp.co.kr/kcp_cert/cert_view.jsp'; $cert_url = 'https://testcert.kcp.co.kr/kcp_cert/cert_view.jsp';
$kcp_enc_key = 'E66DCEB95BFBD45DF9DFAEEBCB092B5DC2EB3BF0';
} else { // 사용안함 } else { // 사용안함
$site_cd = ''; $site_cd = '';
$cert_url = ''; $cert_url = '';
$kcp_enc_key = '';
} }
if(!$site_cd) if(!$site_cd)
+11 -1
View File
@@ -27,6 +27,8 @@ if(!$ordr_idxx)
$ct_cert = new C_CT_CLI; $ct_cert = new C_CT_CLI;
$ct_cert->mf_clear(); $ct_cert->mf_clear();
$sbParam = '';
$year = "00"; $year = "00";
$month = "00"; $month = "00";
$day = "00"; $day = "00";
@@ -47,7 +49,7 @@ $hash_data = $site_cd .
$sex_code . $sex_code .
$local_code; $local_code;
$up_hash = $ct_cert->make_hash_data( $home_dir, $hash_data ); $up_hash = $ct_cert->make_hash_data( $home_dir, $kcp_enc_key, $hash_data );
$ct_cert->mf_clear(); $ct_cert->mf_clear();
?> ?>
@@ -88,6 +90,9 @@ $ct_cert->mf_clear();
<!-- cert_enc_use 필수 (고정값 : 메뉴얼 참고) --> <!-- cert_enc_use 필수 (고정값 : 메뉴얼 참고) -->
<input type="hidden" name="cert_enc_use" value="Y"/> <input type="hidden" name="cert_enc_use" value="Y"/>
<!-- 리턴 암호화 고도화 -->
<input type="hidden" name="cert_enc_use_ext" value="Y"/>
<?php if(is_mobile()) { ?> <?php if(is_mobile()) { ?>
<!-- cert_able_yn input 비활성화 설정 --> <!-- cert_able_yn input 비활성화 설정 -->
<input type="hidden" name="cert_able_yn" value=""/> <input type="hidden" name="cert_able_yn" value=""/>
@@ -101,10 +106,15 @@ $ct_cert->mf_clear();
<!-- up_hash 검증 을 위한 필드 --> <!-- up_hash 검증 을 위한 필드 -->
<input type="hidden" name="veri_up_hash" value=""/> <input type="hidden" name="veri_up_hash" value=""/>
<!-- web_siteid 을 위한 필드 -->
<input type="hidden" name="web_siteid_hashYN" value=""/>
<!-- 가맹점 사용 필드 (인증완료시 리턴)--> <!-- 가맹점 사용 필드 (인증완료시 리턴)-->
<input type="hidden" name="param_opt_1" value="opt1"/> <input type="hidden" name="param_opt_1" value="opt1"/>
<input type="hidden" name="param_opt_2" value="opt2"/> <input type="hidden" name="param_opt_2" value="opt2"/>
<input type="hidden" name="param_opt_3" value="opt3"/> <input type="hidden" name="param_opt_3" value="opt3"/>
<input type='hidden' name='kcp_cert_lib_ver' value="<?php echo $ct_cert->get_kcp_lib_ver( $home_dir ); ?>"/>
</form> </form>
<script> <script>
+8 -2
View File
@@ -12,6 +12,7 @@ $enc_data = "";
$req_tx = ""; $req_tx = "";
$enc_cert_data = ""; $enc_cert_data = "";
$enc_cert_data2 = "";
$cert_info = ""; $cert_info = "";
$tran_cd = ""; $tran_cd = "";
@@ -67,6 +68,11 @@ for($i=0; $i<count($key); $i++)
{ {
$enc_cert_data = f_get_parm_str ( $valParam ); $enc_cert_data = f_get_parm_str ( $valParam );
} }
if ( $nmParam == "enc_cert_data2" )
{
$enc_cert_data2 = f_get_parm_str ( $valParam );
}
if ( $nmParam == "dn_hash" ) if ( $nmParam == "dn_hash" )
{ {
@@ -98,7 +104,7 @@ if( $cert_enc_use == "Y" )
// 해당 데이터의 위변조를 방지합니다 // 해당 데이터의 위변조를 방지합니다
$veri_str = $site_cd.$ordr_idxx.$cert_no; // 사이트 코드 + 주문번호 + 인증거래번호 $veri_str = $site_cd.$ordr_idxx.$cert_no; // 사이트 코드 + 주문번호 + 인증거래번호
if ( $ct_cert->check_valid_hash ( $home_dir , $dn_hash , $veri_str ) != "1" ) if ( $ct_cert->check_valid_hash ( $home_dir , $kcp_enc_key, $dn_hash , $veri_str ) != "1" )
{ {
if(strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') { if(strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {
// 검증 실패시 처리 영역 // 검증 실패시 처리 영역
@@ -122,7 +128,7 @@ if( $cert_enc_use == "Y" )
// site_cd 와 cert_no 를 가지고 복화화 하는 함수 입니다. // site_cd 와 cert_no 를 가지고 복화화 하는 함수 입니다.
// 정상적으로 복호화 된경우에만 인증데이터를 가져올수 있습니다. // 정상적으로 복호화 된경우에만 인증데이터를 가져올수 있습니다.
$opt = "1" ; // 복호화 인코딩 옵션 ( UTF - 8 사용시 "1" ) $opt = "1" ; // 복호화 인코딩 옵션 ( UTF - 8 사용시 "1" )
$ct_cert->decrypt_enc_cert( $home_dir , $site_cd , $cert_no , $enc_cert_data , $opt ); $ct_cert->decrypt_enc_cert( $home_dir , $kcp_enc_key, $site_cd , $cert_no , $enc_cert_data2 , $opt );
$comm_id = $ct_cert->mf_get_key_value("comm_id" ); // 이동통신사 코드 $comm_id = $ct_cert->mf_get_key_value("comm_id" ); // 이동통신사 코드
$phone_no = $ct_cert->mf_get_key_value("phone_no" ); // 전화번호 $phone_no = $ct_cert->mf_get_key_value("phone_no" ); // 전화번호
Loaded 100 of 152 files, more files were not shown because too many files have changed in this diff. Show more