Compare commits

...
104 Commits
Author SHA1 Message Date
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
thisgun 4455f7d3c9 버전 5.5.9 수정 2023-10-19 11:29:24 +09:00
thisgun 398967f804 Merge branch 'master' of github.com:gnuboard/gnuboard5 2023-10-19 11:28:28 +09:00
KkigomiandGitHub ee75b32b3c adm/index.php 페이지에 컨텐츠를 삽입할 수 있는 Hook 추가 (#283)
* 코드 포맷

* adm/index.php 페이지에 컨텐츠를 삽입할 수 있는 Hook 추가

- adm_index_addtional_content_before
- adm_index_addtional_content_after
2023-10-19 11:27:18 +09:00
MayCactusandGitHub c869f29f0d 세션 쿠키 보안 강화 (#282)
* Enhance Session Cookie Security

* Fix user registration link path
2023-10-19 11:27:00 +09:00
KkigomiandGitHub c95168fb0c IP 변경으로 인한 관리페이지 접근 시 접속이 제한되는 문제 해결 (#284)
* `ss_mb_key`를 생성하고 검증할 때 IP를 제거하고 대체 함

프록시 등의 사용으로 IP가 수시로 변경되는 환경이라면 관리페이지 접근에 수시로 제한이 되는 문제를 해결하기 위함

* `ss_mb_key` 세션 값 생성 코드의 중복을 제거하기 위해 정리

* client_key 유효 시간을 세션 동안만 유지되도록 변경
2023-10-19 11:26:28 +09:00
thisgun b8ffd99362 비밀글이 게시판 목록에서 내용, 썸네일이 노출되는 문제 수정#287 2023-10-19 11:17:16 +09:00
thisgun 64e1fbe786 Merge branch 'master' of github.com:gnuboard/gnuboard5 2023-10-18 17:23:56 +09:00
thisgun 91715ff830 KG이니시스 통합인증 테스트키 수정 2023-10-18 17:23:43 +09:00
thisgunandGitHub 1fb9e28510 Merge pull request #273 from maycactus-FOSS/bug
Refactor: str_encrypt 클래스의 변수 이름 수정
2023-10-18 12:58:13 +09:00
thisgunandGitHub babbc9afdb Merge pull request #278 from kkigomi/master-2
`$wr_id` 전역변수의 값이 잘못된 타입으로 할당되는 문제 고침
2023-10-18 12:57:37 +09:00
thisgunandGitHub 04030f9274 Merge pull request #280 from kkigomi/patch-comment
불필요한 주석 제거
2023-10-18 12:56:55 +09:00
thisgunandGitHub 3085703c61 Merge pull request #279 from kkigomi/patch-1
`delete_cache_latest` Hook 추가
2023-10-18 12:56:31 +09:00
thisgunandGitHub 20dc211a82 Merge pull request #285 from kkigomi/feature/auth.au_menu
관리권한 설정 시 메뉴명(au_menu)의 길이 제한으로 인한 문제 개선
2023-10-18 10:33:39 +09:00
thisgunandGitHub a773839338 Merge pull request #289 from kkigomi/feature/deprecated-sql_password
sql_password() 함수를 사용하는 것을 권장하지 않음을 표기
2023-10-18 10:31:04 +09:00
kkigomi 84b22909c5 sql_password() 함수를 사용하는 것을 권장하지 않음을 표기
https://github.com/gnuboard/gnuboard5/issues/247
2023-10-15 20:39:44 +09:00
kkigomi 28bfcea9c2 관리권한 설정 시 메뉴 ID(au_menu)의 길이 제한을 20에서 50으로 확장 2023-09-09 21:48:34 +09:00
kkigomi 8cd1df0f43 불필요한 주석 제거 2023-08-31 21:18:41 +09:00
KkigomiandGitHub cf2a8ab282 delete_cache_latest Hook 추가
`delete_cache_latest()` 함수에 `delete_cache_latest` Hook 추가
2023-08-30 01:06:07 +09:00
KkigomiandGitHub 941f3e135a $wr_id 전역변수의 값이 잘못된 타입으로 할당되는 문제 고침
짧은 주소 '글 이름' 주소로 접근할 때 `$wr_id` 전역변수의 값이 `string` 타입으로  잘못 할당되는 문제를 `int` 타입으로 올바르게 바로 잡습니다
2023-08-21 09:24:30 +09:00
thisgun 4b9b1af01e 버전 5.5.8.3.4 수정 2023-08-17 14:40:08 +09:00
thisgun 41d48891f4 wr_num 필드 값이 동시성 문제로 겹치는 경우 답변글에 대한 권한이 잘못 주어지는 등의 문제 다시 수정 #265 2023-08-17 14:39:05 +09:00
maycactus 616f5b8d46 Refactor: str_encrypt 클래스의 변수 이름 수정 2023-08-16 15:37:08 -04:00
thisgun a96460948c 버전 5.5.8.3.3 수정 2023-08-16 15:52:11 +09:00
thisgun 337ee4e68f Merge branch 'master' of github.com:gnuboard/gnuboard5 2023-08-16 15:49:14 +09:00
thisgunandGitHub 7af4888458 Merge pull request #268 from kkigomi/feature/hook-qawrite_update
1:1문의 답변 시 `qawrite_update` Hook에서 답변 글의 ID를 전달하도록 개선
2023-08-16 15:47:52 +09:00
thisgunandGitHub fdc695d08c Merge pull request #270 from kkigomi/feature/hook-shop-itemcopy
영카트 상품 복사 후 `shop_admin_itemcopy` Event Hook 추가
2023-08-16 15:47:09 +09:00
thisgunandGitHub 9fe34dae1d Merge pull request #267 from kkigomi/feature/hook-qa_delete
`qa_delete` Event Hook에서 실제 삭제된 ID 목록을 전달하도록 개선
2023-08-16 15:46:28 +09:00
thisgunandGitHub 4364058313 Merge pull request #266 from kkigomi/patch-qadelete-answer
QA에서 질문글 삭제 시 답변글의 첨부파일 및 썸네일을 삭제하지 못하는 문제 수정
2023-08-16 15:45:25 +09:00
thisgunandGitHub 0642c48106 Merge pull request #263 from kkigomi/patch-owl
owl.video.play.png 파일이 없어 발생하는 오류 수정
2023-08-16 15:44:15 +09:00
thisgunandGitHub d74c7b24bf Merge pull request #259 from kkigomi/patch-1
adm/view.php 파일에서 $sub_menu 등 변수 위치를 변경
2023-08-16 15:43:58 +09:00
thisgunandGitHub fec5569c71 Merge pull request #256 from maycactus-FOSS/bug
코드 일관성, 가독성 향상 및 버그 수정
2023-08-16 15:43:42 +09:00
thisgun 876534a440 wr_num 필드 값이 동시성 문제로 겹치는 경우 답변글에 대한 권한이 잘못 주어지는 등의 문제 #265 2023-08-16 13:01:05 +09:00
thisgun 5d4ba1030e 관리페이지 메뉴 접근 권한이 부여된 경우 관리페이지의 index 페이지의 정보가 노출되는 문제 #258 2023-08-16 11:44:42 +09:00
thisgun e43e424d80 세션 고정 취약점 수정 #257 2023-08-16 10:01:07 +09:00
kkigomi 5036254b69 php 5.2 호환성 문제 수정 2023-08-13 21:48:08 +09:00
kkigomi 2ae4046d29 영카트 상품 복사 후 shop_admin_itemcopy Event Hook 추가 2023-08-12 19:08:39 +09:00
kkigomi ccdbdebdec 1:1문의 답변 시 qawrite_update Hook에서 답변 글의 ID를 전달하도록 개선 2023-08-11 21:19:42 +09:00
kkigomi 1c4465a692 qa_delete Event Hook에서 실제 삭제된 ID 목록을 전달하도록 개선
`$tmp_array` 목록은 삭제를 요청한 목록이지만 작성자, 답글 등의 이유로 실제 삭제되지 않을 수 있음. 두번째 인자로 실제로 삭제 처리된 목록을 넘겨주도록 개선 함.
2023-08-11 19:41:25 +09:00
kkigomi bcbabf50f2 QA에서 질문글 삭제 시 답변글의 첨부파일 및 썸네일을 삭제하지 못하는 문제 수정
답변글의 정보를 잘못 가져오는 문제로 답변글의 첨부파일, 첨부파일의 썸네일, 에디터 이미지의 썸네일을 삭제하지 못하는 문제 고침
2023-08-11 19:29:50 +09:00
maycactus 3da5145bef Fix undefined variable issue in mobile login page 2023-08-09 11:48:53 -04:00
thisgun 6868cee8d1 영카트 모바일 주문시 SQL Injection 취약점 수정 2023-08-07 10:26:50 +09:00
kkigomi 870dcec68d owl.video.play.png 파일이 없어 발생하는 오류 수정
https://github.com/OwlCarousel2/OwlCarousel2/blob/develop/dist/assets/owl.video.play.png
2023-08-01 00:38:45 +09:00
kkigomiandGitHub 4735d62770 adm/view.php 파일에서 $sub_menu 등 변수 위치를 변경
`$sub_menu`, `$g5['title']` 변수를 생성처리가 `admin_request_handler_*` Event Hook 보다 이후에 실행되어 해당 Hook에서 이를 활용하지 못하는 문제를 해결합니다.
2023-07-26 12:13:07 +09:00
maycactus 2c88ef6d13 Update CSS styles for improved consistency
This commit updates the CSS styles for better consistency and correctness. The changes involve:

1. Replacing 'z-index: -1px' with 'z-index: -1' to correct the z-index value. The value should be an integer, not a length with a unit.
2. Replacing 'font-size:bold;' with 'font-weight:bold;' to set the font weight to bold properly.

Please note that I haven't tested the changes yet, but they should have a positive impact on the overall appearance and functionality of the elements styled with these CSS rules.
2023-07-25 14:06:43 -04:00
maycactus 12ce06c2d2 Refactor CSS styles for improved readability
This commit refactors the CSS styles by removing unnecessary closing parentheses from the box-shadow declarations and redundant empty color declarations. Additionally, it corrects the missing CSS property values in the .btn_submit and #mb_login_notmb p rules for proper styling.

The changes do not affect the visual appearance of the elements but make the CSS code cleaner and more maintainable.
2023-07-25 13:50:30 -04:00
maycactus 3a7d06b19e Fix array element and string offset access using square brackets
In accordance with the PHP RFC deprecating the curly brace syntax for accessing array elements and string offsets, this commit replaces all instances of {} with [].

By making this change, we ensure the codebase remains compliant with the recommended syntax, enhancing code readability and maintainability. The deprecation of curly brace syntax was done to align with best practices and promote a consistent code style.
2023-07-25 13:34:00 -04:00
thisgun 641656047d 버전 5.5.8.3.2 수정 2023-07-17 12:12:52 +09:00
thisgun 3becc03d23 CHEditor에서 이미지 업로드시 서버 내 경로가 노출되는 문제 수정 #248 2023-07-17 11:55:45 +09:00
thisgun 6eaa6ee22a Merge branch 'master' of github.com:gnuboard/gnuboard5 2023-07-17 11:54:08 +09:00
thisgunandGitHub a8524eb070 Merge pull request #243 from kkigomi/feature/admin-hooks
관리자 페이지 및 일부 데이터 업데이트 시 Event hook 추가
2023-07-17 11:47:50 +09:00
thisgunandGitHub db9b4ffd50 Merge pull request #246 from kkigomi/feature/cheditor-hook-get_editor_upload_url
CHEditor에서 이미지 업로드시 get_editor_upload_url Hook에 파일의 정보 추가
2023-07-17 11:47:37 +09:00
thisgunandGitHub 9416b7dd9a Merge pull request #250 from kkigomi/patch-1
add_replace()에서 $args 값을 1로 변경
2023-07-17 11:47:24 +09:00
thisgunandGitHub 1634065870 Merge pull request #252 from kkigomi/patch-3
get_microtime 함수 개선
2023-07-17 11:47:11 +09:00
thisgun 14af11d0fa 옵션 재고 이후에 상품 재고를 체크하도록 수정 2023-07-11 11:17:29 +09:00
thisgun ec3fdce5c7 장바구니 업데이트시 sum_qty변수 형변환 수정 2023-07-11 10:41:33 +09:00
thisgun 79ce9ec984 6월 25일 제보한 영카트 보안취약점 수정 #249 2023-07-11 10:33:39 +09:00
thisgun 8eb1d46be1 저장소에 포함된 의미없는 파일삭제 #245 2023-07-10 18:38:22 +09:00
thisgun cbdaccbdec Merge branch 'master' of github.com:gnuboard/gnuboard5 2023-07-10 18:03:15 +09:00
thisgunandGitHub ff6b160774 Merge pull request #244 from kkigomi/patch-2
Hook에 Closure를 리스너로 등록할 수 있도록 개선
2023-07-10 12:38:34 +09:00
kkigomiandGitHub f96ff445b9 get_microtime 함수 개선
불필요한 연산 제거
2023-07-09 05:05:12 +09:00
kkigomiandGitHub 6e684e80f2 add_replace()에서 $args 값을 1로 변경
replace hook은 값을 반환해야하므로 항상 최소 1개의 인자를 받아야하지만 기본 값이 0이어서 매번 이를 변경해줘야하는 문제
2023-07-08 06:58:03 +09:00
thisgun ffc8706a76 [KVE-2023-5153] XSS 취약점 수정 2023-07-04 18:37:23 +09:00
kkigomi 8ec09b0059 CHEditor에서 이미지 업로드시 get_editor_upload_url Hook에 파일의 정보 추가
`get_editor_upload_url` Hook의 세번째 인자에 파일의 추가 정보를 전달.
smarteditor2에서 정의한 것과 동일한 유형으로 데이터를 담음.
2023-06-30 22:18:30 +09:00
kkigomi af64737b63 PRS-12 코드 포맷 2023-06-30 22:02:42 +09:00
kkigomiandGitHub 81792d2595 Hook에 Closure를 리스너로 등록할 수 있도록 개선 2023-06-26 22:34:49 +09:00
kkigomi bbbc568db8 관리자 페이지 및 일부 데이터 업데이트 시 Event hook 추가 2023-06-25 03:49:10 +09:00
thisgun 4eba618a82 Merge branch 'master' of github.com:gnuboard/gnuboard5 2023-06-19 17:55:43 +09:00
thisgun accf20044f 버전 5.5.8.3.1 수정 2023-06-19 17:52:34 +09:00
thisgun aaadf1487d 영카트 쿠폰 발행 시 UX 오류 #230 2023-06-19 17:36:14 +09:00
thisgun 44798a4ef5 설치시 자동생성되는 게시판 글읽기 포인트로 인한 문제 수정 #231 2023-06-19 17:20:51 +09:00
thisgun 992641dfad 구글 서치 콘솔에 맞지 않는 게시판xml 수정 #234 2023-06-19 17:00:42 +09:00
thisgunandGitHub 451ece8d8c Merge pull request #238 from kkigomi/feature/html-purifier
Hook - HTMLPurifier 설정을 변경할 수 있는 `html_purifier_config` 이벤트 Hook 추가
2023-06-19 15:10:39 +09:00
thisgun bcda18cbd5 1:1문의 삭제시 hook 이벤트 추가 2023-06-19 15:08:56 +09:00
thisgun 2a8f5f6035 상품 검색 페이지 xss 취약점 수정 2023-06-16 17:20:18 +09:00
thisgun f4821aa49a 비회원으로 상품을 장바구니에 담아두고 후 로그인하면 mb_id가 누락되는 문제 수정 2023-06-15 17:16:47 +09:00
kkigomi 476b06792a 코드 포맷 2023-06-01 18:15:48 +09:00
kkigomi 9489254bbf html_purifier() 함수에 html_purifier_config 이벤트 Hook 추가
리스너에서는 첫번째 인자로 `HTMLPurifier_Config` 객체를 받아 설정을 변경할 수 있다
2023-06-01 18:15:26 +09:00
thisgun 8bcac60bda 버전 5.5.8.3 수정 2023-04-17 14:42:58 +09:00
thisgun fe03163cce XSS 취약점 수정 2023-04-17 14:41:38 +09:00
thisgun 8ecc5ba241 min_wr_num Undefined 경고문이 나올수 있는 코드 수정 2023-04-17 12:29:42 +09:00
thisgun 4204f7970e 안드로이드 chrome 112.0.5615.48에서 상품옵션선택이 안되는 문제 수정 2023-04-17 12:16:12 +09:00
thisgun 9cd2841006 버전 5.5.8.2.9 수정 2023-04-13 20:11:54 +09:00
thisgun 4b92543c61 KG이니시스 TX모듈을 사용하는 코드를 API로 전환 건 2023-04-13 20:10:48 +09:00
thisgun b01adc51c7 버전 5.5.8.2.8 수정 2023-03-23 12:54:34 +09:00
thisgun bfdc48b021 NHN_KCP 애플페이 추가 2023-03-23 12:52:40 +09:00
thisgun 10b3a9c841 Merge branch 'master' of github.com:gnuboard/gnuboard5 2023-03-23 12:25:33 +09:00
thisgunandGitHub 3f27a5e32d Merge pull request #223 from kkigomi/feature/rewrite
rewrite 룰 제안에 Hook 추가
2023-03-23 12:18:59 +09:00
thisgun a904c5c634 Object cache의 데이터를 삭제하지 못하는 버그 수정 2023-03-23 12:00:05 +09:00
thisgun d603f2d5b3 undefined error 경고문에 따른 return_url변수 초기화 2023-03-23 11:19:29 +09:00
thisgun 275f7e5d8a PHP8버전대에서 경고문 나오는 FAQ Undefined variable 수정 2023-03-23 11:10:28 +09:00
thisgun 2595a7a45d 모바일 위시리스트 상품 URL 코드 수정 2023-03-21 19:07:44 +09:00
thisgun cb346b08c1 쇼핑몰 상품 주문시 it_name 에 태그가 포함되어있는 경우 발생되는 오류 수정 2023-03-21 19:00:13 +09:00
kkigomiandGitHub 3db2dc8be3 Merge branch 'gnuboard:master' into feature/rewrite 2023-01-25 19:32:47 +09:00
kkigomi b3451f1cc2 rewrite 설정 코드 보기에서 기존 hook 보다 앞선 출력 위치에 hook 추가
기존 rule 때문에 hook으로 추가해도 접근 차단등의 룰을 적용하지 못하는 문제를 해결하기 위함
- add_nginx_conf_pre_rules
- add_mod_rewrite_pre_rules
2023-01-25 16:58:00 +09:00
kkigomi b557483e1d 코드 포맷. PSR-12 2023-01-25 16:53:10 +09:00
thisgun d28be44108 버전 5.5.8.2.7 수정 2023-01-25 16:52:29 +09:00
thisgun f61d6cc09a SMS관리 휴대폰관리 페이지 PHP특정버전에서 오류나는 문제 수정 2023-01-25 12:30:13 +09:00
thisgun 6fa0f0e704 정렬 기능에 짧은 주소 적용 오류를 다시 수정 2023-01-25 11:06:07 +09:00
thisgun 66039a4b37 PHP8 버전에서 경고문이 나오는 코드 수정 2023-01-20 11:17:50 +09:00
thisgun aca4733b12 쇼핑몰 장바구니에서 재고 이상 주문할수 있는 오류 수정 2023-01-20 11:17:20 +09:00
118 changed files with 1589 additions and 7434 deletions
+3 -4
View File
@@ -617,13 +617,12 @@ if (!$member['mb_id']) {
}
}
// 관리자의 아이피, 브라우저와 다르다면 세션을 끊고 관리자에게 메일을 보낸다.
$admin_key = md5($member['mb_datetime'] . get_real_client_ip() . $_SERVER['HTTP_USER_AGENT']);
if (get_session('ss_mb_key') !== $admin_key) {
// 관리자의 클라이언트를 검증하여 일치하지 않으면 세션을 끊고 관리자에게 메일을 보낸다.
if (!verify_mb_key($member)) {
session_destroy();
include_once G5_LIB_PATH . '/mailer.lib.php';
// 메일 알림
mailer($member['mb_nick'], $member['mb_email'], $member['mb_email'], 'XSS 공격 알림', $_SERVER['REMOTE_ADDR'] . ' 아이피로 XSS 공격이 있었습니다.<br><br>관리자 권한을 탈취하려는 접근이므로 주의하시기 바랍니다.<br><br>해당 아이피는 차단하시고 의심되는 게시물이 있는지 확인하시기 바랍니다.' . G5_URL, 0);
+1 -1
View File
@@ -5,7 +5,7 @@ if (!defined('_GNUBOARD_')) {
// 그누보드5.4.5.5 버전과 영카트5.4.5.5.1 버전이 통합됨에 따라 그누보드 버전만 표시
// $print_version = defined('G5_YOUNGCART_VER') ? 'YoungCart Version '.G5_YOUNGCART_VER : 'Version '.G5_GNUBOARD_VER;
$print_version = 'Version ' . G5_GNUBOARD_VER;
$print_version = ($is_admin == 'super') ? 'Version ' . G5_GNUBOARD_VER : '';
?>
<noscript>
-1
View File
@@ -191,7 +191,6 @@ if ($copy_case == 'schema_data_both') {
sql_query($sql, false);
// 4.00.01
// 위의 코드는 같은 테이블명을 사용하였다는 오류가 발생함. (희한하네 ㅡㅡ;)
$sql = " select * from {$g5['board_file_table']} where bo_table = '$bo_table' ";
$result = sql_query($sql, false);
for ($i = 0; $row = sql_fetch_array($result); $i++) {
+3
View File
@@ -113,17 +113,20 @@ if ($w == "") {
set co_id = '$co_id',
$sql_common ";
sql_query($sql);
run_event('admin_content_created', $co_id);
} elseif ($w == "u") {
$sql = " update {$g5['content_table']}
set $sql_common
where co_id = '$co_id' ";
sql_query($sql);
run_event('admin_content_updated', $co_id);
} elseif ($w == "d") {
@unlink(G5_DATA_PATH . "/content/{$co_id}_h");
@unlink(G5_DATA_PATH . "/content/{$co_id}_t");
$sql = " delete from {$g5['content_table']} where co_id = '$co_id' ";
sql_query($sql);
run_event('admin_content_deleted', $co_id);
}
if (function_exists('get_admin_captcha_by')) {
+12
View File
@@ -207,6 +207,18 @@ if (defined('G5_USE_SHOP') && G5_USE_SHOP) {
}
}
// auth.au_menu 컬럼 크기 조정
$sql = " SHOW COLUMNS FROM `{$g5['auth_table']}` LIKE 'au_menu' ";
$row = sql_fetch($sql);
if (
stripos($row['Type'], 'varchar') !== false
&& (int) preg_replace('/[^0-9]/', '', $row['Type']) <= 50
) {
sql_query(" ALTER TABLE `{$g5['auth_table']}` CHANGE `au_menu` `au_menu` VARCHAR(50) NOT NULL; ", true);
$is_check = true;
}
$is_check = run_replace('admin_dbupgrade', $is_check);
$db_upgrade_msg = $is_check ? 'DB 업그레이드가 완료되었습니다.' : '더 이상 업그레이드 할 내용이 없습니다.<br>현재 DB 업그레이드가 완료된 상태입니다.';
+4
View File
@@ -30,6 +30,7 @@ if ($w == "")
sql_query($sql);
$fa_id = sql_insert_id();
run_event('admin_faq_item_created', $fa_id, $fm_id);
}
else if ($w == "u")
{
@@ -37,11 +38,14 @@ else if ($w == "u")
set $sql_common
where fa_id = '$fa_id' ";
sql_query($sql);
run_event('admin_faq_item_updated', $fa_id, $fm_id);
}
else if ($w == "d")
{
$sql = " delete from {$g5['faq_table']} where fa_id = '$fa_id' ";
sql_query($sql);
run_event('admin_faq_item_deleted', $fa_id, $fm_id);
}
if ($w == 'd')
+6
View File
@@ -49,9 +49,13 @@ if ($w == "") {
sql_query($sql);
$fm_id = sql_insert_id();
run_event('admin_faq_master_created', $fm_id);
} elseif ($w == "u") {
$sql = " update {$g5['faq_master_table']} $sql_common where fm_id = '$fm_id' ";
sql_query($sql);
run_event('admin_faq_master_updated', $fm_id);
} elseif ($w == "d") {
@unlink(G5_DATA_PATH . "/faq/{$fm_id}_h");
@unlink(G5_DATA_PATH . "/faq/{$fm_id}_t");
@@ -63,6 +67,8 @@ if ($w == "") {
// FAQ상세삭제
$sql = " delete from {$g5['faq_table']} where fm_id = '$fm_id' ";
sql_query($sql);
run_event('admin_faq_master_deleted', $fm_id);
}
if ($w == "" || $w == "u") {
+298 -277
View File
@@ -3,8 +3,10 @@ $sub_menu = '100000';
require_once './_common.php';
@require_once './safe_check.php';
if (function_exists('social_log_file_delete')) {
social_log_file_delete(86400); //소셜로그인 디버그 파일 24시간 지난것은 삭제
//소셜로그인 디버그 파일 24시간 지난것은 삭제
social_log_file_delete(86400);
}
$g5['title'] = '관리자메인';
@@ -14,304 +16,323 @@ $new_member_rows = 5;
$new_point_rows = 5;
$new_write_rows = 5;
$sql_common = " from {$g5['member_table']} ";
$sql_search = " where (1) ";
if ($is_admin != 'super') {
$sql_search .= " and mb_level <= '{$member['mb_level']}' ";
$addtional_content_before = run_replace('adm_index_addtional_content_before', '', $is_admin, $auth, $member);
if ($addtional_content_before) {
echo $addtional_content_before;
}
if (!$sst) {
$sst = "mb_datetime";
$sod = "desc";
}
if (!auth_check_menu($auth, '200100', 'r', true)) {
$sql_common = " from {$g5['member_table']} ";
$sql_order = " order by {$sst} {$sod} ";
$sql_search = " where (1) ";
$sql = " select count(*) as cnt {$sql_common} {$sql_search} {$sql_order} ";
$row = sql_fetch($sql);
$total_count = $row['cnt'];
// 탈퇴회원수
$sql = " select count(*) as cnt {$sql_common} {$sql_search} and mb_leave_date <> '' {$sql_order} ";
$row = sql_fetch($sql);
$leave_count = $row['cnt'];
// 차단회원수
$sql = " select count(*) as cnt {$sql_common} {$sql_search} and mb_intercept_date <> '' {$sql_order} ";
$row = sql_fetch($sql);
$intercept_count = $row['cnt'];
$sql = " select * {$sql_common} {$sql_search} {$sql_order} limit {$new_member_rows} ";
$result = sql_query($sql);
$colspan = 12;
?>
<section>
<h2>신규가입회원 <?php echo $new_member_rows ?>건 목록</h2>
<div class="local_desc02 local_desc">
총회원수 <?php echo number_format($total_count) ?>명 중 차단 <?php echo number_format($intercept_count) ?>명, 탈퇴 : <?php echo number_format($leave_count) ?>명
</div>
<div class="tbl_head01 tbl_wrap">
<table>
<caption>신규가입회원</caption>
<thead>
<tr>
<th scope="col">회원아이디</th>
<th scope="col">이름</th>
<th scope="col">닉네임</th>
<th scope="col">권한</th>
<th scope="col">포인트</th>
<th scope="col">수신</th>
<th scope="col">공개</th>
<th scope="col">인증</th>
<th scope="col">차단</th>
<th scope="col">그룹</th>
</tr>
</thead>
<tbody>
<?php
for ($i = 0; $row = sql_fetch_array($result); $i++) {
// 접근가능한 그룹수
$sql2 = " select count(*) as cnt from {$g5['group_member_table']} where mb_id = '{$row['mb_id']}' ";
$row2 = sql_fetch($sql2);
$group = "";
if ($row2['cnt']) {
$group = '<a href="./boardgroupmember_form.php?mb_id=' . $row['mb_id'] . '">' . $row2['cnt'] . '</a>';
}
if ($is_admin == 'group') {
$s_mod = '';
$s_del = '';
} else {
$s_mod = '<a href="./member_form.php?$qstr&amp;w=u&amp;mb_id=' . $row['mb_id'] . '">수정</a>';
$s_del = '<a href="./member_delete.php?' . $qstr . '&amp;w=d&amp;mb_id=' . $row['mb_id'] . '&amp;url=' . $_SERVER['SCRIPT_NAME'] . '" onclick="return delete_confirm(this);">삭제</a>';
}
$s_grp = '<a href="./boardgroupmember_form.php?mb_id=' . $row['mb_id'] . '">그룹</a>';
$leave_date = $row['mb_leave_date'] ? $row['mb_leave_date'] : date("Ymd", G5_SERVER_TIME);
$intercept_date = $row['mb_intercept_date'] ? $row['mb_intercept_date'] : date("Ymd", G5_SERVER_TIME);
$mb_nick = get_sideview($row['mb_id'], get_text($row['mb_nick']), $row['mb_email'], $row['mb_homepage']);
$mb_id = $row['mb_id'];
?>
<tr>
<td class="td_mbid"><?php echo $mb_id ?></td>
<td class="td_mbname"><?php echo get_text($row['mb_name']); ?></td>
<td class="td_mbname sv_use">
<div><?php echo $mb_nick ?></div>
</td>
<td class="td_num"><?php echo $row['mb_level'] ?></td>
<td><a href="./point_list.php?sfl=mb_id&amp;stx=<?php echo $row['mb_id'] ?>"><?php echo number_format($row['mb_point']) ?></a></td>
<td class="td_boolean"><?php echo $row['mb_mailling'] ? '예' : '아니오'; ?></td>
<td class="td_boolean"><?php echo $row['mb_open'] ? '예' : '아니오'; ?></td>
<td class="td_boolean"><?php echo preg_match('/[1-9]/', $row['mb_email_certify']) ? '예' : '아니오'; ?></td>
<td class="td_boolean"><?php echo $row['mb_intercept_date'] ? '예' : '아니오'; ?></td>
<td class="td_category"><?php echo $group ?></td>
</tr>
<?php
}
if ($i == 0) {
echo '<tr><td colspan="' . $colspan . '" class="empty_table">자료가 없습니다.</td></tr>';
}
?>
</tbody>
</table>
</div>
<div class="btn_list03 btn_list">
<a href="./member_list.php">회원 전체보기</a>
</div>
</section>
<?php
$sql_common = " from {$g5['board_new_table']} a, {$g5['board_table']} b, {$g5['group_table']} c where a.bo_table = b.bo_table and b.gr_id = c.gr_id ";
if ($gr_id) {
$sql_common .= " and b.gr_id = '$gr_id' ";
}
if (isset($view) && $view) {
if ($view == 'w') {
$sql_common .= " and a.wr_id = a.wr_parent ";
} elseif ($view == 'c') {
$sql_common .= " and a.wr_id <> a.wr_parent ";
if ($is_admin != 'super') {
$sql_search .= " and mb_level <= '{$member['mb_level']}' ";
}
}
$sql_order = " order by a.bn_id desc ";
$sql = " select count(*) as cnt {$sql_common} ";
$row = sql_fetch($sql);
$total_count = $row['cnt'];
if (!$sst) {
$sst = "mb_datetime";
$sod = "desc";
}
$colspan = 5;
?>
$sql_order = " order by {$sst} {$sod} ";
<section>
<h2>최근게시물</h2>
$sql = " SELECT count(*) as cnt {$sql_common} {$sql_search} {$sql_order} ";
$row = sql_fetch($sql);
$total_count = $row['cnt'];
<div class="tbl_head01 tbl_wrap">
<table>
<caption>최근게시물</caption>
<thead>
<tr>
<th scope="col">그룹</th>
<th scope="col">게시판</th>
<th scope="col">제목</th>
<th scope="col">이름</th>
<th scope="col">일시</th>
</tr>
</thead>
<tbody>
<?php
$sql = " select a.*, b.bo_subject, c.gr_subject, c.gr_id {$sql_common} {$sql_order} limit {$new_write_rows} ";
$result = sql_query($sql);
for ($i = 0; $row = sql_fetch_array($result); $i++) {
$tmp_write_table = $g5['write_prefix'] . $row['bo_table'];
// 탈퇴회원수
$sql = " select count(*) as cnt {$sql_common} {$sql_search} and mb_leave_date <> '' {$sql_order} ";
$row = sql_fetch($sql);
$leave_count = $row['cnt'];
// 원글
if ($row['wr_id'] == $row['wr_parent']) {
$comment = "";
$comment_link = "";
$row2 = sql_fetch(" select * from $tmp_write_table where wr_id = '{$row['wr_id']}' ");
// 차단회원수
$sql = " SELECT count(*) as cnt {$sql_common} {$sql_search} and mb_intercept_date <> '' {$sql_order} ";
$row = sql_fetch($sql);
$intercept_count = $row['cnt'];
$name = get_sideview($row2['mb_id'], get_text(cut_str($row2['wr_name'], $config['cf_cut_name'])), $row2['wr_email'], $row2['wr_homepage']);
// 당일인 경우 시간으로 표시함
$datetime = substr($row2['wr_datetime'], 0, 10);
$datetime2 = $row2['wr_datetime'];
if ($datetime == G5_TIME_YMD) {
$datetime2 = substr($datetime2, 11, 5);
} else {
$datetime2 = substr($datetime2, 5, 5);
}
} else // 코멘트
{
$comment = '댓글. ';
$comment_link = '#c_' . $row['wr_id'];
$row2 = sql_fetch(" select * from {$tmp_write_table} where wr_id = '{$row['wr_parent']}' ");
$row3 = sql_fetch(" select mb_id, wr_name, wr_email, wr_homepage, wr_datetime from {$tmp_write_table} where wr_id = '{$row['wr_id']}' ");
$sql = " SELECT * {$sql_common} {$sql_search} {$sql_order} limit {$new_member_rows} ";
$result = sql_query($sql);
$name = get_sideview($row3['mb_id'], get_text(cut_str($row3['wr_name'], $config['cf_cut_name'])), $row3['wr_email'], $row3['wr_homepage']);
// 당일인 경우 시간으로 표시함
$datetime = substr($row3['wr_datetime'], 0, 10);
$datetime2 = $row3['wr_datetime'];
if ($datetime == G5_TIME_YMD) {
$datetime2 = substr($datetime2, 11, 5);
} else {
$datetime2 = substr($datetime2, 5, 5);
}
}
?>
$colspan = 12;
?>
<section>
<h2>신규가입회원 <?php echo $new_member_rows ?>건 목록</h2>
<div class="local_desc02 local_desc">
총회원수 <?php echo number_format($total_count) ?>명 중 차단 <?php echo number_format($intercept_count) ?>명, 탈퇴 : <?php echo number_format($leave_count) ?>명
</div>
<div class="tbl_head01 tbl_wrap">
<table>
<caption>신규가입회원</caption>
<thead>
<tr>
<td class="td_category"><a href="<?php echo G5_BBS_URL ?>/new.php?gr_id=<?php echo $row['gr_id'] ?>"><?php echo cut_str($row['gr_subject'], 10) ?></a></td>
<td class="td_category"><a href="<?php echo get_pretty_url($row['bo_table']) ?>"><?php echo cut_str($row['bo_subject'], 20) ?></a></td>
<td><a href="<?php echo get_pretty_url($row['bo_table'], $row2['wr_id']); ?><?php echo $comment_link ?>"><?php echo $comment ?><?php echo conv_subject($row2['wr_subject'], 100) ?></a></td>
<td class="td_mbname">
<div><?php echo $name ?></div>
</td>
<td class="td_datetime"><?php echo $datetime ?></td>
<th scope="col">회원아이디</th>
<th scope="col">이름</th>
<th scope="col">닉네임</th>
<th scope="col">권한</th>
<th scope="col">포인트</th>
<th scope="col">수신</th>
<th scope="col">공개</th>
<th scope="col">인증</th>
<th scope="col">차단</th>
<th scope="col">그룹</th>
</tr>
<?php
}
if ($i == 0) {
echo '<tr><td colspan="' . $colspan . '" class="empty_table">자료가 없습니다.</td></tr>';
}
?>
</tbody>
</table>
</div>
<div class="btn_list03 btn_list">
<a href="<?php echo G5_BBS_URL ?>/new.php">최근게시물 더보기</a>
</div>
</section>
<?php
$sql_common = " from {$g5['point_table']} ";
$sql_search = " where (1) ";
$sql_order = " order by po_id desc ";
$sql = " select count(*) as cnt {$sql_common} {$sql_search} {$sql_order} ";
$row = sql_fetch($sql);
$total_count = $row['cnt'];
$sql = " select * {$sql_common} {$sql_search} {$sql_order} limit {$new_point_rows} ";
$result = sql_query($sql);
$colspan = 7;
?>
<section>
<h2>최근 포인트 발생내역</h2>
<div class="local_desc02 local_desc">
전체 <?php echo number_format($total_count) ?> 건 중 <?php echo $new_point_rows ?>건 목록
</div>
<div class="tbl_head01 tbl_wrap">
<table>
<caption>최근 포인트 발생내역</caption>
<thead>
<tr>
<th scope="col">회원아이디</th>
<th scope="col">이름</th>
<th scope="col">닉네임</th>
<th scope="col">일시</th>
<th scope="col">포인트 내용</th>
<th scope="col">포인트</th>
<th scope="col">포인트합</th>
</tr>
</thead>
<tbody>
<?php
$row2['mb_id'] = '';
for ($i = 0; $row = sql_fetch_array($result); $i++) {
if ($row2['mb_id'] != $row['mb_id']) {
$sql2 = " select mb_id, mb_name, mb_nick, mb_email, mb_homepage, mb_point from {$g5['member_table']} where mb_id = '{$row['mb_id']}' ";
</thead>
<tbody>
<?php
for ($i = 0; $row = sql_fetch_array($result); $i++) {
// 접근가능한 그룹수
$sql2 = " SELECT count(*) as cnt from {$g5['group_member_table']} where mb_id = '{$row['mb_id']}' ";
$row2 = sql_fetch($sql2);
$group = "";
if ($row2['cnt']) {
$group = '<a href="./boardgroupmember_form.php?mb_id=' . $row['mb_id'] . '">' . $row2['cnt'] . '</a>';
}
if ($is_admin == 'group') {
$s_mod = '';
$s_del = '';
} else {
$s_mod = '<a href="./member_form.php?$qstr&amp;w=u&amp;mb_id=' . $row['mb_id'] . '">수정</a>';
$s_del = '<a href="./member_delete.php?' . $qstr . '&amp;w=d&amp;mb_id=' . $row['mb_id'] . '&amp;url=' . $_SERVER['SCRIPT_NAME'] . '" onclick="return delete_confirm(this);">삭제</a>';
}
$s_grp = '<a href="./boardgroupmember_form.php?mb_id=' . $row['mb_id'] . '">그룹</a>';
$leave_date = $row['mb_leave_date'] ? $row['mb_leave_date'] : date("Ymd", G5_SERVER_TIME);
$intercept_date = $row['mb_intercept_date'] ? $row['mb_intercept_date'] : date("Ymd", G5_SERVER_TIME);
$mb_nick = get_sideview($row['mb_id'], get_text($row['mb_nick']), $row['mb_email'], $row['mb_homepage']);
$mb_id = $row['mb_id'];
?>
<tr>
<td class="td_mbid"><?php echo $mb_id ?></td>
<td class="td_mbname"><?php echo get_text($row['mb_name']); ?></td>
<td class="td_mbname sv_use">
<div><?php echo $mb_nick ?></div>
</td>
<td class="td_num"><?php echo $row['mb_level'] ?></td>
<td><a href="./point_list.php?sfl=mb_id&amp;stx=<?php echo $row['mb_id'] ?>"><?php echo number_format($row['mb_point']) ?></a></td>
<td class="td_boolean"><?php echo $row['mb_mailling'] ? '예' : '아니오'; ?></td>
<td class="td_boolean"><?php echo $row['mb_open'] ? '예' : '아니오'; ?></td>
<td class="td_boolean"><?php echo preg_match('/[1-9]/', $row['mb_email_certify']) ? '예' : '아니오'; ?></td>
<td class="td_boolean"><?php echo $row['mb_intercept_date'] ? '예' : '아니오'; ?></td>
<td class="td_category"><?php echo $group ?></td>
</tr>
<?php
}
$mb_nick = get_sideview($row['mb_id'], $row2['mb_nick'], $row2['mb_email'], $row2['mb_homepage']);
$link1 = $link2 = "";
if (!preg_match("/^\@/", $row['po_rel_table']) && $row['po_rel_table']) {
$link1 = '<a href="' . get_pretty_url($row['po_rel_table'], $row['po_rel_id']) . '" target="_blank">';
$link2 = '</a>';
if ($i == 0) {
echo '<tr><td colspan="' . $colspan . '" class="empty_table">자료가 없습니다.</td></tr>';
}
?>
?>
</tbody>
</table>
</div>
<div class="btn_list03 btn_list">
<a href="./member_list.php">회원 전체보기</a>
</div>
</section>
<?php
} //endif 최신 회원
if (!auth_check_menu($auth, '300100', 'r', true)) {
$sql_common = " from {$g5['board_new_table']} a, {$g5['board_table']} b, {$g5['group_table']} c where a.bo_table = b.bo_table and b.gr_id = c.gr_id ";
if ($gr_id) {
$sql_common .= " and b.gr_id = '{$gr_id}' ";
}
if (isset($view) && $view) {
if ($view == 'w') {
$sql_common .= " and a.wr_id = a.wr_parent ";
} elseif ($view == 'c') {
$sql_common .= " and a.wr_id <> a.wr_parent ";
}
}
$sql_order = " order by a.bn_id desc ";
$sql = " SELECT count(*) as cnt {$sql_common} ";
$row = sql_fetch($sql);
$total_count = $row['cnt'];
$colspan = 5;
?>
<section>
<h2>최근게시물</h2>
<div class="tbl_head01 tbl_wrap">
<table>
<caption>최근게시물</caption>
<thead>
<tr>
<td class="td_mbid"><a href="./point_list.php?sfl=mb_id&amp;stx=<?php echo $row['mb_id'] ?>"><?php echo $row['mb_id'] ?></a></td>
<td class="td_mbname"><?php echo get_text($row2['mb_name']); ?></td>
<td class="td_name sv_use">
<div><?php echo $mb_nick ?></div>
</td>
<td class="td_datetime"><?php echo $row['po_datetime'] ?></td>
<td><?php echo $link1 . $row['po_content'] . $link2 ?></td>
<td class="td_numbig"><?php echo number_format($row['po_point']) ?></td>
<td class="td_numbig"><?php echo number_format($row['po_mb_point']) ?></td>
<th scope="col">그룹</th>
<th scope="col">게시판</th>
<th scope="col">제목</th>
<th scope="col">이름</th>
<th scope="col">일시</th>
</tr>
</thead>
<tbody>
<?php
$sql = " SELECT a.*, b.bo_subject, c.gr_subject, c.gr_id {$sql_common} {$sql_order} limit {$new_write_rows} ";
$result = sql_query($sql);
for ($i = 0; $row = sql_fetch_array($result); $i++) {
$tmp_write_table = $g5['write_prefix'] . $row['bo_table'];
<?php
}
if ($row['wr_id'] == $row['wr_parent']) {
// 원글
$comment = "";
$comment_link = "";
$row2 = sql_fetch(" SELECT * from {$tmp_write_table} where wr_id = '{$row['wr_id']}' ");
if ($i == 0) {
echo '<tr><td colspan="' . $colspan . '" class="empty_table">자료가 없습니다.</td></tr>';
}
?>
</tbody>
</table>
</div>
$name = get_sideview($row2['mb_id'], get_text(cut_str($row2['wr_name'], $config['cf_cut_name'])), $row2['wr_email'], $row2['wr_homepage']);
// 당일인 경우 시간으로 표시함
$datetime = substr($row2['wr_datetime'], 0, 10);
$datetime2 = $row2['wr_datetime'];
if ($datetime == G5_TIME_YMD) {
$datetime2 = substr($datetime2, 11, 5);
} else {
$datetime2 = substr($datetime2, 5, 5);
}
} else {
// 코멘트
$comment = '댓글. ';
$comment_link = '#c_' . $row['wr_id'];
$row2 = sql_fetch(" SELECT * from {$tmp_write_table} where wr_id = '{$row['wr_parent']}' ");
$row3 = sql_fetch(" SELECT mb_id, wr_name, wr_email, wr_homepage, wr_datetime from {$tmp_write_table} where wr_id = '{$row['wr_id']}' ");
<div class="btn_list03 btn_list">
<a href="./point_list.php">포인트내역 전체보기</a>
</div>
</section>
$name = get_sideview($row3['mb_id'], get_text(cut_str($row3['wr_name'], $config['cf_cut_name'])), $row3['wr_email'], $row3['wr_homepage']);
// 당일인 경우 시간으로 표시함
$datetime = substr($row3['wr_datetime'], 0, 10);
$datetime2 = $row3['wr_datetime'];
if ($datetime == G5_TIME_YMD) {
$datetime2 = substr($datetime2, 11, 5);
} else {
$datetime2 = substr($datetime2, 5, 5);
}
}
?>
<?php
require_once './admin.tail.php';
<tr>
<td class="td_category"><a href="<?php echo G5_BBS_URL ?>/new.php?gr_id=<?php echo $row['gr_id'] ?>"><?php echo cut_str($row['gr_subject'], 10) ?></a></td>
<td class="td_category"><a href="<?php echo get_pretty_url($row['bo_table']) ?>"><?php echo cut_str($row['bo_subject'], 20) ?></a></td>
<td><a href="<?php echo get_pretty_url($row['bo_table'], $row2['wr_id']); ?><?php echo $comment_link ?>"><?php echo $comment ?><?php echo conv_subject($row2['wr_subject'], 100) ?></a></td>
<td class="td_mbname">
<div><?php echo $name ?></div>
</td>
<td class="td_datetime"><?php echo $datetime ?></td>
</tr>
<?php
}
if ($i == 0) {
echo '<tr><td colspan="' . $colspan . '" class="empty_table">자료가 없습니다.</td></tr>';
}
?>
</tbody>
</table>
</div>
<div class="btn_list03 btn_list">
<a href="<?php echo G5_BBS_URL ?>/new.php">최근게시물 더보기</a>
</div>
</section>
<?php
} //endif 최근게시물
if (!auth_check_menu($auth, '200200', 'r', true)) {
$sql_common = " from {$g5['point_table']} ";
$sql_search = " where (1) ";
$sql_order = " order by po_id desc ";
$sql = " SELECT count(*) as cnt {$sql_common} {$sql_search} {$sql_order} ";
$row = sql_fetch($sql);
$total_count = $row['cnt'];
$sql = " SELECT * {$sql_common} {$sql_search} {$sql_order} limit {$new_point_rows} ";
$result = sql_query($sql);
$colspan = 7;
?>
<section>
<h2>최근 포인트 발생내역</h2>
<div class="local_desc02 local_desc">
전체 <?php echo number_format($total_count) ?> 건 중 <?php echo $new_point_rows ?>건 목록
</div>
<div class="tbl_head01 tbl_wrap">
<table>
<caption>최근 포인트 발생내역</caption>
<thead>
<tr>
<th scope="col">회원아이디</th>
<th scope="col">이름</th>
<th scope="col">닉네임</th>
<th scope="col">일시</th>
<th scope="col">포인트 내용</th>
<th scope="col">포인트</th>
<th scope="col">포인트합</th>
</tr>
</thead>
<tbody>
<?php
$row2['mb_id'] = '';
for ($i = 0; $row = sql_fetch_array($result); $i++) {
if ($row2['mb_id'] != $row['mb_id']) {
$sql2 = " SELECT mb_id, mb_name, mb_nick, mb_email, mb_homepage, mb_point from {$g5['member_table']} where mb_id = '{$row['mb_id']}' ";
$row2 = sql_fetch($sql2);
}
$mb_nick = get_sideview($row['mb_id'], $row2['mb_nick'], $row2['mb_email'], $row2['mb_homepage']);
$link1 = $link2 = "";
if (!preg_match("/^\@/", $row['po_rel_table']) && $row['po_rel_table']) {
$link1 = '<a href="' . get_pretty_url($row['po_rel_table'], $row['po_rel_id']) . '" target="_blank">';
$link2 = '</a>';
}
?>
<tr>
<td class="td_mbid"><a href="./point_list.php?sfl=mb_id&amp;stx=<?php echo $row['mb_id'] ?>"><?php echo $row['mb_id'] ?></a></td>
<td class="td_mbname"><?php echo get_text($row2['mb_name']); ?></td>
<td class="td_name sv_use">
<div><?php echo $mb_nick ?></div>
</td>
<td class="td_datetime"><?php echo $row['po_datetime'] ?></td>
<td><?php echo $link1 . $row['po_content'] . $link2 ?></td>
<td class="td_numbig"><?php echo number_format($row['po_point']) ?></td>
<td class="td_numbig"><?php echo number_format($row['po_mb_point']) ?></td>
</tr>
<?php
}
if ($i == 0) {
echo '<tr><td colspan="' . $colspan . '" class="empty_table">자료가 없습니다.</td></tr>';
}
?>
</tbody>
</table>
</div>
<div class="btn_list03 btn_list">
<a href="./point_list.php">포인트내역 전체보기</a>
</div>
</section>
<?php
} //endif
$addtional_content_after = run_replace('adm_index_addtional_content_after', '', $is_admin, $auth, $member);
if ($addtional_content_after) {
echo $addtional_content_after;
}
require_once './admin.tail.php';
+1
View File
@@ -19,6 +19,7 @@ for ($i = 0; $i < $post_count_chk; $i++) {
$sql = " delete from {$g5['mail_table']} where ma_id = '$ma_id' ";
sql_query($sql);
run_event('admin_mail_deleted', $ma_id);
}
goto_url('./mail_list.php');
+7
View File
@@ -21,6 +21,10 @@ if ($w == '') {
ma_time = '" . G5_TIME_YMDHIS . "',
ma_ip = '{$_SERVER['REMOTE_ADDR']}' ";
sql_query($sql);
$ma_id = sql_insert_id();
run_event('admin_mail_created', $ma_id);
} elseif ($w == 'u') {
$sql = " update {$g5['mail_table']}
set ma_subject = '{$ma_subject}',
@@ -29,9 +33,12 @@ if ($w == '') {
ma_ip = '{$_SERVER['REMOTE_ADDR']}'
where ma_id = '{$ma_id}' ";
sql_query($sql);
run_event('admin_mail_updated', $ma_id);
} elseif ($w == 'd') {
$sql = " delete from {$g5['mail_table']} where ma_id = '{$ma_id}' ";
sql_query($sql);
run_event('admin_mail_deleted', $ma_id);
}
goto_url('./mail_list.php');
+3 -1
View File
@@ -59,14 +59,16 @@ $sql_common = " nw_device = '{$posts['nw_device']}',
if ($w == "") {
$sql = " insert {$g5['new_win_table']} set $sql_common ";
sql_query($sql);
$nw_id = sql_insert_id();
run_event('admin_newwin_created', $nw_id);
} elseif ($w == "u") {
$sql = " update {$g5['new_win_table']} set $sql_common where nw_id = '$nw_id' ";
sql_query($sql);
run_event('admin_newwin_updated', $nw_id);
} elseif ($w == "d") {
$sql = " delete from {$g5['new_win_table']} where nw_id = '$nw_id' ";
sql_query($sql);
run_event('admin_newwin_deleted', $nw_id);
}
if ($w == "d") {
+2
View File
@@ -108,6 +108,8 @@ $sql = " update {$g5['qa_config_table']}
qa_5 = '{$_POST['qa_5']}' ";
sql_query($sql);
run_event('admin_qa_config_updated');
if (function_exists('get_admin_captcha_by')) {
get_admin_captcha_by('remove');
}
+3
View File
@@ -193,6 +193,7 @@ if ($w == "")
ca_name = '$ca_name',
$sql_common ";
sql_query($sql);
run_event('shop_admin_category_created', $ca_id);
}
else if ($w == "u")
{
@@ -212,6 +213,7 @@ else if ($w == "u")
$sql .= " and ca_mb_id = '{$member['mb_id']}' ";
sql_query($sql);
}
run_event('shop_admin_category_updated', $ca_id);
}
else if ($w == "d")
{
@@ -243,6 +245,7 @@ else if ($w == "d")
// 분류 삭제
$sql = " delete from {$g5['g5_shop_category_table']} where ca_id = '$ca_id' ";
sql_query($sql);
run_event('shop_admin_category_deleted', $ca_id);
}
if(function_exists('get_admin_captcha_by'))
+31 -30
View File
@@ -13,8 +13,6 @@ if ($config['cf_sms_use'] && $config['cf_icode_id'] && $config['cf_icode_pw']) {
$userinfo = get_icode_userinfo($config['cf_icode_id'], $config['cf_icode_pw']);
}
check_log_folder(G5_SHOP_PATH.'/inicis/key', false);
$g5['title'] = '쇼핑몰설정';
include_once (G5_ADMIN_PATH.'/admin.head.php');
@@ -68,8 +66,7 @@ if(!isset($default['de_pg_service'])) {
// inicis 필드 추가
if(!isset($default['de_inicis_mid'])) {
sql_query(" ALTER TABLE `{$g5['g5_shop_default_table']}`
ADD `de_inicis_mid` varchar(255) NOT NULL DEFAULT '' AFTER `de_kcp_site_key`,
ADD `de_inicis_admin_key` varchar(255) NOT NULL DEFAULT '' AFTER `de_inicis_mid` ", true);
ADD `de_inicis_mid` varchar(255) NOT NULL DEFAULT '' AFTER `de_kcp_site_key` ", true);
}
// 모바일 초기화면 이미지 줄 수 필드 추가
@@ -137,7 +134,7 @@ if(!isset($default['de_kakaopay_mid'])) {
// 이니시스 웹결제 사인키 필드 추가
if(!isset($default['de_inicis_sign_key'])) {
sql_query(" ALTER TABLE `{$g5['g5_shop_default_table']}`
ADD `de_inicis_sign_key` varchar(255) NOT NULL DEFAULT '' AFTER `de_inicis_admin_key` ", true);
ADD `de_inicis_sign_key` varchar(255) NOT NULL DEFAULT '' ", true);
}
// 네이버페이 필드추가
@@ -202,6 +199,14 @@ if( ! isset($default['de_easy_pay_services']) ){
sql_query($sql, false);
}
// KG 이니시스 iniapi_key 추가
if( ! isset($default['de_inicis_iniapi_key']) ){
$sql = "ALTER TABLE `{$g5['g5_shop_default_table']}`
ADD COLUMN `de_inicis_iniapi_key` VARCHAR(30) NOT NULL DEFAULT '' AFTER `de_inicis_sign_key`,
ADD COLUMN `de_inicis_iniapi_iv` VARCHAR(30) NOT NULL DEFAULT '' AFTER `de_inicis_iniapi_key`; ";
sql_query($sql, false);
}
if( function_exists('pg_setting_check') ){
pg_setting_check(true);
}
@@ -781,10 +786,11 @@ if(!$default['de_kakaopay_cancelpwd']){
<tr class="pg_info_fld kcp_info_fld">
<th scope="row"><label for="de_kcp_easy_pays">NHN KCP 간편결제</label></th>
<td>
<?php echo help("체크시 NHN KCP 간편결제들을 활성화 합니다.\nNHN_KCP > 네이버페이, 카카오페이는 테스트결제가 되지 않습니다."); ?>
<?php echo help("체크시 NHN KCP 간편결제들을 활성화 합니다.\nNHN_KCP > 네이버페이, 카카오페이는 테스트결제가 되지 않습니다.\n애플페이는 IOS 기기에 모바일결제만 가능합니다."); ?>
<input type="checkbox" id="de_easy_nhnkcp_payco" name="de_easy_pays[]" value="nhnkcp_payco" <?php if(stripos($default['de_easy_pay_services'], 'nhnkcp_payco') !== false){ echo 'checked="checked"'; } ?> > <label for="de_easy_nhnkcp_payco" disabled>PAYCO (페이코)</label><br>
<input type="checkbox" id="de_easy_nhnkcp_naverpay" name="de_easy_pays[]" value="nhnkcp_naverpay" <?php if(stripos($default['de_easy_pay_services'], 'nhnkcp_naverpay') !== false){ echo 'checked="checked"'; } ?> > <label for="de_easy_nhnkcp_naverpay">NAVERPAY (네이버페이)</label><br>
<input type="checkbox" id="de_easy_nhnkcp_kakaopay" name="de_easy_pays[]" value="nhnkcp_kakaopay" <?php if(stripos($default['de_easy_pay_services'], 'nhnkcp_kakaopay') !== false){ echo 'checked="checked"'; } ?> > <label for="de_easy_nhnkcp_kakaopay">KAKAOPAY (카카오페이)</label>
<input type="checkbox" id="de_easy_nhnkcp_kakaopay" name="de_easy_pays[]" value="nhnkcp_kakaopay" <?php if(stripos($default['de_easy_pay_services'], 'nhnkcp_kakaopay') !== false){ echo 'checked="checked"'; } ?> > <label for="de_easy_nhnkcp_kakaopay">KAKAOPAY (카카오페이)</label><br>
<input type="checkbox" id="de_easy_nhnkcp_applepay" name="de_easy_pays[]" value="nhnkcp_applepay" <?php if(stripos($default['de_easy_pay_services'], 'nhnkcp_applepay') !== false){ echo 'checked="checked"'; } ?> > <label for="de_easy_nhnkcp_applepay">APPLEPAY (애플페이)</label>
</td>
</tr>
<tr class="pg_info_fld kcp_info_fld">
@@ -829,17 +835,24 @@ if(!$default['de_kakaopay_cancelpwd']){
</td>
</tr>
<tr class="pg_info_fld inicis_info_fld">
<th scope="row"><label for="de_inicis_admin_key">KG이니시스 키패스워드</label></th>
<th scope="row"><label for="de_inicis_sign_key">KG이니시스 웹결제 사인키</label></th>
<td>
<?php echo help("KG이니시스에서 발급받은 4자리 상점 키패스워드를 입력합니다.\nKG이니시스 상점관리자 패스워드와 관련이 없습니다.\n키패스워드 값을 확인하시려면 상점측에 발급된 키파일 안의 readme.txt 파일을 참조해 주십시오"); ?>
<input type="text" name="de_inicis_admin_key" value="<?php echo get_sanitize_input($default['de_inicis_admin_key']); ?>" id="de_inicis_admin_key" class="frm_input" size="5" maxlength="4">
<?php echo help("KG이니시스에서 발급받은 웹결제 사인키를 입력합니다.\n<a href='https://iniweb.inicis.com/' target='_blank'>KG이니시스 가맹점관리자</a> > 상점정보 > 계약정보 > 부가정보의 웹결제 signkey생성 조회 버튼 클릭, 팝업창에서 생성 버튼 클릭 후 해당 값을 입력합니다."); ?>
<input type="text" name="de_inicis_sign_key" value="<?php echo get_sanitize_input($default['de_inicis_sign_key']); ?>" id="de_inicis_sign_key" class="frm_input" size="40" maxlength="50">
</td>
</tr>
<tr class="pg_info_fld inicis_info_fld">
<th scope="row"><label for="de_inicis_sign_key">KG이니시스 웹결제 사인키</label></th>
<th scope="row"><label for="de_inicis_iniapi_key">KG이니시스 INIAPI KEY</label></th>
<td>
<?php echo help("KG이니시스에서 발급받은 웹결제 사인키를 입력합니다.\nKG이니시스 상점관리자 > 상점정보 > 계약정보 > 부가정보의 웹결제 signkey생성 조회 버튼 클릭, 팝업창에서 생성 버튼 클릭 후 해당 값을 입력합니다."); ?>
<input type="text" name="de_inicis_sign_key" value="<?php echo get_sanitize_input($default['de_inicis_sign_key']); ?>" id="de_inicis_sign_key" class="frm_input" size="40" maxlength="50">
<?php echo help("<a href='https://iniweb.inicis.com/' target='_blank'>KG이니시스 가맹점관리자</a> > 상점정보 > 계약정보 > 부가정보 > INIAPI key 생성 조회 하여 KEY를 여기에 입력합니다.\n이 항목은 영카트 주문에서 kg이니시스 PG 결제 취소, 부분취소, 에스크로 배송등록, 현금영수증 발급에 필요합니다."); ?>
<input type="text" name="de_inicis_iniapi_key" value="<?php echo get_sanitize_input($default['de_inicis_iniapi_key']); ?>" id="de_inicis_iniapi_key" class="frm_input" size="30" maxlength="30">
</td>
</tr>
<tr class="pg_info_fld inicis_info_fld">
<th scope="row"><label for="de_inicis_iniapi_iv">KG이니시스 INIAPI IV</label></th>
<td>
<?php echo help("<a href='https://iniweb.inicis.com/' target='_blank'>KG이니시스 가맹점관리자</a> > 상점정보 > 계약정보 > 부가정보 > INIAPI IV 생성 조회 하여 KEY를 여기에 입력합니다.\n이 항목은 영카트 주문에서 kg이니시스 현금영수증 발급에 필요합니다."); ?>
<input type="text" name="de_inicis_iniapi_iv" value="<?php echo get_sanitize_input($default['de_inicis_iniapi_iv']); ?>" id="de_inicis_iniapi_iv" class="frm_input" size="30" maxlength="30">
</td>
</tr>
<tr class="pg_info_fld inicis_info_fld">
@@ -848,7 +861,7 @@ if(!$default['de_kakaopay_cancelpwd']){
<a href="http://sir.kr/main/service/samsungpay.php" target="_blank" class="kg_btn">삼성페이 서비스신청하기</a>
</th>
<td>
<?php echo help("KG이니시스와 별도로 <strong>삼성페이 사용 계약을 하신 경우</strong>에만 체크해주세요. (모바일 주문서 결제수단에 삼성페이가 노출됩니다.) <br >실결제시 반드시 결제대행사 KG이니시스 항목에 상점 아이디와 키패스워드를 입력해 주세요.", 50); ?>
<?php echo help("KG이니시스와 별도로 <strong>삼성페이 사용 계약을 하신 경우</strong>에만 체크해주세요. (모바일 주문서 결제수단에 삼성페이가 노출됩니다.) <br >실결제시 반드시 결제대행사 KG이니시스 항목에 상점 아이디와 웹결제 사인키를 입력해 주세요.", 50); ?>
<input type="checkbox" name="de_samsung_pay_use" value="1" id="de_samsung_pay_use"<?php echo $default['de_samsung_pay_use']?' checked':''; ?>> <label for="de_samsung_pay_use">사용</label>
</td>
</tr>
@@ -857,7 +870,7 @@ if(!$default['de_kakaopay_cancelpwd']){
<label for="de_inicis_lpay_use">KG이니시스 L.pay 사용</label>
</th>
<td>
<?php echo help("체크시 KG이니시스 L.pay를 사용합니다. <br >실결제시 반드시 결제대행사 KG이니시스 항목의 상점 정보( 아이디, 키패스워드, 웹결제 사인키 )를 입력해 주세요.", 50); ?>
<?php echo help("체크시 KG이니시스 L.pay를 사용합니다. <br >실결제시 반드시 결제대행사 KG이니시스 항목의 상점 정보( 아이디, 웹결제 사인키 )를 입력해 주세요.", 50); ?>
<input type="checkbox" name="de_inicis_lpay_use" value="1" id="de_inicis_lpay_use"<?php echo $default['de_inicis_lpay_use']?' checked':''; ?>> <label for="de_inicis_lpay_use">사용</label>
</td>
</tr>
@@ -866,7 +879,7 @@ if(!$default['de_kakaopay_cancelpwd']){
<label for="de_inicis_kakaopay_use">KG이니시스 카카오페이 사용</label>
</th>
<td>
<?php echo help("체크시 KG이니시스 결제의 카카오페이를 사용합니다. 주문서 결제수단에 카카오페이가 노출됩니다. <br>실결제시 반드시 결제대행사 KG이니시스 항목의 상점 정보( 아이디, 키패스워드, 웹결제 사인키 )를 입력해 주세요.", 50); ?>
<?php echo help("체크시 KG이니시스 결제의 카카오페이를 사용합니다. 주문서 결제수단에 카카오페이가 노출됩니다. <br>실결제시 반드시 결제대행사 KG이니시스 항목의 상점 정보( 아이디, 웹결제 사인키 )를 입력해 주세요.", 50); ?>
<input type="checkbox" name="de_inicis_kakaopay_use" value="1" id="de_inicis_kakaopay_use"<?php echo $default['de_inicis_kakaopay_use']?' checked':''; ?>> <label for="de_inicis_kakaopay_use">사용</label>
</td>
</tr>
@@ -2011,20 +2024,8 @@ if($default['de_iche_use'] || $default['de_vbank_use'] || $default['de_hp_use']
} catch(Exception $e) {
}
if(!is_dir($log_path)) {
echo '<script>'.PHP_EOL;
echo 'alert("'.str_replace(G5_PATH.'/', '', G5_SHOP_PATH).'/inicis 폴더 안에 log 폴더를 생성하신 후 쓰기권한을 부여해 주십시오.\n> mkdir log\n> chmod 707 log");'.PHP_EOL;
echo '</script>'.PHP_EOL;
} else {
if(!is_writable($log_path)) {
echo '<script>'.PHP_EOL;
echo 'alert("'.str_replace(G5_PATH.'/', '',$log_path).' 폴더에 쓰기권한을 부여해 주십시오.\n> chmod 707 log");'.PHP_EOL;
echo '</script>'.PHP_EOL;
} else {
if( function_exists('check_log_folder') && is_writable($log_path) ){
check_log_folder($log_path);
}
}
if( function_exists('check_log_folder') && is_writable($log_path) ){
check_log_folder($log_path);
}
}
+4 -2
View File
@@ -160,7 +160,8 @@ $check_sanitize_keys = array(
'cf_lg_mid', //LG유플러스 상점아이디
'cf_lg_mert_key', //LG유플러스 MERT KEY
'de_inicis_mid', //KG이니시스 상점아이디
'de_inicis_admin_key', //KG이니시스 키패스워드
'de_inicis_iniapi_key', //KG이니시스 INIAPI KEY
'de_inicis_iniapi_iv', //KG이니시스 INIAPI IV
'de_inicis_sign_key', //KG이니시스 웹결제 사인키
'de_samsung_pay_use', //KG이니시스 삼성페이 사용
'de_inicis_lpay_use', //KG이니시스 Lpay 사용
@@ -399,7 +400,8 @@ $sql = " update {$g5['g5_shop_default_table']}
de_kcp_mid = '{$de_kcp_mid}',
de_kcp_site_key = '{$de_kcp_site_key}',
de_inicis_mid = '{$de_inicis_mid}',
de_inicis_admin_key = '{$de_inicis_admin_key}',
de_inicis_iniapi_key = '{$de_inicis_iniapi_key}',
de_inicis_iniapi_iv = '{$de_inicis_iniapi_iv}',
de_inicis_sign_key = '{$de_inicis_sign_key}',
de_iche_use = '{$de_iche_use}',
de_sms_cont1 = '{$_POST['de_sms_cont1']}',
+1 -1
View File
@@ -45,7 +45,7 @@ $qstr1 = 'mb_name='.urlencode($mb_name);
<form name="fmember" method="get">
<div id="scp_list_find">
<label for="mb_name">회원이름</label>
<input type="text" name="mb_name" id="mb_name" value="<?php echo get_text($mb_name); ?>" class="frm_input required" required size="20">
<input type="text" name="mb_name" id="mb_name" value="<?php echo get_text($mb_name); ?>" class="frm_input" size="20">
<input type="submit" value="검색" class="btn_frmline">
</div>
<div class="tbl_head01 tbl_wrap new_win_con">
+62 -60
View File
@@ -112,7 +112,7 @@ function get_max_value($arr)
return array_pop($arr);
}
?>
<?php if (! auth_check_menu($auth, '400400', 'r', true)) { ?>
<div class="sidx">
<section id="anc_sidx_ord">
<h2>주문현황</h2>
@@ -368,6 +368,66 @@ function get_max_value($arr)
</div>
</section>
<script>
jQuery(function($) {
graph_draw();
$("#sidx_graph_area div").hover(
function() {
if($(this).is(":animated"))
return false;
var title = $(this).attr("title");
if(title && $(this).data("title") == undefined)
$(this).data("title", title);
var left = parseInt($(this).css("left")) + 10;
var bottom = $(this).height() + 5;
$(this)
.attr("title", "")
.append("<div id=\"price_tooltip\"><div></div></div>");
$("#price_tooltip")
.find("div")
.html(title)
.end()
// .css({ left: left+"px", bottom: bottom+"px" })
.show(200);
},
function() {
if($(this).is(":animated"))
return false;
$(this).attr("title", $(this).data("title"));
$("#price_tooltip").remove();
}
);
});
function graph_draw()
{
var g_h1 = new Array("<?php echo implode('", "', $h_val['order']); ?>");
var g_h2 = new Array("<?php echo implode('", "', $h_val['cancel']); ?>");
var duration = 600;
var $el = $("#sidx_graph_area li");
var h1, h2;
var $g1, $g2;
$el.each(function(index) {
h1 = g_h1[index];
h2 = g_h2[index];
$g1 = $(this).find(".order");
$g2 = $(this).find(".cancel");
$g1.animate({ height: h1+"px" }, duration);
$g2.animate({ height: h2+"px" }, duration);
});
}
</script>
<?php } //endif ?>
<?php if ($is_admin === 'super') { ?>
<div class="sidx sidx_cs">
<section id="anc_sidx_oneq">
<h2>1:1문의</h2>
@@ -480,64 +540,6 @@ function get_max_value($arr)
</div>
</section>
</div>
<script>
$(function() {
graph_draw();
$("#sidx_graph_area div").hover(
function() {
if($(this).is(":animated"))
return false;
var title = $(this).attr("title");
if(title && $(this).data("title") == undefined)
$(this).data("title", title);
var left = parseInt($(this).css("left")) + 10;
var bottom = $(this).height() + 5;
$(this)
.attr("title", "")
.append("<div id=\"price_tooltip\"><div></div></div>");
$("#price_tooltip")
.find("div")
.html(title)
.end()
// .css({ left: left+"px", bottom: bottom+"px" })
.show(200);
},
function() {
if($(this).is(":animated"))
return false;
$(this).attr("title", $(this).data("title"));
$("#price_tooltip").remove();
}
);
});
function graph_draw()
{
var g_h1 = new Array("<?php echo implode('", "', $h_val['order']); ?>");
var g_h2 = new Array("<?php echo implode('", "', $h_val['cancel']); ?>");
var duration = 600;
var $el = $("#sidx_graph_area li");
var h1, h2;
var $g1, $g2;
$el.each(function(index) {
h1 = g_h1[index];
h2 = g_h2[index];
$g1 = $(this).find(".order");
$g2 = $(this).find(".cancel");
$g1.animate({ height: h1+"px" }, duration);
$g2.animate({ height: h2+"px" }, duration);
});
}
</script>
<?php
} //end if
include_once (G5_ADMIN_PATH.'/admin.tail.php');
+34
View File
@@ -53,6 +53,7 @@ $opt_sql = " insert ignore into {$g5['g5_shop_item_option_table']} ( io_id, io_t
sql_query($opt_sql);
// html 에디터로 첨부된 이미지 파일 복사
$copied_editor_images = array();
if($cp['it_explan']) {
$matchs = get_editor_image($cp['it_explan'], false);
$count_matchs = (isset($matchs[1]) && is_array($matchs[1])) ? count($matchs[1]) : 0;
@@ -73,7 +74,13 @@ if($cp['it_explan']) {
$newfile = preg_replace("/\.([^\.]+)$/", "_".$new_it_id.".\\1", $matchs[1][$i]);
$cp['it_explan'] = str_replace($matchs[1][$i], $newfile, $cp['it_explan']);
$copied_editor_images[] = array(
'original' => $srcfile,
'new' => $dstfile
);
}
}
$sql = " update {$g5['g5_shop_item_table']} set it_explan = '".addslashes($cp['it_explan'])."' where it_id = '$new_it_id' ";
@@ -100,6 +107,11 @@ if($cp['it_mobile_explan']) {
$newfile = preg_replace("/\.([^\.]+)$/", "_".$new_it_id.".\\1", $matchs[1][$i]);
$cp['it_mobile_explan'] = str_replace($matchs[1][$i], $newfile, $cp['it_mobile_explan']);
$copied_editor_images[] = array(
'original' => $srcfile,
'new' => $dstfile
);
}
}
@@ -140,6 +152,7 @@ function copy_directory($src_dir, $dest_dir)
}
// 파일복사
$copied_item_files = array();
$dest_path = G5_DATA_PATH.'/item/'.$new_it_id;
@mkdir($dest_path, G5_DIR_PERMISSION);
@chmod($dest_path, G5_DIR_PERMISSION);
@@ -155,6 +168,11 @@ for($i=1; $i<=10; $i++) {
copy($file, $dstfile);
@chmod($dstfile, G5_FILE_PERMISSION);
$new_img = $new_it_id.'/'.basename($file);
$copied_item_files[] = array(
'original' => $file,
'new' => $dstfile,
);
}
$sql_img .= $comma." it_img{$i} = '$new_img' ";
@@ -166,6 +184,22 @@ $sql = " update {$g5['g5_shop_item_table']}
where it_id = '$new_it_id' ";
sql_query($sql);
/**
* 아이템 복사 처리 후 Event Hook
* @var string $it_id 원본 아이템 ID
* @var string $new_it_id 복사한 새로운 아이템 ID
* @var array $cp 복사한 아이템 정보
* @var array $copied_item_files 복사한 파일 목록
* @var array $copied_editor_images 복사한 에디터 이미지 목록
*/
run_event('shop_admin_itemcopy', array(
'it_id' => (string) $it_id,
'new_it_id' => (string) $new_it_id,
'cp' => $cp,
'copied_item_files' => $copied_item_files,
'copied_editor_images' => $copied_editor_images
));
$qstr = "ca_id=$ca_id&amp;sfl=$sfl&amp;sca=$sca&amp;page=$page&amp;stx=".urlencode($stx);
goto_url("itemlist.php?$qstr");
+3
View File
@@ -75,6 +75,7 @@ if ($w == "")
$sql_common
, ev_id = '$ev_id' ";
sql_query($sql);
run_event('shop_admin_event_created', $ev_id);
}
else if ($w == "u")
{
@@ -82,6 +83,7 @@ else if ($w == "u")
$sql_common
where ev_id = '$ev_id' ";
sql_query($sql);
run_event('shop_admin_event_updated', $ev_id);
}
else if ($w == "d")
{
@@ -92,6 +94,7 @@ else if ($w == "d")
// 이벤트상품삭제
$sql = " delete from {$g5['g5_shop_event_item_table']} where ev_id = '$ev_id' ";
sql_query($sql);
run_event('shop_admin_event_deleted', $ev_id);
$sql = " delete from {$g5['g5_shop_event_table']} where ev_id = '$ev_id' ";
sql_query($sql);
+1
View File
@@ -19,6 +19,7 @@ if ($w == "u")
iq_answer = '$iq_answer'
where iq_id = '$iq_id' ";
sql_query($sql);
run_event('shop_admin_item_qa_updated', $iq_id);
if(trim($iq_answer)) {
$sql = " select a.iq_email, a.iq_hp, b.it_name
+1
View File
@@ -23,6 +23,7 @@ if ($_POST['act_button'] == "선택삭제") {
$sql = "delete from {$g5['g5_shop_item_qa_table']} where iq_id = '{$iiq_id}' ";
sql_query($sql);
run_event('shop_admin_item_qa_deleted', $iiq_id);
}
}
+1
View File
@@ -34,6 +34,7 @@ if ($w == "u")
is_reply_name = '".$member['mb_nick']."'
where is_id = '".$posts['is_id']."'";
sql_query($sql);
run_event('shop_admin_item_use_updated', $posts['is_id']);
if( isset($_POST['it_id']) ) {
update_use_cnt($_POST['it_id']);
+1
View File
@@ -40,6 +40,7 @@ for ($i=0; $i<$count_post_chk; $i++)
{
$sql = "delete from {$g5['g5_shop_item_use_table']} where is_id = '{$iis_id}' ";
sql_query($sql);
run_event('shop_admin_item_use_deleted', $iis_id);
}
if($iit_id){
+18 -37
View File
@@ -222,46 +222,27 @@ if (in_array($_POST['ct_status'], $status_cancel)) {
break;
case 'inicis':
include_once(G5_SHOP_PATH.'/settle_inicis.inc.php');
$cancel_msg = iconv_euckr('쇼핑몰 운영자 승인 취소');
$cancel_msg = '쇼핑몰 운영자 승인 취소';
$args = array(
'paymethod' => get_type_inicis_paymethod($od['od_settle_case']),
'tid' => $od['od_tno'],
'msg' => $cancel_msg
);
/*********************
* 3. 취소 정보 설정 *
*********************/
$inipay->SetField("type", "cancel"); // 고정 (절대 수정 불가)
$inipay->SetField("mid", $default['de_inicis_mid']); // 상점아이디
/**************************************************************************************************
* admin 은 키패스워드 변수명입니다. 수정하시면 안됩니다. 1111의 부분만 수정해서 사용하시기 바랍니다.
* 키패스워드는 상점관리자 페이지(https://iniweb.inicis.com)의 비밀번호가 아닙니다. 주의해 주시기 바랍니다.
* 키패스워드는 숫자 4자리로만 구성됩니다. 이 값은 키파일 발급시 결정됩니다.
* 키패스워드 값을 확인하시려면 상점측에 발급된 키파일 안의 readme.txt 파일을 참조해 주십시오.
**************************************************************************************************/
$inipay->SetField("admin", $default['de_inicis_admin_key']); //비대칭 사용키 키패스워드
$inipay->SetField("tid", $od['od_tno']); // 취소할 거래의 거래아이디
$inipay->SetField("cancelmsg", $cancel_msg); // 취소사유
$response = inicis_tid_cancel($args);
$result = json_decode($response, true);
/****************
* 4. 취소 요청 *
****************/
$inipay->startAction();
/****************************************************************
* 5. 취소 결과 *
* *
* 결과코드 : $inipay->getResult('ResultCode') ("00"이면 취소 성공) *
* 결과내용 : $inipay->getResult('ResultMsg') (취소결과에 대한 설명) *
* 취소날짜 : $inipay->getResult('CancelDate') (YYYYMMDD) *
* 취소시각 : $inipay->getResult('CancelTime') (HHMMSS) *
* 현금영수증 취소 승인번호 : $inipay->getResult('CSHR_CancelNum') *
* (현금영수증 발급 취소시에만 리턴됨) *
****************************************************************/
$res_cd = $inipay->getResult('ResultCode');
$res_msg = $inipay->getResult('ResultMsg');
if($res_cd != '00') {
$pg_res_cd = $res_cd;
$pg_res_msg = iconv_utf8($res_msg);
if (isset($result['resultCode'])) {
if ($result['resultCode'] != '00') {
$pg_res_cd = $result['resultCode'];
$pg_res_msg = $result['resultMsg'];
}
} else {
$pg_res_cd = '';
$pg_res_msg = 'curl 로 데이터를 받지 못했습니다.';
}
break;
case 'KAKAOPAY':
include_once(G5_SHOP_PATH.'/settle_kakaopay.inc.php');
+1 -1
View File
@@ -222,7 +222,7 @@ if( function_exists('pg_setting_check') ){
<input type="radio" name="od_settle_case" value="신용카드" id="od_settle_case06" <?php echo get_checked($od_settle_case, '신용카드'); ?>>
<label for="od_settle_case06">신용카드</label>
<input type="radio" name="od_settle_case" value="간편결제" id="od_settle_case07" <?php echo get_checked($od_settle_case, '간편결제'); ?>>
<label for="od_settle_case07" data-tooltip-text="NHN_KCP 간편결제 : PAYCO, 네이버페이, 카카오페이(NHN_KCP) &#xa;LG유플러스 간편결제 : PAYNOW &#xa;KG 이니시스 간편결제 : KPAY, 삼성페이, LPAY, 카카오페이(KG이니시스)">PG간편결제</label>
<label for="od_settle_case07" data-tooltip-text="NHN_KCP 간편결제 : PAYCO, 네이버페이, 카카오페이(NHN_KCP), 애플페이(NHN_KCP) &#xa;LG유플러스 간편결제 : PAYNOW &#xa;KG 이니시스 간편결제 : KPAY, 삼성페이, LPAY, 카카오페이(KG이니시스)">PG간편결제</label>
<input type="radio" name="od_settle_case" value="KAKAOPAY" id="od_settle_case08" <?php echo get_checked($od_settle_case, 'KAKAOPAY'); ?>>
<label for="od_settle_case08">KAKAOPAY</label>
</div>
+10 -1
View File
@@ -33,7 +33,16 @@ if ($w == 'u' && is_numeric($bk_no)) {
$g5['title'] .= '수정';
}
else {
$write = array('bg_no' => (int) $bg_no);
$write = array(
'bg_no' => (int) $bg_no,
'bk_no' => 0,
'mb_id' => '',
'bk_name' => '',
'bk_hp' => '',
'bk_memo' => '',
'bk_receipt' => 1,
'bk_datetime' => ''
);
$g5['title'] .= '추가';
}
+6 -8
View File
@@ -71,18 +71,16 @@ if( count($save_group) ){ //그룹테이블 업데이트
$msg = '해당 번호를 선택한 그룹으로 '.$act.' 하였습니다.';
$opener_href = './num_book.php?page='.$page;
echo <<<HEREDOC
?>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<script>
alert("$msg");
opener.document.location.href = "$opener_href";
alert("<?php echo $msg; ?>");
opener.document.location.href = "<?php echo $opener_href; ?>";
window.close();
</script>
<noscript>
<p>
"$msg"
<?php echo $msg; ?>
</p>
<a href="$opener_href">돌아가기</a>
</noscript>
HEREDOC;
<a href="<?php echo $opener_href; ?>">돌아가기</a>
</noscript>
+3 -3
View File
@@ -16,13 +16,13 @@ if( ! $is_admin ){
}
}
run_event('admin_request_handler_'.$call, $arr_query, $token);
$sub_menu = admin_menu_find_by($call, 'sub_menu');
$g5['title'] = admin_menu_find_by($call, 'title');
run_event('admin_request_handler_'.$call, $arr_query, $token);
include_once ('./admin.head.php');
run_event('admin_get_page_'.$call, $arr_query, $token);
include_once ('./admin.tail.php');
include_once ('./admin.tail.php');
+4 -2
View File
@@ -17,13 +17,15 @@ while ($row=sql_fetch_array($result))
$faq_master_list[$key] = $row;
}
$fm = array();
if (isset($fm_id) && $fm_id){
$fm_id = (int) $fm_id;
$qstr .= '&amp;fm_id=' . $fm_id; // 마스터faq key_id
$fm = $faq_master_list[$fm_id];
}
$fm = $faq_master_list[$fm_id];
if (!$fm['fm_id'])
if (! (isset($fm['fm_id']) && $fm['fm_id']))
alert('등록된 내용이 없습니다.');
$g5['title'] = $fm['fm_subject'];
+14
View File
@@ -104,6 +104,13 @@ if (!$is_search_bbs) {
$list[$i] = get_list($row, $board, $board_skin_url, G5_IS_MOBILE ? $board['bo_mobile_subject_len'] : $board['bo_subject_len']);
$list[$i]['is_notice'] = true;
$list[$i]['list_content'] = $list[$i]['wr_content'];
// 비밀글인 경우 리스트에서 내용이 출력되지 않게 글 내용을 지웁니다.
if (strstr($list[$i]['wr_option'], "secret")) {
$list[$i]['wr_content'] = '';
}
$list[$i]['num'] = 0;
$i++;
$notice_count++;
@@ -197,6 +204,13 @@ if($page_rows > 0) {
$list[$i]['subject'] = search_font($stx, $list[$i]['subject']);
}
$list[$i]['is_notice'] = false;
$list[$i]['list_content'] = $list[$i]['wr_content'];
// 비밀글인 경우 리스트에서 내용이 출력되지 않게 글 내용을 지웁니다.
if (strstr($list[$i]['wr_option'], "secret")) {
$list[$i]['wr_content'] = '';
}
$list_num = $total_count - ($page - 1) * $list_page_rows - $notice_count;
$list[$i]['num'] = $list_num - $k;
+10 -2
View File
@@ -62,10 +62,18 @@ run_event('login_session_before', $mb, $is_social_login);
@include_once($member_skin_path.'/login_check.skin.php');
if (! (defined('SKIP_SESSION_REGENERATE_ID') && SKIP_SESSION_REGENERATE_ID)) {
session_regenerate_id(false);
if (function_exists('session_start_samesite')) {
session_start_samesite();
}
}
// 회원아이디 세션 생성
set_session('ss_mb_id', $mb['mb_id']);
// FLASH XSS 공격에 대응하기 위하여 회원의 고유키를 생성해 놓는다. 관리자에서 검사함 - 110106
set_session('ss_mb_key', md5($mb['mb_datetime'] . get_real_client_ip() . $_SERVER['HTTP_USER_AGENT']));
// FLASH XSS 공격에 대응하기 위하여 회원의 고유키를 생성해 놓는다. 관리자에서 검사함
generate_mb_key($mb);
// 회원의 토큰키를 세션에 저장한다. /common.php 에서 해당 회원의 토큰값을 검사한다.
if(function_exists('update_auth_session_token')) update_auth_session_token($mb['mb_datetime']);
+9 -2
View File
@@ -49,7 +49,9 @@ while ($row = sql_fetch_array($result))
$count_write = 0;
$count_comment = 0;
$next_wr_num = get_next_num($move_write_table);
// get_next_num 함수는 mysql 지연시 중복이 될수 있는 문제로 더 이상 사용하지 않습니다.
// $next_wr_num = get_next_num($move_write_table);
$next_wr_num = 0;
$sql2 = " select * from $write_table where wr_num = '$wr_num' order by wr_parent, wr_is_comment, wr_comment desc, wr_id ";
$result2 = sql_query($sql2);
@@ -78,7 +80,7 @@ while ($row = sql_fetch_array($result))
}
$sql = " insert into $move_write_table
set wr_num = '$next_wr_num',
set wr_num = " . ($next_wr_num ? "'$next_wr_num'" : "(SELECT IFNULL(MIN(wr_num) - 1, -1) FROM $move_write_table sq) ") . ",
wr_reply = '{$row2['wr_reply']}',
wr_is_comment = '{$row2['wr_is_comment']}',
wr_comment = '{$row2['wr_comment']}',
@@ -116,6 +118,11 @@ while ($row = sql_fetch_array($result))
sql_query($sql);
$insert_id = sql_insert_id();
if ($next_wr_num === 0) {
$tmp = sql_fetch("select wr_num from $move_write_table where wr_id = '$insert_id'");
$next_wr_num = $tmp['wr_num'];
}
// 코멘트가 아니라면
if (!$row2['wr_is_comment'])
+19 -8
View File
@@ -15,6 +15,7 @@ if (!($token && $delete_token === $token))
alert('토큰 에러로 삭제 불가합니다.');
$tmp_array = array();
$deleted = array();
if ($qa_id) // 건별삭제
$tmp_array[0] = $qa_id;
else // 일괄삭제
@@ -56,21 +57,23 @@ for($i=0; $i<$count; $i++) {
delete_editor_thumbnail($row['qa_content']);
// 답변이 있는 질문글이라면 답변글 삭제
if(!$row['qa_type'] && $row['qa_status']) {
$row2 = sql_fetch(" select qa_content, qa_file1, qa_file2 from {$g5['qa_content_table']} where qa_parent = '$qa_id' ");
if (!$row['qa_type'] && $row['qa_status']) {
$answer = sql_fetch(" SELECT qa_id, qa_content, qa_file1, qa_file2 from {$g5['qa_content_table']} where qa_type = 1 AND qa_parent = {$qa_id} ");
// 첨부파일 삭제
for($k=1; $k<=2; $k++) {
@unlink(G5_DATA_PATH.'/qa/'.clean_relative_paths($row2['qa_file'.$k]));
for ($k = 1; $k <= 2; $k++) {
@unlink(G5_DATA_PATH . '/qa/' . clean_relative_paths($answer['qa_file' . $k]));
// 썸네일삭제
if(preg_match("/\.({$config['cf_image_extension']})$/i", $row2['qa_file'.$k])) {
delete_qa_thumbnail($row2['qa_file'.$k]);
if (preg_match("/\.({$config['cf_image_extension']})$/i", $answer['qa_file' . $k])) {
delete_qa_thumbnail($answer['qa_file' . $k]);
}
}
// 에디터 썸네일 삭제
delete_editor_thumbnail($row2['qa_content']);
delete_editor_thumbnail($answer['qa_content']);
sql_query(" delete from {$g5['qa_content_table']} where qa_type = '1' and qa_parent = '$qa_id' ");
// 답변글 삭제
sql_query(" DELETE from {$g5['qa_content_table']} where qa_type = 1 and qa_parent = {$qa_id} ");
$deleted[] = (int) $answer['qa_id'];
}
// 답변글 삭제시 질문글의 상태변경
@@ -80,6 +83,14 @@ for($i=0; $i<$count; $i++) {
// 글삭제
sql_query(" delete from {$g5['qa_content_table']} where qa_id = '$qa_id' ");
$deleted[] = $qa_id;
}
/**
* QA 글 삭제 후 Event Hook
* @var array $tmp_array 삭제 요청된 qa_id 목록. 소유자 확인, 답변글 존재 여부 등의 이유로 실제로 삭제처리가 안 된 ID가 포함될 수 있으며, 삭제처리 되었더라도 답변글은 이 목록에 포함되지 않음
* @var array $deleted 답변글을 포함한 삭제가 완료된 qa_id 목록
*/
run_event('qa_delete', $tmp_array, $deleted);
goto_url(G5_BBS_URL.'/qalist.php'.preg_replace('/^&amp;/', '?', $qstr));
+11 -1
View File
@@ -86,6 +86,7 @@ $qa_related = 0;
$qa_email_recv = (isset($_POST['qa_email_recv']) && $_POST['qa_email_recv']) ? 1 : 0;
$qa_sms_recv = (isset($_POST['qa_sms_recv']) && $_POST['qa_sms_recv']) ? 1 : 0;
$qa_status = 0;
$answer_id = null;
for ($i=1; $i<=5; $i++) {
$var = "qa_$i";
@@ -301,6 +302,7 @@ if($w == '' || $w == 'a' || $w == 'r') {
}
if($w == 'a') {
$answer_id = (int) sql_insert_id();
$sql = " update {$g5['qa_content_table']}
set qa_status = '1'
where qa_id = '{$write['qa_parent']}' ";
@@ -339,7 +341,15 @@ if($w == '' || $w == 'a' || $w == 'r') {
sql_query($sql);
}
run_event('qawrite_update', $qa_id, $write, $w, $qaconfig);
/**
* 1:1 문의/답변의 변경 시 Event Hook
* @var int $qa_id 삽입/수정 또는 답글/추가질문 대상 글의 ID
* @var array $write 삽입/수정 또는 답글/추가질문 대상 글의 데이터
* @var string $w 동작 모드 ('': 질문글 작성, 'a': 답변글 작성, 'u': 질문/답변 수정, 'r': 추가(관련) 질문)
* @var array $qaconfig 1:1 문의 설정
* @var ?int $answer_id 답변글 작성($w = 'a') 시 답변글의 ID
*/
run_event('qawrite_update', $qa_id, $write, $w, $qaconfig, ($w === 'a') ? $answer_id : null);
// SMS 알림
if($config['cf_sms_use'] == 'icode' && $qaconfig['qa_use_sms']) {
+6 -4
View File
@@ -49,9 +49,7 @@ echo '<?xml version="1.0" encoding="utf-8" ?>'."\n";
<channel>
<title><?php echo specialchars_replace($config['cf_title'].' &gt; '.$subj1.' &gt; '.$subj2); ?></title>
<link><?php echo specialchars_replace(get_pretty_url($bo_table)); ?></link>
<description>테스트 버전 0.2 (2004-04-26)</description>
<language>ko</language>
<?php
$sql = " select wr_id, wr_subject, wr_content, wr_name, wr_datetime, wr_option
from {$g5['write_prefix']}$bo_table
@@ -66,6 +64,10 @@ for ($i=0; $row=sql_fetch_array($result); $i++) {
$html = 1;
else
$html = 0;
if ($i === 0) {
echo '<description>'. specialchars_replace($subj2). ' ('. $row['wr_datetime'] .')</description>'.PHP_EOL;
}
?>
<item>
@@ -76,8 +78,8 @@ for ($i=0; $row=sql_fetch_array($result); $i++) {
<?php
$date = $row['wr_datetime'];
// rss 리더 스킨으로 호출하면 날짜가 제대로 표시되지 않음
//$date = substr($date,0,10) . "T" . substr($date,11,8) . "+09:00";
$date = date('r', strtotime($date));
$date = substr($date,0,10) . "T" . substr($date,11,8) . "+09:00";
//$date = date('r', strtotime($date)); // 구글 서치 콘솔에서 오류가 난다
?>
<dc:date><?php echo $date ?></dc:date>
</item>
+1 -1
View File
@@ -25,7 +25,7 @@ if ($stx) {
$sql = " select gr_id, bo_table, bo_read_level from {$g5['board_table']} where bo_use_search = 1 and bo_list_level <= '{$member['mb_level']}' ";
if ($gr_id)
$sql .= " and gr_id = '{$gr_id}' ";
$onetable = isset($onetable) ? $onetable : "";
$onetable = isset($onetable) ? preg_replace('/[^a-z0-9_]/i', '', $onetable) : '';
if ($onetable) // 하나의 게시판만 검색한다면
$sql .= " and bo_table = '{$onetable}' ";
$sql .= " order by bo_order, gr_id, bo_table ";
+12 -4
View File
@@ -252,12 +252,14 @@ if ($w == '' || $w == 'r') {
$wr_num = $write['wr_num'];
$wr_reply = $reply;
} else {
$wr_num = get_next_num($write_table);
// get_next_num 함수는 mysql 지연시 중복이 될수 있는 문제로 더 이상 사용하지 않습니다.
// $wr_num = get_next_num($write_table);
$wr_num = 0;
$wr_reply = '';
}
$sql = " insert into $write_table
set wr_num = '$wr_num',
set wr_num = " . ($w == 'r' ? "'$wr_num'" : "(SELECT IFNULL(MIN(wr_num) - 1, -1) FROM $write_table sq) ") . ",
wr_reply = '$wr_reply',
wr_comment = 0,
ca_name = '$ca_name',
@@ -676,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);
}
// 메일발송 사용 (수정글은 발송하지 않음)
if (!($w == 'u' || $w == 'cu') && $config['cf_email_use'] && $board['bo_use_email']) {
+25 -11
View File
@@ -62,6 +62,11 @@ if(! isset($_SERVER['SERVER_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에 사용자지정 함수적용
function array_map_deep($fn, $array)
{
@@ -221,7 +226,12 @@ ini_set("session.gc_maxlifetime", 10800); // session data의 garbage collection
ini_set("session.gc_probability", 1); // session.gc_probability는 session.gc_divisor와 연계하여 gc(쓰레기 수거) 루틴의 시작 확률을 관리합니다. 기본값은 1입니다. 자세한 내용은 session.gc_divisor를 참고하십시오.
ini_set("session.gc_divisor", 100); // session.gc_divisor는 session.gc_probability와 결합하여 각 세션 초기화 시에 gc(쓰레기 수거) 프로세스를 시작할 확률을 정의합니다. 확률은 gc_probability/gc_divisor를 사용하여 계산합니다. 즉, 1/100은 각 요청시에 GC 프로세스를 시작할 확률이 1%입니다. session.gc_divisor의 기본값은 100입니다.
session_set_cookie_params(0, '/');
if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') {
session_set_cookie_params(0, '/', null, true, true);
} else {
session_set_cookie_params(0, '/', null, false, true);
}
ini_set("session.cookie_domain", G5_COOKIE_DOMAIN);
function chrome_domain_session_name(){
@@ -366,8 +376,7 @@ if( $config['cf_cert_use'] || (defined('G5_YOUNGCART_VER') && G5_YOUNGCART_VER)
|| preg_match('/(iPhone|iPod|iPad).*AppleWebKit.*Safari/i', $_SERVER['HTTP_USER_AGENT'])
|| preg_match('~MSIE|Internet Explorer~i', $_SERVER['HTTP_USER_AGENT'])
|| preg_match('~Trident/7.0(; Touch)?; rv:11.0~',$_SERVER['HTTP_USER_AGENT'])
|| !(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']=='on')
|| !(isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == "https")){
|| !(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']=='on')) {
return $res;
}
}
@@ -377,7 +386,7 @@ if( $config['cf_cert_use'] || (defined('G5_YOUNGCART_VER') && G5_YOUNGCART_VER)
$cookie_session_name = method_exists('XenoPostToForm', 'g5_session_name') ? XenoPostToForm::g5_session_name() : 'PHPSESSID';
foreach ($headers as $header) {
if (!preg_match('~^Set-Cookie: '.$cookie_session_name.'=~', $header)) continue;
$header = preg_replace('~; secure(; HttpOnly)?$~', '', $header) . '; secure; SameSite=None';
$header = preg_replace('~(; secure; HttpOnly)?$~', '; secure; HttpOnly; SameSite=None', $header);
header($header, false);
$g5['session_cookie_samesite'] = 'none';
break;
@@ -480,6 +489,7 @@ if (isset($_REQUEST['w'])) {
$w = '';
}
/** @var int $wr_id 게시판 글의 ID */
if (isset($_REQUEST['wr_id'])) {
$wr_id = (int)$_REQUEST['wr_id'];
} else {
@@ -502,7 +512,8 @@ if (isset($_REQUEST['url'])) {
$urlencode = urlencode($_SERVER['REQUEST_URI']);
if (G5_DOMAIN) {
$p = @parse_url(G5_DOMAIN);
$urlencode = G5_DOMAIN.urldecode(preg_replace("/^".urlencode($p['path'])."/", "", $urlencode));
$p['path'] = isset($p['path']) ? $p['path'] : '/';
$urlencode = rtrim(G5_DOMAIN, '%2F').'%2F'.ltrim(urldecode(preg_replace("/^".urlencode($p['path'])."/", "", $urlencode)), '%2F');
}
}
@@ -576,27 +587,30 @@ if (isset($_SESSION['ss_mb_id']) && $_SESSION['ss_mb_id']) { // 로그인중이
}
/** @var array $write 글 데이터 */
$write = array();
/** @var string $write_table 게시판 테이블 전체이름 */
$write_table = '';
if ($bo_table) {
$board = get_board_db($bo_table, true);
if (isset($board['bo_table']) && $board['bo_table']) {
set_cookie("ck_bo_table", $board['bo_table'], 86400 * 1);
$gr_id = $board['gr_id'];
$write_table = $g5['write_prefix'] . $bo_table; // 게시판 테이블 전체이름
// 게시판 테이블 전체이름
$write_table = $g5['write_prefix'] . $bo_table;
if (isset($wr_id) && $wr_id) {
$write = get_write($write_table, $wr_id);
} else if (isset($wr_seo_title) && $wr_seo_title) {
$write = get_content_by_field($write_table, 'bbs', 'wr_seo_title', generate_seo_title($wr_seo_title));
if( isset($write['wr_id']) ){
$wr_id = $write['wr_id'];
if (isset($write['wr_id'])) {
$wr_id = (int) $write['wr_id'];
}
}
}
// 게시판에서
if (isset($board['bo_select_editor']) && $board['bo_select_editor']){
// 게시판에서 사용하는 에디터를 설정
if (isset($board['bo_select_editor']) && $board['bo_select_editor']) {
$config['cf_editor'] = $board['bo_select_editor'];
}
}
+2 -1
View File
@@ -799,7 +799,7 @@ box-shadow: 1px 2px 2px #eee;}
#od_tot_price strong{font-size:1.5em;color:#ff006c}
#sod_frm #sod_frm_pt_alert {margin:5px 0;color:#38b2bb }
#od_pay_sl h3{font-size:1.167em;margin:20px 0 5px}
#od_pay_sl input[type="radio"]{position:absolute;width:0;height:0;overflow:hidden;visibility:hidden;text-indent:-999px;left: 0;z-index: -1px;}
#od_pay_sl input[type="radio"]{position:absolute;width:0;height:0;overflow:hidden;visibility:hidden;text-indent:-999px;left: 0;z-index: -1;}
#od_pay_sl .lb_icon {display: inline-block;float:left;width:50%;background:#fff;border:1px solid #eceff4;margin:-1px 0 0 -1px;cursor: pointer;height:60px;position:relative;padding-left:65px;padding-top:20px;z-index:1}
#od_pay_sl input[type="radio"]:checked+.lb_icon {border:1px solid #ff006c;z-index:3}
#sod_frm_paysel {}
@@ -1148,6 +1148,7 @@ box-shadow: 1px 2px 2px #eee;}
.sod_frm_mobile #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%}
.sod_frm_mobile #m_sod_frm_paysel .inicis_kakaopay{background:url(../img/kakao.png) no-repeat 50% 50% #f4dc34;border-radius:30px;height:22px;width:74px;display:inline-block;overflow:hidden;text-indent:-999px;background-size:35px auto}
.sod_frm_mobile #m_sod_frm_paysel .kakaopay_icon{background:url(../img/kakao.png) no-repeat 50% 50% #f4dc34;border-radius:30px;height:22px;width:74px;display:inline-block;overflow:hidden;text-indent:-999px;background-size:35px auto}
.sod_frm_mobile #m_sod_frm_paysel .applepay_icon{background:url(../img/ico-mobile-applepay.png) no-repeat 50% 50% #fff;border-radius:30px;height:23px;width:50px;display:inline-block;overflow:hidden;text-indent:-999px;background-size:35px auto}
.sod_frm_mobile #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}
.sod_frm_mobile #sod_frm_pay{border-top:1px solid #f3f3f3}
.sod_frm_mobile #sod_frm_pay h2{margin:10px 0;font-size:1.25em}
+12 -11
View File
@@ -84,8 +84,8 @@ input[type=radio] {-webkit-appearance: radio}
/*카테고리*/
.menu {display:none;position:fixed;top:0;height:100%;z-index:99999;-webkit-backface-visibility:hidden;width:100%;background:#efefef}
.menu .menu_wr{width:100%;height:100%;overflow-y:auto;background:#eee;position:relative;z-index:199919;
-webkit-box-shadow: 0 0 5px rgba(55,55,5,0.4));
-moz-box-shadow: 0 0 5px rgba(55,55,5,0.4));
-webkit-box-shadow: 0 0 5px rgba(55,55,5,0.4);
-moz-box-shadow: 0 0 5px rgba(55,55,5,0.4);
box-shadow: 0 0 5px rgba(55,55,5,0.4);}
.menu .menu_close {position:absolute;top:50%;right:0px;width:40px;height:40px;background:none;color:#fff;font-size:20px;margin-top:-20px;border:0;z-index:199999}
@@ -220,14 +220,15 @@ box-shadow: 0 0 6px rgba(0,0,0,0.2);}
#m_sod_frm_paysel h3{background:#fff;padding:15px 10px ;border:1px solid #e3e5e8;border-bottom:0}
#m_sod_frm_paysel ul {margin:0 0 ;background:#fff;padding:10px;border:1px solid #e3e5e8}
#m_sod_frm_paysel ul:after {display:block;visibility:hidden;clear:both;content:""}
#m_sod_frm_paysel li {float:left;padding:5px ;width:46%;height:25px}
#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 .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: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 .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_kakaopay{background:url('../img/kakao.png') no-repeat 50% 50% #ffeb00;border-radius:30px;height:22px;width:74px;display:inline-block;overflow:hidden;text-indent:-999px;background-size:35px auto}
#m_sod_frm_paysel .kakaopay_icon{background:url('../img/ico-mobile-kakaopay.png') no-repeat #fff;height:15px;width:43px;display:inline-block;overflow:hidden;text-indent:-999px;background-size:35px auto}
#m_sod_frm_paysel .naverpay_icon{background:url('../img/ico-mobile-naverpay.png') no-repeat #fff;height:15px;width:40px;display:inline-block;overflow:hidden;text-indent:-999px;background-size:35px 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 .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 .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}
#sod_frm_pay{padding:10px;;border-top:1px solid #f3f3f3}
@@ -358,7 +359,7 @@ box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
#sod_addr .addr_btn:after {display:block;visibility:hidden;clear:both;content:""}
#sod_addr .sel_address {width:32%;float:left;margin-right:1%;height:30px;background:none;border:1px solid #333;color:#333;padding:0 5px}
#sod_addr .del_address {display:block;width:32%;text-align:center;float:left;margin-right:1%;border:1px solid #aaa;background:none;color:#888;padding:0 5px;height:30px;line-height:28px;vertical-align:middle}
#sod_addr input[type="radio"] {position:absolute;width:0;height:0;overflow:hidden;visibility:hidden;text-indent:-999px;left:0;z-index:-1px}
#sod_addr input[type="radio"] {position:absolute;width:0;height:0;overflow:hidden;visibility:hidden;text-indent:-999px;left:0;z-index:-1}
#sod_addr .add_lb {display:inline-block;float:left;width:32%;text-align:center;border:1px solid #4162ff;color:#4162ff;height:30px;line-height:28px}
#sod_addr input[type="radio"]:checked+.add_lb {z-index:3;background:#4162ff;color:#fff}
@@ -578,7 +579,7 @@ a.btn02 {display:inline-block;padding:8px 7px 7px;border:1px solid #3b3c3f;backg
a.btn02:focus, .btn02:hover {text-decoration:none}
button.btn02 {display:inline-block;margin:0;padding:7px;border:1px solid #3b3c3f;background:#4b545e;color:#fff;text-decoration:none}
.btn_confirm {text-align:center} /* 서식단계 진행 */
.btn_submit {padding:0 5px;border:0;background:#3a8afd;border:1px solid #1c70e9;color:#fff;letter-spacing:-0.1em;border-radius:3px}}
.btn_submit {padding:0 5px;border:0;background:#3a8afd;border:1px solid #1c70e9;color:#fff;letter-spacing:-0.1em;border-radius:3px}
fieldset .btn_submit {padding:0 7px;height:24px;line-height:1em}
a.btn_cancel {display:inline-block;padding:8px 7px 7px;border:1px solid #ccc;background:#fff;color:#000;text-decoration:none;vertical-align:middle}
button.btn_cancel {display:inline-block;padding:7px;border:1px solid #ccc;background:#fafafa;color:#000;vertical-align:top;text-decoration:none}
@@ -820,7 +821,7 @@ box-shadow:0 0 8px rgba(65,98,255,0.8)}
.sod_right #sod_bsk_tot{margin:10px}
#sod_frm_taker textarea{width:100%;height:80px}
#od_pay_sl input[type="radio"] {position:absolute;width:0;height:0;overflow:hidden;visibility:hidden;text-indent:-999px;left:0;z-index:-1px}
#od_pay_sl input[type="radio"] {position:absolute;width:0;height:0;overflow:hidden;visibility:hidden;text-indent:-999px;left:0;z-index:-1}
#od_pay_sl .lb_icon {display:inline-block;float:left;width:150px;background:#fff;border:1px solid #eceff4;margin:-1px 0 0 -1px;cursor:pointer;height:60px;position:relative;padding-left:65px;padding-top:20px;z-index:1}
#od_pay_sl input[type="radio"]:checked+.lb_icon {border:1px solid #ff006c;z-index:3}
@@ -899,7 +900,7 @@ box-shadow:0 0 8px rgba(65,98,255,0.8)}
#od_tot_price span{float:left;font-weight:bold}
#od_tot_price strong{font-size:1.5em;color:#ff006c}
#od_pay_sl h3{font-size:1.167em;margin:20px 0 5px}
#od_pay_sl input[type="radio"]{position:absolute;width:0;height:0;overflow:hidden;visibility:hidden;text-indent:-999px;left: 0;z-index: -1px;}
#od_pay_sl input[type="radio"]{position:absolute;width:0;height:0;overflow:hidden;visibility:hidden;text-indent:-999px;left: 0;z-index: -1;}
#od_pay_sl .lb_icon {display: inline-block;float:left;width:50%;background:#fff;border:1px solid #eceff4;margin:-1px 0 0 -1px;cursor: pointer;height:60px;position:relative;padding-left:65px;padding-top:20px;z-index:1}
#od_pay_sl input[type="radio"]:checked+.lb_icon {border:1px solid #ff006c;z-index:3}
#sod_frm_paysel {}
-2
View File
@@ -1,2 +0,0 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가;
+2 -2
View File
@@ -4,5 +4,5 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
// 자바스크립트와 CSS 파일을 새로 다운로드 하도록 파일의 끝에 년월일 지정
// 예) https://도메인/css/default.css?ver=220620
// 예) https://도메인/js/common.js?ver=220620
define('G5_CSS_VER', '220620');
define('G5_JS_VER', '2210172');
define('G5_CSS_VER', '2303229');
define('G5_JS_VER', '2304171');
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

+1 -1
View File
@@ -7,7 +7,7 @@
DROP TABLE IF EXISTS `g5_auth`;
CREATE TABLE IF NOT EXISTS `g5_auth` (
`mb_id` varchar(20) NOT NULL default '',
`au_menu` varchar(20) NOT NULL default '',
`au_menu` varchar(50) NOT NULL default '',
`au_auth` set('r','w','d') NOT NULL default '',
PRIMARY KEY (`mb_id`,`au_menu`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+2 -1
View File
@@ -349,7 +349,8 @@ CREATE TABLE IF NOT EXISTS `g5_shop_default` (
`de_kcp_mid` varchar(255) NOT NULL DEFAULT '',
`de_kcp_site_key` varchar(255) NOT NULL DEFAULT '',
`de_inicis_mid` varchar(255) NOT NULL DEFAULT '',
`de_inicis_admin_key` varchar(255) NOT NULL DEFAULT '',
`de_inicis_iniapi_key` varchar(30) NOT NULL DEFAULT '',
`de_inicis_iniapi_iv` varchar(30) NOT NULL DEFAULT '',
`de_inicis_sign_key` varchar(255) NOT NULL DEFAULT '',
`de_iche_use` tinyint(4) NOT NULL DEFAULT '0',
`de_easy_pay_use` tinyint(4) NOT NULL DEFAULT '0',
+16 -4
View File
@@ -268,6 +268,18 @@ if ($g5_install || $is_install === false) {
$bo_skin = ($tmp_bo_table[$i] === 'gallery') ? 'gallery' : 'basic';
if (in_array($tmp_bo_table[$i], array('gallery', 'qa'))) {
$read_bo_point = -1;
$write_bo_point = 5;
$comment_bo_point = 1;
$download_bo_point = -20;
} else {
$read_bo_point = $read_point;
$write_bo_point = $write_point;
$comment_bo_point = $comment_point;
$download_bo_point = $download_point;
}
$sql = " insert into `{$table_prefix}board`
set bo_table = '$tmp_bo_table[$i]',
gr_id = '$tmp_gr_id',
@@ -285,10 +297,10 @@ if ($g5_install || $is_install === false) {
bo_count_delete = '1',
bo_upload_level = '1',
bo_download_level = '1',
bo_read_point = '-1',
bo_write_point = '5',
bo_comment_point = '1',
bo_download_point = '-20',
bo_read_point = '$read_bo_point',
bo_write_point = '$write_bo_point',
bo_comment_point = '$comment_bo_point',
bo_download_point = '$download_bo_point',
bo_use_category = '0',
bo_category_list = '',
bo_use_sideview = '0',
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

+2 -2
View File
@@ -40,7 +40,7 @@ $(function() {
});
if(isAndroid) {
$(document).on("touchend", "select.it_option", function() {
$(document).on("touchend mouseup", "select.it_option", function() {
option_add = true;
});
} else {
@@ -151,7 +151,7 @@ $(function() {
});
if(isAndroid) {
$(document).on("touchend", "select.it_supply", function() {
$(document).on("touchend mouseup", "select.it_supply", function() {
supply_add = true;
});
} else {
+19 -10
View File
@@ -61,29 +61,38 @@ Class G5_object_cache {
$this->contents[$group][$key] = $data;
break;
default :
$datas = $this->etcs[$group][$key] = $data;
$this->etcs[$group][$key] = $data;
break;
}
}
/**
* cache 데이터 제거
* @param string $type
* @param string $key
* @param string $group
* @return bool
*/
function delete($type, $key, $group = 'default')
{
if (!$this->exists($type, $key, $group)) {
return false;
}
function delete($key, $group='default') {
switch ($key) {
switch ($type) {
case 'bbs':
$datas = $this->writes;
$datas = &$this->writes;
break;
case 'content':
$datas = $this->contents;
$datas = &$this->contents;
break;
default :
$datas = $this->etcs;
default:
$datas = &$this->etcs;
break;
}
if ( ! $this->exists('bbs', $key, $group) )
return false;
unset($datas[$group][$key]);
unset( $datas[$group][$key] );
return true;
}
+2 -2
View File
@@ -19,7 +19,7 @@ Class GML_Hook extends Hook {
$args = $this->getArguments($argsNumber, $args);
if (! ($class && $method) && function_exists($function)) {
if (! ($class && $method) && is_callable($function)) {
return call_user_func_array($function, $args);
} elseif ($obj = call_user_func(array($class, $this->singleton))) {
if ($obj !== false) {
@@ -161,4 +161,4 @@ Class GML_Hook extends Hook {
}
}
// end Hook Class;
// end Hook Class;
+123 -26
View File
@@ -9,11 +9,14 @@ include_once(dirname(__FILE__) .'/pbkdf2.compat.php');
**
*************************************************************************/
// 마이크로 타임을 얻어 계산 형식으로 만듦
/**
* 마이크로타임을 반환
* @return float
* @deprecated use `microtime(true)`
*/
function get_microtime()
{
list($usec, $sec) = explode(" ",microtime());
return ((float)$usec + (float)$sec);
return microtime(true);
}
@@ -23,6 +26,7 @@ function get_paging($write_pages, $cur_page, $total_page, $url, $add="")
//$url = preg_replace('#&amp;page=[0-9]*(&amp;page=)$#', '$1', $url);
$url = preg_replace('#(&amp;)?page=[0-9]*#', '', $url);
$url .= substr($url, -1) === '?' ? 'page=' : '&amp;page=';
$url = preg_replace('|[^\w\-~+_.?#=!&;,/:%@$\|*\'()\[\]\\x80-\\xff]|i', '', clean_xss_tags($url));
$str = '';
if ($cur_page > 1) {
@@ -151,6 +155,10 @@ function set_cookie($cookie_name, $value, $expire, $path='/', $domain=G5_COOKIE_
global $g5;
$c = run_replace('set_cookie_params', array('path'=>$path, 'domain'=>$domain, 'secure'=>$secure, 'httponly'=>$httponly), $cookie_name);
if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') {
$c['secure'] = true;
}
setcookie(md5($cookie_name), base64_encode($value), G5_SERVER_TIME + $expire, $c['path'], $c['domain'], $c['secure'], $c['httponly']);
}
@@ -601,46 +609,70 @@ function check_html_link_nofollow($type=''){
return true;
}
// http://htmlpurifier.org/
// Standards-Compliant HTML Filtering
// Safe : HTML Purifier defeats XSS with an audited whitelist
// Clean : HTML Purifier ensures standards-compliant output
// Open : HTML Purifier is open-source and highly customizable
/**
* HTMLPurifier 필터를 거친 HTML 코드를 반환
*
* http://htmlpurifier.org/
* Standards-Compliant HTML Filtering
* Safe : HTML Purifier defeats XSS with an audited whitelist
* Clean : HTML Purifier ensures standards-compliant output
* Open : HTML Purifier is open-source and highly customizable
*
* @param string $html
* @return string
*/
function html_purifier($html)
{
global $is_admin, $write;
$f = file(G5_PLUGIN_PATH.'/htmlpurifier/safeiframe.txt');
$f = file(G5_PLUGIN_PATH . '/htmlpurifier/safeiframe.txt');
$domains = array();
foreach($f as $domain){
foreach ($f as $domain) {
// 첫행이 # 이면 주석 처리
if (!preg_match("/^#/", $domain)) {
$domain = trim($domain);
if ($domain)
if ($domain) {
array_push($domains, $domain);
}
}
}
// 글쓴이가 관리자인 경우에만 현재 사이트 도메인을 허용
if (isset($write['mb_id']) && $write['mb_id'] && is_admin($write['mb_id'])) array_push($domains, $_SERVER['HTTP_HOST'].'/');
if (isset($write['mb_id']) && $write['mb_id'] && is_admin($write['mb_id'])) {
array_push($domains, $_SERVER['HTTP_HOST'] . '/');
}
$safeiframe = implode('|', run_replace('html_purifier_safeiframes', $domains, $html));
include_once(G5_PLUGIN_PATH.'/htmlpurifier/HTMLPurifier.standalone.php');
include_once(G5_PLUGIN_PATH.'/htmlpurifier/extend.video.php');
include_once(G5_PLUGIN_PATH . '/htmlpurifier/HTMLPurifier.standalone.php');
include_once(G5_PLUGIN_PATH . '/htmlpurifier/extend.video.php');
$config = HTMLPurifier_Config::createDefault();
// data/cache 디렉토리에 CSS, HTML, URI 디렉토리 등을 만든다.
$config->set('Cache.SerializerPath', G5_DATA_PATH.'/cache');
$config->set('Cache.SerializerPath', G5_DATA_PATH . '/cache');
$config->set('HTML.SafeEmbed', false);
$config->set('HTML.SafeObject', false);
$config->set('Output.FlashCompat', false);
$config->set('HTML.SafeIframe', true);
if( (function_exists('check_html_link_nofollow') && check_html_link_nofollow('html_purifier')) ){
$config->set('HTML.Nofollow', true); // rel=nofollow 으로 스팸유입을 줄임
if ((function_exists('check_html_link_nofollow') && check_html_link_nofollow('html_purifier'))) {
$config->set('HTML.Nofollow', true); // rel=nofollow 으로 스팸유입을 줄임
}
$config->set('URI.SafeIframeRegexp','%^(https?:)?//('.$safeiframe.')%');
$config->set('URI.SafeIframeRegexp', '%^(https?:)?//(' . $safeiframe . ')%');
$config->set('Attr.AllowedFrameTargets', array('_blank'));
//유튜브, 비메오 전체화면 가능하게 하기
$config->set('Filter.Custom', array(new HTMLPurifier_Filter_Iframevideo()));
/*
* HTMLPurifier 설정을 변경할 수 있는 Event hook
* 리스너에서는 첫번째 인자($config)로 `HTMLPurifier_Config` 객체를 받을 수 있다
*/
run_event('html_purifier_config', $config, array(
'html' => $html,
'write' => $write,
'is_admin' => $is_admin
)
);
$purifier = new HTMLPurifier($config);
return run_replace('html_purifier_result', $purifier->purify($html), $purifier, $html);
}
@@ -768,7 +800,7 @@ function get_next_num($table)
$sql = " select min(wr_num) as min_wr_num from $table ";
$row = sql_fetch($sql);
// 가장 작은 번호에 1을 빼서 넘겨줌
return (int)($row['min_wr_num'] - 1);
return isset($row['min_wr_num']) ? (int)($row['min_wr_num'] - 1) : -1;
}
@@ -865,8 +897,10 @@ function subject_sort_link($col, $query_string='', $flag='asc')
$arr_query[] = 'page='.$page;
$qstr = implode("&amp;", $arr_query);
$url = G5_HTTP_BBS_URL . "/board.php?{$qstr}";
return '<a href="'.short_url_clean($url).'">';
parse_str(html_entity_decode($qstr), $qstr_array);
$url = short_url_clean(get_params_merge_url($qstr_array));
return '<a href="'.$url.'">';
}
@@ -1813,11 +1847,22 @@ function sql_free_result($result)
}
/**
* MySQL PASSWORD() 함수로 생성된 비밀번호의 hash 값을 반환
*
* MySQL 버전에 따라 결과가 다르게 나올 수 있음.
* MySQL 8.0.11 버전 이상에서는 오류 발생(PASSWORD 함수가 제거됨)으로 사용할 수 없음.
*
* @deprecated 이 함수는 안전하지 않으므로 사용하지 않는 것을 권장 함
* @see get_encrypt_string() and check_password()
* @param string $value
* @return string
*/
function sql_password($value)
{
// mysql 4.0x 이하 버전에서는 password() 함수의 결과가 16bytes
// mysql 4.1x 이상 버전에서는 password() 함수의 결과가 41bytes
$row = sql_fetch(" select password('$value') as pass ");
$row = sql_fetch(" SELECT password('{$value}') as pass ");
return $row['pass'];
}
@@ -2225,6 +2270,53 @@ function check_token()
return true;
}
/**
* 브라우저 검증을 위한 세션 반환 및 재생성
* @param array $member 로그인 된 회원의 정보. 가입일시(mb_datetime)를 반드시 포함해야 한다.
* @param bool $regenerate true 이면 재생성
* @return string
*/
function ss_mb_key($member, $regenerate = false)
{
$client_key = ($regenerate) ? null : get_cookie('mb_client_key');
if (!$client_key) {
$client_key = get_random_token_string(16);
set_cookie('mb_client_key', $client_key, G5_SERVER_TIME * -1);
}
$mb_key = md5($member['mb_datetime'] . $client_key) . run_replace('ss_mb_key_user_agent', md5($_SERVER['HTTP_USER_AGENT']));
return $mb_key;
}
/**
* 회원의 클라이언트 검증
* @param array $member 로그인 된 회원의 정보. 가입일시(mb_datetime)를 반드시 포함해야 한다.
* @return bool
*/
function verify_mb_key($member)
{
$mb_key = ss_mb_key($member);
$verified = get_session('ss_mb_key') === $mb_key;
if (!$verified) {
ss_mb_key($member, true);
}
return $verified;
}
/**
* 회원의 클라이언트 검증 키 생성
* 클라이언트 키를 다시 생성하여 생성된 키는 `ss_mb_key` 세션에 저장됨
* @param array $member 로그인 된 회원의 정보. 가입일시(mb_datetime)를 반드시 포함해야 한다.
*/
function generate_mb_key($member)
{
$mb_key = ss_mb_key($member, true);
set_session('ss_mb_key', $mb_key);
}
// 문자열에 utf8 문자가 들어 있는지 검사하는 함수
// 코드 : http://in2.php.net/manual/en/function.mb-check-encoding.php#95289
@@ -2434,14 +2526,19 @@ function check_device($device)
}
// 게시판 최신글 캐시 파일 삭제
/**
* 게시판 최신글 캐시 파일 삭제
* @param string $bo_table 게시판 ID
*/
function delete_cache_latest($bo_table)
{
if (!preg_match("/^([A-Za-z0-9_]{1,20})$/", $bo_table)) {
return;
}
g5_delete_cache_by_prefix('latest-'.$bo_table.'-');
run_event('delete_cache_latest', $bo_table);
g5_delete_cache_by_prefix('latest-' . $bo_table . '-');
}
// 게시판 첨부파일 썸네일 삭제
@@ -3774,7 +3871,7 @@ function check_vaild_callback($callback){
class str_encrypt
{
var $salt;
var $lenght;
var $length;
function __construct($salt='')
{
@@ -4127,7 +4224,7 @@ function get_random_token_string($length=6)
}
$characters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
$output = substr(str_shuffle($characters), 0, $length); // jihan001 님 제안코드로 수정
$output = substr(str_shuffle($characters), 0, $length);
return bin2hex($output);
}
+2 -2
View File
@@ -65,7 +65,7 @@ function run_event($tag, $arg = ''){
}
}
function add_replace($tag, $func, $priority=G5_HOOK_DEFAULT_PRIORITY, $args=0){
function add_replace($tag, $func, $priority=G5_HOOK_DEFAULT_PRIORITY, $args=1){
if( $hook = get_hook_class() ){
return $hook->addFilter($tag, $func, $priority, $args);
@@ -130,4 +130,4 @@ function get_hook_datas($type='', $is_callback=''){
}
return null;
}
}
+17 -8
View File
@@ -1943,8 +1943,9 @@ function is_soldout($it_id, $is_cache=false)
// 상품정보
$it = get_shop_item($it_id, $is_cache);
if($it['it_soldout'] || $it['it_stock_qty'] <= 0)
if ($it['it_soldout']) {
return true;
}
$count = 0;
$soldout = false;
@@ -1953,7 +1954,7 @@ function is_soldout($it_id, $is_cache=false)
$sql = " select count(*) as cnt from {$g5['g5_shop_item_option_table']} where it_id = '$it_id' and io_type = '0' ";
$row = sql_fetch($sql);
if($row['cnt']) {
if (isset($row['cnt']) && $row['cnt']) {
$sql = " select io_id, io_type, io_stock_qty
from {$g5['g5_shop_item_option_table']}
where it_id = '$it_id'
@@ -1972,12 +1973,18 @@ function is_soldout($it_id, $is_cache=false)
// 모든 선택옵션 품절이면 상품 품절
if($i == $count)
$soldout = true;
} else {
// 상품 재고수량
$stock_qty = get_it_stock_qty($it_id);
if($stock_qty <= 0)
} else {
if ($it['it_stock_qty'] <= 0) {
$soldout = true;
} else {
// 상품 재고수량
$stock_qty = get_it_stock_qty($it_id);
if($stock_qty <= 0)
$soldout = true;
}
}
$cache[$key] = $soldout;
@@ -2625,10 +2632,10 @@ function make_order_field($data, $exclude)
if(is_array($value)) {
foreach($value as $k=>$v) {
$field .= '<input type="hidden" name="'.$key.'['.$k.']" value="'.$v.'">'.PHP_EOL;
$field .= '<input type="hidden" name="'.$key.'['.$k.']" value="'.get_text($v).'">'.PHP_EOL;
}
} else {
$field .= '<input type="hidden" name="'.$key.'" value="'.$value.'">'.PHP_EOL;
$field .= '<input type="hidden" name="'.$key.'" value="'.get_text($value).'">'.PHP_EOL;
}
}
@@ -2769,6 +2776,8 @@ function check_pay_name_replace($payname, $od=array(), $is_client=0){
return '네이버페이_NHNKCP'.$add_str;
} else if( isset($od['od_other_pay_type']) && ($od['od_other_pay_type'] === 'OT13' || $od['od_other_pay_type'] === 'NHNKCP_KAKAOMONEY') ){
return '카카오페이_NHNKCP'.$add_str;
} else if( isset($od['od_other_pay_type']) && $od['od_other_pay_type'] === 'OT21' ){
return '애플페이_NHNKCP'.$add_str;
}
return 'PAYCO'.$add_str;
+1
View File
@@ -142,6 +142,7 @@ function shop_short_url_clean($string_url, $url, $page_name, $array_page_names){
$add_param .= $add_param ? '&amp;'.$add_qry : '?'.$add_qry;
}
$return_url = '';
foreach($s as $k => $v) { $return_url .= '/'.$v; }
return $host.$return_url.$add_param.$fragment;
+10 -3
View File
@@ -10,15 +10,22 @@ function get_list_thumbnail($bo_table, $wr_id, $thumb_width, $thumb_height, $is_
$filename = $alt = $data_path = '';
$edt = false;
$row = get_thumbnail_find_cache($bo_table, $wr_id, 'file');
$empty_array = array('src'=>'', 'ori'=>'', 'alt'=>'');
if(isset($row['bf_file']) && $row['bf_file']) {
$write = get_thumbnail_find_cache($bo_table, $wr_id, 'content');
// 비밀글이면 썸네일을 노출하지 않습니다.
if (isset($write['wr_option']) && strstr($write['wr_option'], "secret")) {
return run_replace('is_secret_list_thumbnail', $empty_array, $bo_table, $write);
}
$row = get_thumbnail_find_cache($bo_table, $wr_id, 'file');
if (isset($row['bf_file']) && $row['bf_file']) {
$filename = $row['bf_file'];
$filepath = G5_DATA_PATH.'/file/'.$bo_table;
$alt = get_text($row['bf_content']);
} else {
$write = get_thumbnail_find_cache($bo_table, $wr_id, 'content');
$edt = true;
if( $matches = get_editor_image($write['wr_content'], false) ){
+38 -32
View File
@@ -298,63 +298,69 @@ function seo_title_update($db_table, $pk_id, $type='bbs'){
}
}
function get_nginx_conf_rules($return_string=false){
function get_nginx_conf_rules($return_string = false)
{
$get_path_url = parse_url(G5_URL);
$base_path = isset($get_path_url['path']) ? $get_path_url['path'].'/' : '/';
$base_path = isset($get_path_url['path']) ? $get_path_url['path'] . '/' : '/';
$rules = array();
$rules[] = '#### '.G5_VERSION.' nginx rules BEGIN #####';
$rules[] = 'if (!-e $request_filename){';
$rules[] = '#### ' . G5_VERSION . ' nginx rules BEGIN #####';
if( $add_rules = run_replace('add_nginx_conf_rules', '', $get_path_url, $base_path, $return_string) ){
if ($add_rules = run_replace('add_nginx_conf_pre_rules', '', $get_path_url, $base_path, $return_string)) {
$rules[] = $add_rules;
}
$rules[] = "rewrite ^{$base_path}content/([0-9a-zA-Z_]+)$ {$base_path}".G5_BBS_DIR."/content.php?co_id=$1&rewrite=1 break;";
$rules[] = "rewrite ^{$base_path}content/([^/]+)/$ {$base_path}".G5_BBS_DIR."/content.php?co_seo_title=$1&rewrite=1 break;";
$rules[] = "rewrite ^{$base_path}rss/([0-9a-zA-Z_]+)$ {$base_path}".G5_BBS_DIR."/rss.php?bo_table=$1 break;";
$rules[] = "rewrite ^{$base_path}([0-9a-zA-Z_]+)$ {$base_path}".G5_BBS_DIR."/board.php?bo_table=$1&rewrite=1 break;";
$rules[] = "rewrite ^{$base_path}([0-9a-zA-Z_]+)/write$ {$base_path}".G5_BBS_DIR."/write.php?bo_table=$1&rewrite=1 break;";
$rules[] = "rewrite ^{$base_path}([0-9a-zA-Z_]+)/([^/]+)/$ {$base_path}".G5_BBS_DIR."/board.php?bo_table=$1&wr_seo_title=$2&rewrite=1 break;";
$rules[] = "rewrite ^{$base_path}([0-9a-zA-Z_]+)/([0-9]+)$ {$base_path}".G5_BBS_DIR."/board.php?bo_table=$1&wr_id=$2&rewrite=1 break;";
$rules[] = 'if (!-e $request_filename) {';
if ($add_rules = run_replace('add_nginx_conf_rules', '', $get_path_url, $base_path, $return_string)) {
$rules[] = $add_rules;
}
$rules[] = "rewrite ^{$base_path}content/([0-9a-zA-Z_]+)$ {$base_path}" . G5_BBS_DIR . "/content.php?co_id=$1&rewrite=1 break;";
$rules[] = "rewrite ^{$base_path}content/([^/]+)/$ {$base_path}" . G5_BBS_DIR . "/content.php?co_seo_title=$1&rewrite=1 break;";
$rules[] = "rewrite ^{$base_path}rss/([0-9a-zA-Z_]+)$ {$base_path}" . G5_BBS_DIR . "/rss.php?bo_table=$1 break;";
$rules[] = "rewrite ^{$base_path}([0-9a-zA-Z_]+)$ {$base_path}" . G5_BBS_DIR . "/board.php?bo_table=$1&rewrite=1 break;";
$rules[] = "rewrite ^{$base_path}([0-9a-zA-Z_]+)/write$ {$base_path}" . G5_BBS_DIR . "/write.php?bo_table=$1&rewrite=1 break;";
$rules[] = "rewrite ^{$base_path}([0-9a-zA-Z_]+)/([^/]+)/$ {$base_path}" . G5_BBS_DIR . "/board.php?bo_table=$1&wr_seo_title=$2&rewrite=1 break;";
$rules[] = "rewrite ^{$base_path}([0-9a-zA-Z_]+)/([0-9]+)$ {$base_path}" . G5_BBS_DIR . "/board.php?bo_table=$1&wr_id=$2&rewrite=1 break;";
$rules[] = '}';
$rules[] = '#### '.G5_VERSION.' nginx rules END #####';
$rules[] = '#### ' . G5_VERSION . ' nginx rules END #####';
return $return_string ? implode("\n", $rules) : $rules;
}
function get_mod_rewrite_rules($return_string=false){
function get_mod_rewrite_rules($return_string = false)
{
$get_path_url = parse_url(G5_URL);
$base_path = isset($get_path_url['path']) ? $get_path_url['path'].'/' : '/';
$base_path = isset($get_path_url['path']) ? $get_path_url['path'] . '/' : '/';
$rules = array();
$rules[] = '#### '.G5_VERSION.' rewrite BEGIN #####';
$rules[] = '#### ' . G5_VERSION . ' rewrite BEGIN #####';
$rules[] = '<IfModule mod_rewrite.c>';
$rules[] = 'RewriteEngine On';
$rules[] = 'RewriteBase '.$base_path;
$rules[] = 'RewriteBase ' . $base_path;
if ($add_rules = run_replace('add_mod_rewrite_pre_rules', '', $get_path_url, $base_path, $return_string)) {
$rules[] = $add_rules;
}
$rules[] = 'RewriteCond %{REQUEST_FILENAME} -f [OR]';
$rules[] = 'RewriteCond %{REQUEST_FILENAME} -d';
$rules[] = 'RewriteRule ^ - [L]';
if( $add_rules = run_replace('add_mod_rewrite_rules', '', $get_path_url, $base_path, $return_string) ){
if ($add_rules = run_replace('add_mod_rewrite_rules', '', $get_path_url, $base_path, $return_string)) {
$rules[] = $add_rules;
}
$rules[] = 'RewriteRule ^content/([0-9a-zA-Z_]+)$ '.G5_BBS_DIR.'/content.php?co_id=$1&rewrite=1 [QSA,L]';
$rules[] = 'RewriteRule ^content/([^/]+)/$ '.G5_BBS_DIR.'/content.php?co_seo_title=$1&rewrite=1 [QSA,L]';
$rules[] = 'RewriteRule ^rss/([0-9a-zA-Z_]+)$ '.G5_BBS_DIR.'/rss.php?bo_table=$1 [QSA,L]';
$rules[] = 'RewriteRule ^([0-9a-zA-Z_]+)$ '.G5_BBS_DIR.'/board.php?bo_table=$1&rewrite=1 [QSA,L]';
$rules[] = 'RewriteRule ^([0-9a-zA-Z_]+)/([^/]+)/$ '.G5_BBS_DIR.'/board.php?bo_table=$1&wr_seo_title=$2&rewrite=1 [QSA,L]';
$rules[] = 'RewriteRule ^([0-9a-zA-Z_]+)/write$ '.G5_BBS_DIR.'/write.php?bo_table=$1&rewrite=1 [QSA,L]';
$rules[] = 'RewriteRule ^([0-9a-zA-Z_]+)/([0-9]+)$ '.G5_BBS_DIR.'/board.php?bo_table=$1&wr_id=$2&rewrite=1 [QSA,L]';
$rules[] = 'RewriteRule ^content/([0-9a-zA-Z_]+)$ ' . G5_BBS_DIR . '/content.php?co_id=$1&rewrite=1 [QSA,L]';
$rules[] = 'RewriteRule ^content/([^/]+)/$ ' . G5_BBS_DIR . '/content.php?co_seo_title=$1&rewrite=1 [QSA,L]';
$rules[] = 'RewriteRule ^rss/([0-9a-zA-Z_]+)$ ' . G5_BBS_DIR . '/rss.php?bo_table=$1 [QSA,L]';
$rules[] = 'RewriteRule ^([0-9a-zA-Z_]+)$ ' . G5_BBS_DIR . '/board.php?bo_table=$1&rewrite=1 [QSA,L]';
$rules[] = 'RewriteRule ^([0-9a-zA-Z_]+)/([^/]+)/$ ' . G5_BBS_DIR . '/board.php?bo_table=$1&wr_seo_title=$2&rewrite=1 [QSA,L]';
$rules[] = 'RewriteRule ^([0-9a-zA-Z_]+)/write$ ' . G5_BBS_DIR . '/write.php?bo_table=$1&rewrite=1 [QSA,L]';
$rules[] = 'RewriteRule ^([0-9a-zA-Z_]+)/([0-9]+)$ ' . G5_BBS_DIR . '/board.php?bo_table=$1&wr_id=$2&rewrite=1 [QSA,L]';
$rules[] = '</IfModule>';
$rules[] = '#### '.G5_VERSION.' rewrite END #####';
$rules[] = '#### ' . G5_VERSION . ' rewrite END #####';
return $return_string ? implode("\n", $rules) : $rules;
}
+2 -2
View File
@@ -36,8 +36,8 @@ $result = sql_query($sql);
$cart_count = sql_num_rows($result);
?>
<script src="<?php echo G5_JS_URL; ?>/shop.js"></script>
<script src="<?php echo G5_JS_URL; ?>/shop.override.js"></script>
<script src="<?php echo G5_JS_URL; ?>/shop.js?ver=<?php echo G5_JS_VER; ?>"></script>
<script src="<?php echo G5_JS_URL; ?>/shop.override.js?ver=<?php echo G5_JS_VER; ?>"></script>
<div id="sod_bsk">
+1 -1
View File
@@ -201,7 +201,7 @@ echo run_replace('shop_it_mobile_head_html', '<div id="sit_hhtml">'.conv_content
?>
<?php if($is_orderable) { ?>
<script src="<?php echo G5_JS_URL; ?>/shop.js"></script>
<script src="<?php echo G5_JS_URL; ?>/shop.js?ver=<?php echo G5_JS_VER; ?>"></script>
<?php } ?>
<?php
+1
View File
@@ -29,6 +29,7 @@ $param_opt_3 = isset($_REQUEST['param_opt_3']) ? clean_xss_tags($_REQUEST['param
<input type="hidden" name="naverpay_point_direct" value="Y"> <!-- 네이버페이 포인트 결제를 하려면 naverpay_point_direct 를 Y -->
<?php } ?>
<input type="hidden" name="kakaopay_direct" value="A" > <!-- KAKAOPAY 결제창 호출 -->
<input type="hidden" name="applepay_direct" value="A" > <!-- APPLEPAY 결제창 호출 -->
<!-- 주문번호 -->
<input type="hidden" name="ordr_idxx" value="<?php echo $od_id; ?>">
<!-- 인증수단(영문 소문자) * 반드시 대소문자 구분 -->
+17 -7
View File
@@ -67,6 +67,7 @@ include_once('./_common.php');
$payco_direct = isset($_POST["payco_direct"]) ? $_POST["payco_direct"] : ''; // PAYCO 결제창 호출
$naverpay_direct = isset($_POST["naverpay_direct"]) ? $_POST["naverpay_direct"] : ''; // NAVERPAY 결제창 호출
$kakaopay_direct = isset($_POST["kakaopay_direct"]) ? $_POST["kakaopay_direct"] : ''; // KAKAOPAY 결제창 호출
$applepay_direct = isset($_POST["applepay_direct"]) ? $_POST["applepay_direct"] : ''; // APPLEPAY 결제창 호출
/*
* 기타 파라메터 추가 부분 - Start -
@@ -157,7 +158,7 @@ include_once('./_common.php');
{
var v_frm = document.sm_form;
layer_cont_obj = document.getElementById("content");
layer_receipt_obj = document.getElementById("layer_receipt");
@@ -165,9 +166,16 @@ include_once('./_common.php');
layer_receipt_obj.style.display = "block";
v_frm.target = "frm_receipt";
// IOS 환경의 경우 iframe에서 네이버페이와 애플페이의 cors 문제가 일어나므로 iframe으로 열지 않는다.
var isIOS = /iPad|iPhone|iPod/.test(navigator.platform) || (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1);
// 네이버페이면 반드시 페이지전환 방식이어야 하며, 그 외에는 iframe 방식으로 한다.
if(typeof v_frm.naverpay_direct !== "undefined" && v_frm.naverpay_direct.value == "Y") {
if (isIOS) {
v_frm.target = "";
}
// 네이버페이 또는 애플페이의 경우 반드시 페이지전환 방식이어야 하며, 그 외에는 iframe 방식으로 한다.
if((typeof v_frm.naverpay_direct !== "undefined" && v_frm.naverpay_direct.value == "Y") || (typeof v_frm.applepay_direct !== "undefined" && v_frm.applepay_direct.value == "Y")) {
v_frm.target = "";
}
@@ -267,18 +275,20 @@ if($enc_data != '' && $enc_info != '' && $tran_cd != '') {
?>
<?php if($payco_direct){ ?>
<input type="hidden" name="payco_direct" value="<?php echo $payco_direct; ?>"> <!-- PAYCO 결제창 호출 -->
<input type="hidden" name="payco_direct" value="<?php echo get_text($payco_direct); ?>"> <!-- PAYCO 결제창 호출 -->
<?php } ?>
<?php if($naverpay_direct){ ?>
<input type="hidden" name="naverpay_direct" value="<?php echo $naverpay_direct; ?>"> <!-- 네이버페이 결제창 호출 -->
<input type="hidden" name="naverpay_direct" value="<?php echo get_text($naverpay_direct); ?>"> <!-- 네이버페이 결제창 호출 -->
<?php if(isset($default['de_easy_pay_services']) && in_array('used_nhnkcp_naverpay_point', explode(',', $default['de_easy_pay_services'])) ){ // 네이버페이 포인트 결제 옵션 ?>
<input type="hidden" name="naverpay_point_direct" value="Y"> <!-- 네이버페이 포인트 결제를 하려면 naverpay_point_direct 를 Y -->
<?php } ?>
<?php } ?>
<?php if($applepay_direct === "Y"){ ?>
<input type="hidden" name="applepay_direct" value="<?php echo get_text($applepay_direct); ?>"> <!-- 애플페이 결제창 호출 -->
<?php } ?>
<?php if($kakaopay_direct){ ?>
<input type="hidden" name="kakaopay_direct" value="<?php echo $kakaopay_direct; ?>"> <!-- 카카오페이 결제창 호출 -->
<input type="hidden" name="kakaopay_direct" value="<?php echo get_text($kakaopay_direct); ?>"> <!-- 카카오페이 결제창 호출 -->
<?php } ?>
<!-- 필수 사항 -->
<!-- 요청 구분 -->
+1
View File
@@ -24,6 +24,7 @@ $param_opt_3 = isset($_REQUEST['param_opt_3']) ? clean_xss_tags($_REQUEST['param
<input type="hidden" name="payco_direct" value=""> <!-- PAYCO 결제창 호출 -->
<input type="hidden" name="naverpay_direct" value="A" > <!-- NAVERPAY 결제창 호출 -->
<input type="hidden" name="kakaopay_direct" value="A" > <!-- KAKAOPAY 결제창 호출 -->
<input type="hidden" name="applepay_direct" value="A" > <!-- APPLEPAY 결제창 호출 -->
<!-- 주문번호 -->
<input type="hidden" name="ordr_idxx" value="<?php echo $od_id; ?>">
<!-- 인증수단(영문 소문자) * 반드시 대소문자 구분 -->
+2 -2
View File
@@ -32,7 +32,7 @@ else
if (!$skin)
$skin = $default['de_mobile_listtype_list_skin'];
else
$skin = preg_replace('#\.+[\\\/]#', '', $skin);
$skin = preg_replace('#\.+[\\\/]#', '', strip_tags($skin));
define('G5_SHOP_CSS_URL', G5_MSHOP_SKIN_URL);
@@ -65,7 +65,7 @@ if (file_exists($list_file)) {
}
else
{
echo '<div align="center">'.$skin.' 파일을 찾을 수 없습니다.<br>관리자에게 알려주시면 감사하겠습니다.</div>';
echo '<div align="center">'.get_text($skin).' 파일을 찾을 수 없습니다.<br>관리자에게 알려주시면 감사하겠습니다.</div>';
}
?>
</div>
+1 -1
View File
@@ -111,7 +111,7 @@ $cp_count = get_shop_member_coupon_count($member['mb_id'], true);
<li>
<div class="wish_img"><?php echo $image; ?></div>
<div class="wish_info">
<a href="<?php echo get_shop_item($row['it_id'], true); ?>" class="info_link"><?php echo stripslashes($row['it_name']); ?></a>
<a href="<?php echo shop_item_url($row['it_id']); ?>" class="info_link"><?php echo stripslashes($row['it_name']); ?></a>
<span class="info_date"><?php echo substr($row['wi_time'], 2, 8); ?></span>
</div>
</li>
+19
View File
@@ -624,6 +624,9 @@ if($is_kakaopay_use) {
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>';
}
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 {
$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>';
}
@@ -1233,6 +1236,7 @@ var temp_point = 0;
function pay_approval()
{
// 무통장 아닌 가상계좌, 계좌이체, 휴대폰, 신용카드, 기타 등등 을 처리한다.
// 재고체크
var stock_msg = order_stock_check();
if(stock_msg != "") {
@@ -1299,6 +1303,7 @@ function pay_approval()
if(typeof f.payco_direct !== "undefined") f.payco_direct.value = "";
if(typeof f.naverpay_direct !== "undefined") f.naverpay_direct.value = "A";
if(typeof f.kakaopay_direct !== "undefined") f.kakaopay_direct.value = "A";
if(typeof f.applepay_direct !== "undefined") f.applepay_direct.value = "A";
if(typeof f.ActionResult !== "undefined") f.ActionResult.value = "";
if(typeof f.pay_method !== "undefined") f.pay_method.value = "";
@@ -1311,6 +1316,8 @@ function pay_approval()
}
} else if(nhnkcp_easy_pay === "kakaopay"){
if(typeof f.kakaopay_direct !== "undefined") f.kakaopay_direct.value = "Y";
} else if(nhnkcp_easy_pay === "applepay"){
if(typeof f.applepay_direct !== "undefined") f.applepay_direct.value = "Y";
} else {
if(typeof f.payco_direct !== "undefined") f.payco_direct.value = "Y";
}
@@ -1318,6 +1325,10 @@ function pay_approval()
if(typeof f.ActionResult !== "undefined") f.ActionResult.value = "CARD"; // 대소문자 구분
if(typeof f.pay_method !== "undefined") f.pay_method.value = "card"; // 대소문자 구분
//if(nhnkcp_easy_pay === "applepay"){
// if(typeof f.ActionResult !== "undefined") f.ActionResult.value = "card";
// if(typeof f.pay_method !== "undefined") f.pay_method.value = "CARD";
//}
}
<?php } else if($default['de_pg_service'] == 'lg') { ?>
@@ -1435,6 +1446,14 @@ function pay_approval()
function forderform_check()
{
// 무통장만 여기에처 처리한다.
// 재고체크
var stock_msg = order_stock_check();
if(stock_msg != "") {
alert(stock_msg);
return false;
}
var f = document.forderform;
// 필드체크
+9 -1
View File
@@ -705,10 +705,18 @@ $sql_card_point = "";
if ($od_receipt_price > 0 && !$default['de_card_point']) {
$sql_card_point = " , ct_point = '0' ";
}
// 회원 아이디 값 변경
$sql_mb_id = "";
if ($is_member) {
$sql_mb_id = " , mb_id = '{$member['mb_id']}' ";
}
$sql = "update {$g5['g5_shop_cart_table']}
set od_id = '$od_id',
ct_status = '$cart_status'
$sql_card_point
$sql_mb_id
where od_id = '$tmp_cart_id'
and ct_select = '1' ";
$result = sql_query($sql, false);
@@ -758,7 +766,7 @@ $od_memo = nl2br(htmlspecialchars2(stripslashes($od_memo))) . "&nbsp;";
if($is_member) {
$it_cp_cnt = (isset($_POST['cp_id']) && is_array($_POST['cp_id'])) ? count($_POST['cp_id']) : 0;
for($i=0; $i<$it_cp_cnt; $i++) {
$cid = isset($_POST['cp_id'][$i]) ? $_POST['cp_id'][$i] : '';
$cid = isset($_POST['cp_id'][$i]) ? clean_xss_tags($_POST['cp_id'][$i], 1, 1) : '';
$cp_it_id = isset($_POST['it_id'][$i]) ? safe_replace_regex($_POST['it_id'][$i], 'it_id') : '';
$cp_prc = isset($arr_it_cp_prc[$cp_it_id]) ? (int) $arr_it_cp_prc[$cp_it_id] : 0;
+4 -4
View File
@@ -17,10 +17,10 @@ if (isset($_GET['qname']) || isset($_GET['qexplan']) || isset($_GET['qid']) || i
$search_all = false;
$q = utf8_strcut(get_search_string(trim($_GET['q'])), 30, "");
$qname = isset($_GET['qname']) ? trim($_GET['qname']) : '';
$qexplan = isset($_GET['qexplan']) ? trim($_GET['qexplan']) : '';
$qid = isset($_GET['qid']) ? trim($_GET['qid']) : '';
$qbasic = isset($_GET['qbasic']) ? trim($_GET['qbasic']) : '';
$qname = isset($_GET['qname']) ? trim(clean_xss_tags($_GET['qname'])) : '';
$qexplan = isset($_GET['qexplan']) ? trim(clean_xss_tags($_GET['qexplan'])) : '';
$qid = isset($_GET['qid']) ? trim(clean_xss_tags($_GET['qid'])) : '';
$qbasic = isset($_GET['qbasic']) ? trim(clean_xss_tags($_GET['qbasic'])) : '';
$qcaid = isset($_GET['qcaid']) ? preg_replace('#[^a-z0-9]#i', '', trim($_GET['qcaid'])) : '';
$qfrom = isset($_GET['qfrom']) ? preg_replace('/[^0-9]/', '', trim($_GET['qfrom'])) : '';
$qto = isset($_GET['qto']) ? preg_replace('/[^0-9]/', '', trim($_GET['qto'])) : '';
+2 -2
View File
@@ -14,12 +14,10 @@ if ($default['de_card_test']) {
if ($default['de_escrow_use'] == 1) {
// 에스크로결제 테스트
$default['de_inicis_mid'] = 'iniescrow0';
$default['de_inicis_admin_key'] = '1111';
}
else {
// 일반결제 테스트
$default['de_inicis_mid'] = 'INIpayTest';
$default['de_inicis_admin_key'] = '1111';
}
}
else {
@@ -109,6 +107,8 @@ $inicis_cardpoint = $default['de_inicis_cartpoint_use'] ? '&cp_yn=Y' : '';
// 예) BC 2,3,6개월, 국민 3,6개월, 삼성 6,9개월 무이자 : 11-2:3:6^06-3:6^12-3:6:4
//$inicis_cardpoint .= ''; // &merc_noint=Y&noint_quota=카드사코드-개월:개월^추가카드사코드-개월:개월:개월 형식으로 설정
require_once(G5_SHOP_PATH.'/inicis/libs/inicis_youngcart_fn.php');
$noti_url = G5_MSHOP_URL.'/inicis/settle_common.php';
$next_url = G5_MSHOP_URL.'/inicis/pay_approval.php';
$return_url = G5_MSHOP_URL.'/inicis/pay_return.php?oid=';
+2 -2
View File
@@ -33,14 +33,14 @@ add_stylesheet('<link rel="stylesheet" href="'.$member_skin_url.'/style.css">',
<h2>회원로그인 안내</h2>
<div>
<a href="<?php echo G5_BBS_URL ?>/password_lost.php">아이디/비밀번호 찾기</a>
<a href="./register.php">회원 가입</a>
<a href="<?php echo G5_BBS_URL ?>/register.php">회원 가입</a>
</div>
</section>
</form>
<?php // 쇼핑몰 사용시 여기부터 ?>
<?php if ($default['de_level_sell'] == 1) { // 상품구입 권한 ?>
<?php if (isset($default['de_level_sell']) && $default['de_level_sell'] == 1) { // 상품구입 권한 ?>
<!-- 주문하기, 신청하기 -->
<?php if (preg_match("/orderform.php/", $url)) { ?>
+2 -2
View File
@@ -13,7 +13,7 @@
/* 회원가입 약관 */
#fregister section {position:relative;background:#fff;border-bottom:1px solid #e5e9f0;padding:15px}
#fregister_chkall {position:relative;font-size:bold;text-align:left;background:#fff;padding:15px;border-top:1px solid #e5e9f0;border-bottom:1px solid #e5e9f0;border-radius:3px}
#fregister_chkall {position:relative;font-weight:bold;text-align:left;background:#fff;padding:15px;border-top:1px solid #e5e9f0;border-bottom:1px solid #e5e9f0;border-radius:3px}
#fregister h2 {text-align:left;padding-bottom:15px;line-height:1.7em;font-size:1.4em}
#fregister textarea {display:block;width:100%;height:180px;padding:10px;background:#fbfbfb;border:1px solid #d1d7d8;line-height:1.5em;color:#555}
#fregister p {position:relative;text-align:left;color:#fff;line-height:18px;padding:15px;font-size:1.1em;background:#f2838f;margin:15px;border-radius:5px}
@@ -98,7 +98,7 @@
/* 기존 회원 본인인증 */
#member_cert_refresh section {position:relative;background:#fff;border-bottom:1px solid #e5e9f0;padding:15px}
#member_cert_refresh_chkall {position:relative;font-size:bold;text-align:left;background:#fff;padding:15px;border-top:1px solid #e5e9f0;border-bottom:1px solid #e5e9f0;border-radius:3px}
#member_cert_refresh_chkall {position:relative;font-weight:bold;text-align:left;background:#fff;padding:15px;border-top:1px solid #e5e9f0;border-bottom:1px solid #e5e9f0;border-radius:3px}
#member_cert_refresh h2 {text-align:left;padding-bottom:15px;line-height:1.7em;font-size:1.4em}
#member_cert_refresh textarea {display:block;width:100%;height:180px;padding:10px;background:#fbfbfb;border:1px solid #d1d7d8;line-height:1.5em;color:#555}
#member_cert_refresh p {position:relative;text-align:left;color:#fff;line-height:18px;padding:15px;font-size:1.1em;background:#f2838f;margin:15px;border-radius:5px}
+62 -44
View File
@@ -1,35 +1,35 @@
<?php
require_once("config.php");
if(!function_exists('ft_nonce_is_valid')){
if (!function_exists('ft_nonce_is_valid')) {
include_once('../editor.lib.php');
}
if( !function_exists('che_reprocessImage') ){
function che_reprocessImage($file_path, $callback){
if (!function_exists('che_reprocessImage')) {
function che_reprocessImage($file_path, $callback)
{
$MIME_TYPES_PROCESSORS = array(
"image/gif" => array("imagecreatefromgif", "imagegif"),
"image/jpg" => array("imagecreatefromjpeg", "imagejpeg"),
"image/jpeg" => array("imagecreatefromjpeg", "imagejpeg"),
"image/png" => array("imagecreatefrompng", "imagepng"),
"image/webp" => array("imagecreatefromwebp", "imagewebp"),
"image/bmp" => array("imagecreatefromwbmp", "imagewbmp")
"image/gif" => array("imagecreatefromgif", "imagegif"),
"image/jpg" => array("imagecreatefromjpeg", "imagejpeg"),
"image/jpeg" => array("imagecreatefromjpeg", "imagejpeg"),
"image/png" => array("imagecreatefrompng", "imagepng"),
"image/webp" => array("imagecreatefromwebp", "imagewebp"),
"image/bmp" => array("imagecreatefromwbmp", "imagewbmp")
);
// Extracting mime type using getimagesize
try {
$image_info = getimagesize($file_path);
if ($image_info === null) {
//throw new Exception("Invalid image type");
return false;
//throw new Exception("Invalid image type");
return false;
}
$mime_type = $image_info["mime"];
if (!array_key_exists($mime_type, $MIME_TYPES_PROCESSORS)) {
//throw new Exception("Invalid image MIME type");
return false;
//throw new Exception("Invalid image MIME type");
return false;
}
$image_from_file = $MIME_TYPES_PROCESSORS[$mime_type][0];
@@ -38,13 +38,13 @@ if( !function_exists('che_reprocessImage') ){
$reprocessed_image = @$image_from_file($file_path);
if (!$reprocessed_image) {
//throw new Exception("Unable to create reprocessed image from file");
return false;
//throw new Exception("Unable to create reprocessed image from file");
return false;
}
// Calling callback(if set) with path of image as a parameter
if ($callback !== null) {
$callback($reprocessed_image);
$callback($reprocessed_image);
}
// Freeing up memory
@@ -60,13 +60,13 @@ if( !function_exists('che_reprocessImage') ){
$is_editor_upload = false;
$get_nonce = get_session('nonce_'.FT_NONCE_SESSION_KEY);
$get_nonce = get_session('nonce_' . FT_NONCE_SESSION_KEY);
if( $get_nonce && ft_nonce_is_valid( $get_nonce, 'cheditor' ) ){
if ($get_nonce && ft_nonce_is_valid($get_nonce, 'cheditor')) {
$is_editor_upload = true;
}
if( !$is_editor_upload ){
if (!$is_editor_upload) {
exit;
}
@@ -78,19 +78,19 @@ run_event('cheditor_photo_upload', $data_dir, $data_url);
$tempfile = $_FILES['file']['tmp_name'];
$filename = $_FILES['file']['name'];
$filename_len = strrpos($filename, ".");
$type = substr($filename, strrpos($filename, ".")+1);
$type = substr($filename, strrpos($filename, ".") + 1);
$found = false;
switch ($type) {
case "jpg":
case "jpeg":
case "gif":
case "png":
case "jpg":
case "jpeg":
case "gif":
case "png":
case "webp":
$found = true;
$found = true;
}
if ($found != true || $filename_len != 23) {
exit;
exit;
}
// 저장 파일 이름: 년월일시분초_렌덤문자8자
@@ -105,32 +105,50 @@ $imgsize = getimagesize($savefile);
$filesize = filesize($savefile);
if (!$imgsize) {
$filesize = 0;
$random_name = '-ERR';
unlink($savefile);
};
$filesize = 0;
$random_name = '-ERR';
unlink($savefile);
}
if ( CHE_UPLOAD_IMG_CHECK && ! che_reprocessImage($savefile, null) ){
$filesize = 0;
$random_name = '-ERR';
unlink($savefile);
if (CHE_UPLOAD_IMG_CHECK && !che_reprocessImage($savefile, null)) {
$filesize = 0;
$random_name = '-ERR';
unlink($savefile);
}
try {
if(defined('G5_FILE_PERMISSION')) chmod($savefile, G5_FILE_PERMISSION);
if (defined('G5_FILE_PERMISSION')) {
chmod($savefile, G5_FILE_PERMISSION);
}
} catch (Exception $e) {
}
$file_url = SAVE_URL.'/'.$filename;
$file_url = SAVE_URL . '/' . $filename;
if( function_exists('run_replace') ){
$file_url = run_replace('get_editor_upload_url', $file_url, $savefile, array());
if (function_exists('run_replace')) {
$fileInfo = new \stdClass();
$fileInfo->name = (string) $filename;
$fileInfo->size = (int) $filesize;
$fileInfo->url = (string) $file_url;
if (isset($_POST['origname'])) {
$fileInfo->oriname = (string) $_POST['origname'];
}
if ($imgsize) {
$fileInfo->width = (int) $imgsize[0];
$fileInfo->height = (int) $imgsize[1];
$fileInfo->type = (string) $imgsize['mime'];
}
$file_url = run_replace('get_editor_upload_url', $file_url, $savefile, $fileInfo);
}
$rdata = sprintf('{"fileUrl": "%s", "filePath": "%s", "fileName": "%s", "fileSize": "%d" }',
$file_url,
$savefile,
$filename,
$filesize );
$rdata = sprintf(
'{"fileUrl": "%s", "fileName": "%s", "fileSize": "%d" }',
$file_url,
$filename,
$filesize
);
echo $rdata;
@@ -315,7 +315,7 @@ class Services_JSON
*/
for ($c = 0; $c < $strlen_var; ++$c) {
$ord_var_c = ord($var{$c});
$ord_var_c = ord($var[$c]);
switch (true) {
case $ord_var_c == 0x08:
@@ -338,12 +338,12 @@ class Services_JSON
case $ord_var_c == 0x2F:
case $ord_var_c == 0x5C:
// double quote, slash, slosh
$ascii .= '\\'.$var{$c};
$ascii .= '\\'.$var[$c];
break;
case (($ord_var_c >= 0x20) && ($ord_var_c <= 0x7F)):
// characters U-00000000 - U-0000007F (same as ASCII)
$ascii .= $var{$c};
$ascii .= $var[$c];
break;
case (($ord_var_c & 0xE0) == 0xC0):
@@ -355,7 +355,7 @@ class Services_JSON
break;
}
$char = pack('C*', $ord_var_c, ord($var{$c + 1}));
$char = pack('C*', $ord_var_c, ord($var[$c + 1]));
$c += 1;
$utf16 = $this->utf82utf16($char);
$ascii .= sprintf('\u%04s', bin2hex($utf16));
@@ -370,8 +370,8 @@ class Services_JSON
// characters U-00000800 - U-0000FFFF, mask 1110XXXX
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
$char = pack('C*', $ord_var_c,
@ord($var{$c + 1}),
@ord($var{$c + 2}));
@ord($var[$c + 1]),
@ord($var[$c + 2]));
$c += 2;
$utf16 = $this->utf82utf16($char);
$ascii .= sprintf('\u%04s', bin2hex($utf16));
@@ -386,9 +386,9 @@ class Services_JSON
// characters U-00010000 - U-001FFFFF, mask 11110XXX
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
$char = pack('C*', $ord_var_c,
ord($var{$c + 1}),
ord($var{$c + 2}),
ord($var{$c + 3}));
ord($var[$c + 1]),
ord($var[$c + 2]),
ord($var[$c + 3]));
$c += 3;
$utf16 = $this->utf82utf16($char);
$ascii .= sprintf('\u%04s', bin2hex($utf16));
@@ -403,10 +403,10 @@ class Services_JSON
break;
}
$char = pack('C*', $ord_var_c,
ord($var{$c + 1}),
ord($var{$c + 2}),
ord($var{$c + 3}),
ord($var{$c + 4}));
ord($var[$c + 1]),
ord($var[$c + 2]),
ord($var[$c + 3]),
ord($var[$c + 4]));
$c += 4;
$utf16 = $this->utf82utf16($char);
$ascii .= sprintf('\u%04s', bin2hex($utf16));
@@ -421,11 +421,11 @@ class Services_JSON
// characters U-04000000 - U-7FFFFFFF, mask 1111110X
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
$char = pack('C*', $ord_var_c,
ord($var{$c + 1}),
ord($var{$c + 2}),
ord($var{$c + 3}),
ord($var{$c + 4}),
ord($var{$c + 5}));
ord($var[$c + 1]),
ord($var[$c + 2]),
ord($var[$c + 3]),
ord($var[$c + 4]),
ord($var[$c + 5]));
$c += 5;
$utf16 = $this->utf82utf16($char);
$ascii .= sprintf('\u%04s', bin2hex($utf16));
@@ -618,7 +618,7 @@ class Services_JSON
for ($c = 0; $c < $strlen_chrs; ++$c) {
$substr_chrs_c_2 = $this->substr8($chrs, $c, 2);
$ord_chrs_c = ord($chrs{$c});
$ord_chrs_c = ord($chrs[$c]);
switch (true) {
case $substr_chrs_c_2 == '\b':
@@ -648,7 +648,7 @@ class Services_JSON
case $substr_chrs_c_2 == '\\/':
if (($delim == '"' && $substr_chrs_c_2 != '\\\'') ||
($delim == "'" && $substr_chrs_c_2 != '\\"')) {
$utf8 .= $chrs{++$c};
$utf8 .= $chrs[++$c];
}
break;
@@ -661,7 +661,7 @@ class Services_JSON
break;
case ($ord_chrs_c >= 0x20) && ($ord_chrs_c <= 0x7F):
$utf8 .= $chrs{$c};
$utf8 .= $chrs[$c];
break;
case ($ord_chrs_c & 0xE0) == 0xC0:
@@ -708,7 +708,7 @@ class Services_JSON
} elseif (preg_match('/^\[.*\]$/s', $str) || preg_match('/^\{.*\}$/s', $str)) {
// array, or object notation
if ($str{0} == '[') {
if ($str[0] == '[') {
$stk = array(SERVICES_JSON_IN_ARR);
$arr = array();
} else {
@@ -747,7 +747,7 @@ class Services_JSON
$top = end($stk);
$substr_chrs_c_2 = $this->substr8($chrs, $c, 2);
if (($c == $strlen_chrs) || (($chrs{$c} == ',') && ($top['what'] == SERVICES_JSON_SLICE))) {
if (($c == $strlen_chrs) || (($chrs[$c] == ',') && ($top['what'] == SERVICES_JSON_SLICE))) {
// found a comma that is not inside a string, array, etc.,
// OR we've reached the end of the character list
$slice = $this->substr8($chrs, $top['where'], ($c - $top['where']));
@@ -788,12 +788,12 @@ class Services_JSON
}
} elseif ((($chrs{$c} == '"') || ($chrs{$c} == "'")) && ($top['what'] != SERVICES_JSON_IN_STR)) {
} elseif ((($chrs[$c] == '"') || ($chrs[$c] == "'")) && ($top['what'] != SERVICES_JSON_IN_STR)) {
// found a quote, and we are not inside a string
array_push($stk, array('what' => SERVICES_JSON_IN_STR, 'where' => $c, 'delim' => $chrs{$c}));
array_push($stk, array('what' => SERVICES_JSON_IN_STR, 'where' => $c, 'delim' => $chrs[$c]));
//print("Found start of string at {$c}\n");
} elseif (($chrs{$c} == $top['delim']) &&
} elseif (($chrs[$c] == $top['delim']) &&
($top['what'] == SERVICES_JSON_IN_STR) &&
(($this->strlen8($this->substr8($chrs, 0, $c)) - $this->strlen8(rtrim($this->substr8($chrs, 0, $c), '\\'))) % 2 != 1)) {
// found a quote, we're in a string, and it's not escaped
@@ -802,24 +802,24 @@ class Services_JSON
array_pop($stk);
//print("Found end of string at {$c}: ".$this->substr8($chrs, $top['where'], (1 + 1 + $c - $top['where']))."\n");
} elseif (($chrs{$c} == '[') &&
} elseif (($chrs[$c] == '[') &&
in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {
// found a left-bracket, and we are in an array, object, or slice
array_push($stk, array('what' => SERVICES_JSON_IN_ARR, 'where' => $c, 'delim' => false));
//print("Found start of array at {$c}\n");
} elseif (($chrs{$c} == ']') && ($top['what'] == SERVICES_JSON_IN_ARR)) {
} elseif (($chrs[$c] == ']') && ($top['what'] == SERVICES_JSON_IN_ARR)) {
// found a right-bracket, and we're in an array
array_pop($stk);
//print("Found end of array at {$c}: ".$this->substr8($chrs, $top['where'], (1 + $c - $top['where']))."\n");
} elseif (($chrs{$c} == '{') &&
} elseif (($chrs[$c] == '{') &&
in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {
// found a left-brace, and we are in an array, object, or slice
array_push($stk, array('what' => SERVICES_JSON_IN_OBJ, 'where' => $c, 'delim' => false));
//print("Found start of object at {$c}\n");
} elseif (($chrs{$c} == '}') && ($top['what'] == SERVICES_JSON_IN_OBJ)) {
} elseif (($chrs[$c] == '}') && ($top['what'] == SERVICES_JSON_IN_OBJ)) {
// found a right-brace, and we're in an object
array_pop($stk);
//print("Found end of object at {$c}: ".$this->substr8($chrs, $top['where'], (1 + $c - $top['where']))."\n");
+3 -3
View File
@@ -12,9 +12,9 @@ if($config['cf_cert_use'] == 2) { // 실서비스 일때
$mTxId ='SIR_'.$max_cr_id;
certify_count_check($member['mb_id'], 'simple'); // 금일 인증시도 횟수 체크
} else { // 테스트 일때
$mid = "INIiasTest";
$apiKey = "TGdxb2l3enJDWFRTbTgvREU3MGYwUT09";
$mTxId ='test_'.$max_cr_id;
$mid = "SRAiasTest";
$apiKey = "43700dfd4c795fe9550853aef3b6aaf1";
$mTxId ='SIR_'.$max_cr_id;
}
$reqSvcCd ='01';
+38 -38
View File
@@ -153,7 +153,7 @@ class Services_JSON
return mb_convert_encoding($utf16, 'UTF-8', 'UTF-16');
}
$bytes = (ord($utf16{0}) << 8) | ord($utf16{1});
$bytes = (ord($utf16[0]) << 8) | ord($utf16[1]);
switch(true) {
case ((0x7F & $bytes) == $bytes):
@@ -206,17 +206,17 @@ class Services_JSON
case 2:
// return a UTF-16 character from a 2-byte UTF-8 char
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
return chr(0x07 & (ord($utf8{0}) >> 2))
. chr((0xC0 & (ord($utf8{0}) << 6))
| (0x3F & ord($utf8{1})));
return chr(0x07 & (ord($utf8[0]) >> 2))
. chr((0xC0 & (ord($utf8[0]) << 6))
| (0x3F & ord($utf8[1])));
case 3:
// return a UTF-16 character from a 3-byte UTF-8 char
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
return chr((0xF0 & (ord($utf8{0}) << 4))
| (0x0F & (ord($utf8{1}) >> 2)))
. chr((0xC0 & (ord($utf8{1}) << 6))
| (0x7F & ord($utf8{2})));
return chr((0xF0 & (ord($utf8[0]) << 4))
| (0x0F & (ord($utf8[1]) >> 2)))
. chr((0xC0 & (ord($utf8[1]) << 6))
| (0x7F & ord($utf8[2])));
}
// ignoring UTF-32 for now, sorry
@@ -261,7 +261,7 @@ class Services_JSON
*/
for ($c = 0; $c < $strlen_var; ++$c) {
$ord_var_c = ord($var{$c});
$ord_var_c = ord($var[$c]);
switch (true) {
case $ord_var_c == 0x08:
@@ -284,18 +284,18 @@ class Services_JSON
case $ord_var_c == 0x2F:
case $ord_var_c == 0x5C:
// double quote, slash, slosh
$ascii .= '\\'.$var{$c};
$ascii .= '\\'.$var[$c];
break;
case (($ord_var_c >= 0x20) && ($ord_var_c <= 0x7F)):
// characters U-00000000 - U-0000007F (same as ASCII)
$ascii .= $var{$c};
$ascii .= $var[$c];
break;
case (($ord_var_c & 0xE0) == 0xC0):
// characters U-00000080 - U-000007FF, mask 110XXXXX
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
$char = pack('C*', $ord_var_c, ord($var{$c + 1}));
$char = pack('C*', $ord_var_c, ord($var[$c + 1]));
$c += 1;
$utf16 = $this->utf82utf16($char);
$ascii .= sprintf('\u%04s', bin2hex($utf16));
@@ -305,8 +305,8 @@ class Services_JSON
// characters U-00000800 - U-0000FFFF, mask 1110XXXX
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
$char = pack('C*', $ord_var_c,
ord($var{$c + 1}),
ord($var{$c + 2}));
ord($var[$c + 1]),
ord($var[$c + 2]));
$c += 2;
$utf16 = $this->utf82utf16($char);
$ascii .= sprintf('\u%04s', bin2hex($utf16));
@@ -316,9 +316,9 @@ class Services_JSON
// characters U-00010000 - U-001FFFFF, mask 11110XXX
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
$char = pack('C*', $ord_var_c,
ord($var{$c + 1}),
ord($var{$c + 2}),
ord($var{$c + 3}));
ord($var[$c + 1]),
ord($var[$c + 2]),
ord($var[$c + 3]));
$c += 3;
$utf16 = $this->utf82utf16($char);
$ascii .= sprintf('\u%04s', bin2hex($utf16));
@@ -328,10 +328,10 @@ class Services_JSON
// characters U-00200000 - U-03FFFFFF, mask 111110XX
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
$char = pack('C*', $ord_var_c,
ord($var{$c + 1}),
ord($var{$c + 2}),
ord($var{$c + 3}),
ord($var{$c + 4}));
ord($var[$c + 1]),
ord($var[$c + 2]),
ord($var[$c + 3]),
ord($var[$c + 4]));
$c += 4;
$utf16 = $this->utf82utf16($char);
$ascii .= sprintf('\u%04s', bin2hex($utf16));
@@ -341,11 +341,11 @@ class Services_JSON
// characters U-04000000 - U-7FFFFFFF, mask 1111110X
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
$char = pack('C*', $ord_var_c,
ord($var{$c + 1}),
ord($var{$c + 2}),
ord($var{$c + 3}),
ord($var{$c + 4}),
ord($var{$c + 5}));
ord($var[$c + 1]),
ord($var[$c + 2]),
ord($var[$c + 3]),
ord($var[$c + 4]),
ord($var[$c + 5]));
$c += 5;
$utf16 = $this->utf82utf16($char);
$ascii .= sprintf('\u%04s', bin2hex($utf16));
@@ -520,7 +520,7 @@ class Services_JSON
for ($c = 0; $c < $strlen_chrs; ++$c) {
$substr_chrs_c_2 = substr($chrs, $c, 2);
$ord_chrs_c = ord($chrs{$c});
$ord_chrs_c = ord($chrs[$c]);
switch (true) {
case $substr_chrs_c_2 == '\b':
@@ -550,7 +550,7 @@ class Services_JSON
case $substr_chrs_c_2 == '\\/':
if (($delim == '"' && $substr_chrs_c_2 != '\\\'') ||
($delim == "'" && $substr_chrs_c_2 != '\\"')) {
$utf8 .= $chrs{++$c};
$utf8 .= $chrs[++$c];
}
break;
@@ -563,7 +563,7 @@ class Services_JSON
break;
case ($ord_chrs_c >= 0x20) && ($ord_chrs_c <= 0x7F):
$utf8 .= $chrs{$c};
$utf8 .= $chrs[$c];
break;
case ($ord_chrs_c & 0xE0) == 0xC0:
@@ -610,7 +610,7 @@ class Services_JSON
} elseif (preg_match('/^\[.*\]$/s', $str) || preg_match('/^\{.*\}$/s', $str)) {
// array, or object notation
if ($str{0} == '[') {
if ($str[0] == '[') {
$stk = array(SERVICES_JSON_IN_ARR);
$arr = array();
} else {
@@ -649,7 +649,7 @@ class Services_JSON
$top = end($stk);
$substr_chrs_c_2 = substr($chrs, $c, 2);
if (($c == $strlen_chrs) || (($chrs{$c} == ',') && ($top['what'] == SERVICES_JSON_SLICE))) {
if (($c == $strlen_chrs) || (($chrs[$c] == ',') && ($top['what'] == SERVICES_JSON_SLICE))) {
// found a comma that is not inside a string, array, etc.,
// OR we've reached the end of the character list
$slice = substr($chrs, $top['where'], ($c - $top['where']));
@@ -691,12 +691,12 @@ class Services_JSON
}
} elseif ((($chrs{$c} == '"') || ($chrs{$c} == "'")) && ($top['what'] != SERVICES_JSON_IN_STR)) {
} elseif ((($chrs[$c] == '"') || ($chrs[$c] == "'")) && ($top['what'] != SERVICES_JSON_IN_STR)) {
// found a quote, and we are not inside a string
array_push($stk, array('what' => SERVICES_JSON_IN_STR, 'where' => $c, 'delim' => $chrs{$c}));
array_push($stk, array('what' => SERVICES_JSON_IN_STR, 'where' => $c, 'delim' => $chrs[$c]));
//print("Found start of string at {$c}\n");
} elseif (($chrs{$c} == $top['delim']) &&
} elseif (($chrs[$c] == $top['delim']) &&
($top['what'] == SERVICES_JSON_IN_STR) &&
((strlen(substr($chrs, 0, $c)) - strlen(rtrim(substr($chrs, 0, $c), '\\'))) % 2 != 1)) {
// found a quote, we're in a string, and it's not escaped
@@ -705,24 +705,24 @@ class Services_JSON
array_pop($stk);
//print("Found end of string at {$c}: ".substr($chrs, $top['where'], (1 + 1 + $c - $top['where']))."\n");
} elseif (($chrs{$c} == '[') &&
} elseif (($chrs[$c] == '[') &&
in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {
// found a left-bracket, and we are in an array, object, or slice
array_push($stk, array('what' => SERVICES_JSON_IN_ARR, 'where' => $c, 'delim' => false));
//print("Found start of array at {$c}\n");
} elseif (($chrs{$c} == ']') && ($top['what'] == SERVICES_JSON_IN_ARR)) {
} elseif (($chrs[$c] == ']') && ($top['what'] == SERVICES_JSON_IN_ARR)) {
// found a right-bracket, and we're in an array
array_pop($stk);
//print("Found end of array at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
} elseif (($chrs{$c} == '{') &&
} elseif (($chrs[$c] == '{') &&
in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {
// found a left-brace, and we are in an array, object, or slice
array_push($stk, array('what' => SERVICES_JSON_IN_OBJ, 'where' => $c, 'delim' => false));
//print("Found start of object at {$c}\n");
} elseif (($chrs{$c} == '}') && ($top['what'] == SERVICES_JSON_IN_OBJ)) {
} elseif (($chrs[$c] == '}') && ($top['what'] == SERVICES_JSON_IN_OBJ)) {
// found a right-brace, and we're in an object
array_pop($stk);
//print("Found end of object at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
+3 -3
View File
@@ -42,15 +42,15 @@ if (function_exists('before_check_cart_price')) {
}
// 재고체크
$sql = " select *
$sql = " select *, sum(ct_qty) as sum_ct_qty
from {$g5['g5_shop_cart_table']}
where od_id = '$tmp_cart_id'
and ct_select = '1'
and ct_status = '쇼핑' ";
and ct_status = '쇼핑' GROUP BY od_id, it_id, it_name, ct_option, io_id, io_type ";
$result = sql_query($sql);
for($i=0; $row=sql_fetch_array($result); $i++) {
$ct_qty = $row['ct_qty'];
$ct_qty = $row['sum_ct_qty'];
// 해당 상품이 품절 또는 판매중지 상태인지 체크합니다.
$sql = " select it_soldout, it_use, ca_id, ca_id2, ca_id3 from {$g5['g5_shop_item_table']} where it_id = '".$row['it_id']."' ";
+2 -2
View File
@@ -42,8 +42,8 @@ include_once('./_head.php');
?>
<!-- 장바구니 시작 { -->
<script src="<?php echo G5_JS_URL; ?>/shop.js"></script>
<script src="<?php echo G5_JS_URL; ?>/shop.override.js"></script>
<script src="<?php echo G5_JS_URL; ?>/shop.js?ver=<?php echo G5_JS_VER; ?>"></script>
<script src="<?php echo G5_JS_URL; ?>/shop.override.js?ver=<?php echo G5_JS_VER; ?>"></script>
<div id="sod_bsk" class="od_prd_list">
+8 -3
View File
@@ -58,10 +58,14 @@ if($act == "buy")
}
// 주문 상품의 재고체크
$sql = " select ct_qty, it_name, ct_option, io_id, io_type
// 동일 상품 옵션이 레코드에 있는 경우 재고를 제대로 체크하지 못하는 오류가 있음
// $sql = " select ct_qty, it_name, ct_option, io_id, io_type from {$g5['g5_shop_cart_table']} where od_id = '$tmp_cart_id' and it_id = '$it_id' ";
$sql = " select sum(ct_qty) as ct_qty, it_name, ct_option, io_id, io_type
from {$g5['g5_shop_cart_table']}
where od_id = '$tmp_cart_id'
and it_id = '$it_id' ";
and it_id = '$it_id' GROUP BY od_id, it_id, it_name, ct_option, io_id, io_type ";
$result = sql_query($sql);
for($k=0; $row=sql_fetch_array($result); $k++) {
@@ -73,10 +77,11 @@ if($act == "buy")
and ct_stock_use = 0
and ct_status = '쇼핑'
and ct_select = '1' ";
$sum = sql_fetch($sql);
// $sum['cnt'] 가 null 일때 재고 반영이 제대로 안되는 오류 수정 (그누위즈님,210614)
// $sum_qty = $sum['cnt'];
$sum_qty = is_int($sum['cnt']) ? $sum['cnt'] : 0;
$sum_qty = isset($sum['cnt']) ? (int) $sum['cnt'] : 0;
// 재고 구함
$ct_qty = $row['ct_qty'];
+91 -73
View File
@@ -5,27 +5,12 @@ if($od['od_pg'] != 'inicis') return;
include_once(G5_SHOP_PATH.'/settle_inicis.inc.php');
$oid = $od['od_id'];
$EscrowType = 'I';
$invoice = $escrow_numb;
$dlv_charge = 'SH'; // 배송비 지급형태 (SH : 판매자부담, BH : 구매자부담)
$sendName = iconv_euckr($od['od_name']);
$sendPost = $od['od_zip1'].$od['od_zip2'];
$sendAddr1 = iconv_euckr($od['od_addr1']);
$sendAddr2 = iconv_euckr($od['od_addr2']);
$sendTel = $od['od_tel'];
$recvName = iconv_euckr($od['od_b_name']);
$recvPost = $od['od_b_zip1'].$od['od_b_zip2'];
$recvAddr = iconv_euckr($od['od_b_addr1'].($od['od_b_addr2'] ? ' ' : '').$od['od_b_addr2']);
$recvTel = $od['od_b_tel'];
$price = $od['od_receipt_price'];
// 택배회사 코드
// 택배회사 코드, https://manual.inicis.com/iniweb/code.html 에서 조회
$exCode = array(
'대한통운' => 'korex',
'아주택배' => 'ajutb',
'KT로지스' => 'ktlogistics',
'현대택배' => 'hyundai',
'롯데택배(구.현대)' => 'hyundai',
'CJ대한통운' => 'cjgls',
'한진택배' => 'hanjin',
'트라넷' => 'tranet',
@@ -39,76 +24,109 @@ $exCode = array(
'동부택배' => 'dongbu',
'우체국' => 'EPOST',
'우편등기' => 'registpost',
'경동택배' => 'kdexp',
'천일택배' => 'chunil',
'대신택배' => 'daesin',
'일양로지스' => 'ilyang',
'호남택배' => 'honam',
'편의점택배' => 'cvsnet',
'합동택배' => 'hdexp',
'기타택배' => '9999'
);
$dlv_exName = $escrow_corp;
$dlv_exCode = $exCode[$dlv_exName];
if(!$dlv_exCode)
$dlv_exCode = '9999';
//step1. 요청을 위한 파라미터 설정
// 가맹점관리자 > 상점정보 > 계약정보 > 부가정보 > INIAPI key 생성조회
if (function_exists('get_inicis_iniapi_key')) {
$key = get_inicis_iniapi_key();
} else {
$key = ! $default['de_card_test'] ? $default['de_inicis_iniapi_key'] : "ItEQKi3rY7uvDS8l";
}
/*********************
* 3. 지불 정보 설정 *
*********************/
$inipay->SetField("tid", $escrow_tno); // 거래아이디
$inipay->SetField("mid", $default['de_inicis_mid']); // 상점아이디
/**************************************************************************************************
* admin 은 키패스워드 변수명입니다. 수정하시면 안됩니다. 1111의 부분만 수정해서 사용하시기 바랍니다.
* 키패스워드는 상점관리자 페이지(https://iniweb.inicis.com)의 비밀번호가 아닙니다. 주의해 주시기 바랍니다.
* 키패스워드는 숫자 4자리로만 구성됩니다. 이 값은 키파일 발급시 결정됩니다.
* 키패스워드 값을 확인하시려면 상점측에 발급된 키파일 안의 readme.txt 파일을 참조해 주십시오.
**************************************************************************************************/
$inipay->SetField("admin", $default['de_inicis_admin_key']); // 키패스워드(상점아이디에 따라 변경)
$inipay->SetField("type", "escrow"); // 고정 (절대 수정 불가)
$inipay->SetField("escrowtype", "dlv"); // 고정 (절대 수정 불가)
$inipay->SetField("dlv_ip", getenv("REMOTE_ADDR")); // 고정
$dlv_exName = $escrow_corp;
$type = "Dlv"; //"Dlv" 고정
$mid = $default['de_inicis_mid'];
$clientIp = $_SERVER['SERVER_ADDR']; // 가맹점 요청 서버IP, 상점 임의 설정 가능 (상점측 서버 구분을 위함)
$timestamp = date("YmdHis");
$tid = $escrow_tno; //에스크로 결제 승인TID
$oid = $od['od_id'];
$price = $od['od_receipt_price'];
$report = "I"; //에스크로 등록형태 ["I":등록, "U":변경]
$invoice = $escrow_numb; //운송장번호
$registName = $member['mb_id'];
$exCode = isset($exCode[$dlv_exName]) ? $exCode[$dlv_exName] : ''; //택배사코드 참고(https://manual.inicis.com/code/#gls)
$exName = $dlv_exName;
$charge = "SH"; //배송비 지급형태 ("SH":판매자부담, "BH":구매자부담)
$invoiceDay = G5_TIME_YMDHIS; //배송등록 확인일자 (String 으로 timestamp 사용 가능)
$sendName = $od['od_name'];
$sendTel = $od['od_tel'];
$sendPost = $od['od_zip1'].$od['od_zip2'];
$sendAddr1 = $od['od_addr1'].' '.$od['od_addr2'];
$recvName = $od['od_b_name'];
$recvTel = $od['od_b_tel'];
$recvPost = $od['od_b_zip1'].$od['od_b_zip2'];
$recvAddr = $od['od_b_addr1'].($od['od_b_addr2'] ? ' ' : '').$od['od_b_addr2'];
$inipay->SetField("oid", $oid);
$inipay->SetField("soid", "1");
//$inipay->SetField("dlv_date", $dlv_date);
//$inipay->SetField("dlv_time", $dlv_time);
$inipay->SetField("dlv_report", $EscrowType);
$inipay->SetField("dlv_invoice", $invoice);
$inipay->SetField("dlv_name", $member['mb_id']);
if(!$exCode)
$exCode = '9999';
$inipay->SetField("dlv_excode", $dlv_exCode);
$inipay->SetField("dlv_exname", $dlv_exName);
$inipay->SetField("dlv_charge", $dlv_charge);
// hash => INIAPIKey + type + timestamp + clientIp + mid + oid + tid + price
$plainText = (string)$key.(string)$type.(string)$timestamp.(string)$clientIp.(string)$mid.(string)$oid.(string)$tid.(string)$price;
$inipay->SetField("dlv_invoiceday", G5_TIME_YMDHIS);
$inipay->SetField("dlv_sendname", $sendName);
$inipay->SetField("dlv_sendpost", $sendPost);
$inipay->SetField("dlv_sendaddr1", $sendAddr1);
$inipay->SetField("dlv_sendaddr2", $sendAddr2);
$inipay->SetField("dlv_sendtel", $sendTel);
// hash 암호화
$hashData = hash("sha512", $plainText);
$inipay->SetField("dlv_recvname", $recvName);
$inipay->SetField("dlv_recvpost", $recvPost);
$inipay->SetField("dlv_recvaddr", $recvAddr);
$inipay->SetField("dlv_recvtel", $recvTel);
//step2. key=value 로 post 요청
$inipay->SetField("dlv_goodscode", $goodsCode);
$inipay->SetField("dlv_goods", $goods);
$inipay->SetField("dlv_goodscnt", $goodCnt);
$inipay->SetField("price", $price);
$inipay->SetField("dlv_reserved1", $reserved1);
$inipay->SetField("dlv_reserved2", $reserved2);
$inipay->SetField("dlv_reserved3", $reserved3);
$data = array(
'type' => $type,
'mid' => $mid,
'clientIp' => $clientIp,
'timestamp' => $timestamp,
'tid' => $tid,
'oid' => $oid,
'price' => $price,
'report' => $report,
'invoice' => $invoice,
'registName' => $registName,
'exCode' => $exCode,
'exName' => $exName,
'charge' => $charge,
'invoiceDay' => $invoiceDay,
'sendName' => $sendName,
'sendTel' => $sendTel,
'sendPost' => $sendPost,
'sendAddr1' => $sendAddr1,
'recvName' => $recvName,
'recvTel' => $recvTel,
'recvPost' => $recvPost,
'recvAddr' => $recvAddr,
'hashData'=> $hashData
);
$inipay->SetField("pgn", $pgn);
// Request URL
$url = "https://iniapi.inicis.com/api/v1/escrow";
/*********************
* 3. 배송 등록 요청 *
*********************/
$inipay->startAction();
$ch = curl_init(); // curl 초기화
curl_setopt($ch, CURLOPT_URL, $url); // 전송 URL 지정하기
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // 요청 결과를 문자열로 반환
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); // connection timeout 10초
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data)); // POST data
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); // (※ 로컬 테스트에서만 사용) 원격 서버의 인증서가 유효한지 검사 안함
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded; charset=utf-8')); // 전송헤더 설정
curl_setopt($ch, CURLOPT_POST, 1); // post 전송
$response = curl_exec($ch);
curl_close($ch);
//step3. 요청 결과
$ini_result = json_decode($response, true);
/**********************
* 4. 배송 등록 결과 *
**********************/
$tid = $inipay->GetResult("tid"); // 거래번호
$resultCode = $inipay->GetResult("ResultCode"); // 결과코드 ("00"이면 지불 성공)
$resultMsg = $inipay->GetResult("ResultMsg"); // 결과내용 (지불결과에 대한 설명)
$dlv_date = $inipay->GetResult("DLV_Date");
$dlv_time = $inipay->GetResult("DLV_Time");
$resultCode = $ini_result['resultCode']; // 결과코드 ("00"이면 지불 성공)
$resultMsg = $ini_result['resultMsg']; // 결과내용 (지불결과에 대한 설명)
$dlv_date = $ini_result['resultDate'];
$dlv_time = $ini_result['resultTime'];
+10 -12
View File
@@ -46,18 +46,16 @@ if($cancelFlag == "true")
sql_query($sql, false);
}
$ini_paymethod = get_type_inicis_paymethod($od_settle_case);
$TID = $tno;
$inipay->SetField("type", "cancel"); // 고정
if( $default['de_inicis_admin_key'] ){
$inipay->SetField("mid", $mid);
$inipay->SetField("admin", $default['de_inicis_admin_key']);
}
$inipay->SetField("tid", $TID); // 고정
$inipay->SetField("cancelmsg", "DB FAIL"); // 취소사유
$inipay->startAction();
if($inipay->GetResult('ResultCode') == "00")
{
$inipay->MakeTXErrMsg(MERCHANT_DB_ERR,"Merchant DB FAIL");
if ($ini_paymethod){
$args = array(
'paymethod' => $ini_paymethod,
'tid' => $tno,
'msg' => 'DB FAIL' // 취소사유
);
$response = inicis_tid_cancel($args);
}
}
-2
View File
@@ -1,2 +0,0 @@
Order deny,allow
Deny from all
-1
View File
@@ -1 +0,0 @@
pm/4rSNJdLw=
-16
View File
@@ -1,16 +0,0 @@
-----BEGIN CERTIFICATE-----
MIICmzCCAgQCAQAwDQYJKoZIhvcNAQEEBQAwgZUxCzAJBgNVBAYTAktSMRUwEwYD
VQQIDAzrjIDtlZzrr7zqta0xDTALBgNVBAcTBG51bGwxGjAYBgNVBAoMESjso7wp
7J2064uI7Iuc7IqkMQswCQYDVQQLEwJFQzETMBEGA1UEAxMKSU5JcGF5VGVzdDEi
MCAGCgmSJomT8ixkAQMUEmx5dGFrNzFAaW5pY2lzLmNvbTAeFw0wNDAzMTUxMDAx
MjNaFw0wNTAzMTUxMDAxMjNaMIGVMQswCQYDVQQGEwJLUjEVMBMGA1UECAwM64yA
7ZWc66+86rWtMQ0wCwYDVQQHEwRudWxsMRowGAYDVQQKDBEo7KO8KeydtOuLiOyL
nOyKpDELMAkGA1UECxMCRUMxEzARBgNVBAMTCklOSXBheVRlc3QxIjAgBgoJkiaJ
k/IsZAEDFBJseXRhazcxQGluaWNpcy5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0A
MIGJAoGBAP6a/WaRyDMxHDgKHtahbZTnv+cayR0b052y2sCAGdgMc6CK0GxyvudV
KR7mltKhexur/ikaPKXXApK+SlXUvwNS7pdQ13BTNCeLlEg0WLjGoVi9n96AcjR/
QqlmkFaVAQQe9X95uwAcCoIrkErrpFJNPhppTXfsPH8YpzegogPnAgMBAAEwDQYJ
KoZIhvcNAQEEBQADgYEAvmKuNAD7oPxOfRxj1EyBrKt2YdrhzMTvZXz7IIGCeKf0
tsAKiuxuh20i6zWbD4N+twZvDYG23DFBsLb5Iw3pft5RK9OOVZJ8+ChAaDFHBa4a
RzLDmsdD9NsF7UfYb0KXFUnZMTW5ZKirWUq21MdQiqVNhuLs0zy2hAqABBwhICk=
-----END CERTIFICATE-----
-18
View File
@@ -1,18 +0,0 @@
-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: DES-EDE3-CBC,1E6B60D94624128F
+9VjCYsbhvQIrQVWRmTV1dBc3HpHbjDrnwEu8znuxO9dgN7ZKKahSOo/iZv9tzWr
SpEnbaGiRivO7/jTfJxgcy7wqjV+jYiwpBzL640JdOditUMoIxx3Rzxq+Dheuz13
1dwt6f3d11zzXjIA5eQQXf1dBTjNCrxhAHqtHccWc5eP1QScQA+KdDAT+vQ6qTVq
aZOI+7BkfWt5YMYBienXwEZSK5ZJ0GU91xSwDApIwsq7E7JGBExPIXGJeZ/RDAVN
sKuO5Ny0JBNJN2Lym39Nb9lF0sKAedMiQNfaEnRqG37fh4H1ONo9NTYilENCIrg6
tgYw/G9FrY8UvNLBsdUEUSV3bSqlRXZxP2TcPPrpYVbYZ1CQAH3fhVjAo9dpSNeI
KuGv3x+JAkuJ+SjhANUU+ChOm27tF7scUxDTfwzTGfyB3P1UFHDwf0nWMU5cuJRY
1+DLxEVL9FaZmonf5SZdf14Ln8a0cVdm+5rujFpFecSaw9K6gNFUvu6qF6CLx9/O
UgcL90Ga+EvMG1iWyCFGvbr53r4i776JG+rVergIcgT5winvYpKiOS9AOV5NXPPI
ev5PCXmDbnalmK6IrgrV0bAJD3d+NcN9JGFSx+GYKlw4OTrz/hxxuojPW6em4cfi
mEIl5JIiLoC2BqM+Jcs8UMq0TOS8Pcki4O05H9Juws5nh6+d5d2p2BcvkXc+SWF7
ClfjMZDaniMzPZr1dQj5XFZwptN6jATYL/4u1CpXYKi3N6TwHbOtQD/2l4e+DNPR
JsSAW8ftyLAK0QJUTLhvA9Np9pzmO4hE7LfeRKBKpoU2PwKyXoO+PA==
-----END RSA PRIVATE KEY-----
-10
View File
@@ -1,10 +0,0 @@
키 파일 3개 - mcert.pem, mpriv.pem, keypass.enc - 를
"key/{상점아이디}/" 로 복사하신 후 프로그램 소스의 수정
사항을 반영하십시오(메뉴얼 참조).
상점아이디 : INIpayTest
키패스워드 : 1111
상점 관리 싸이트 패스워드 : 1111
상점 관리 싸이트는 https://iniweb.inicis.com이며,
로그인 아이디는 상점아이디입니다.
View File
-1
View File
@@ -1 +0,0 @@
pm/4rSNJdLw=
-17
View File
@@ -1,17 +0,0 @@
-----BEGIN CERTIFICATE-----
MIICnTCCAgYCAQAwDQYJKoZIhvcNAQEEBQAwgZYxCzAJBgNVBAYTAktSMRUwEwYD
VQQIDAzrjIDtlZzrr7zqta0xDTALBgNVBAcTBG51bGwxGjAYBgNVBAoMESjso7wp
7J2064uI7Iuc7IqkMQswCQYDVQQLEwJFQzETMBEGA1UEAxMKaW5pZXNjcm93MDEj
MCEGCgmSJomT8ixkAQMUE2RkYWVtaXJpQGluaWNpcy5jb20wHhcNMDgwMTE2MDQ0
MTU1WhcNMDkwMTE1MDQ0MTU1WjCBljELMAkGA1UEBhMCS1IxFTATBgNVBAgMDOuM
gO2VnOuvvOq1rTENMAsGA1UEBxMEbnVsbDEaMBgGA1UECgwRKOyjvCnsnbTri4js
i5zsiqQxCzAJBgNVBAsTAkVDMRMwEQYDVQQDEwppbmllc2Nyb3cwMSMwIQYKCZIm
iZPyLGQBAxQTZGRhZW1pcmlAaW5pY2lzLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOB
jQAwgYkCgYEAxElWzHNgDFZpwNvPGbWtA0PKTDPfeP1r7xE/k2n2XMzBFQFxbjSC
EBKbQzFRVbNJv4Jyon/OzlywSR3A1DYMm5Oy9Vh3OOrH2FiYxMXClp7MynnmFEug
ysHuYOHlMnoEfI5k8h9hIXlYbRFDLdY7IxVzqkaYJ37HX01Apuxo8sUCAwEAATAN
BgkqhkiG9w0BAQQFAAOBgQCPrVeBW8+anq3CORMYU5TX1tfrYeCzLFH2hkDJF0Rr
1xWxgjhdFZxtBtYSbxr3UKFe6/EWrlv7k37LoM8ORYcNZun+Rd1jz5xwTOjLBTsd
UGwgUpgBLB1z9GoZgaeJJOm7BFUE0Jp7laI0zWkpWeova2RUT1PODnQMvRNi2d88
vQ==
-----END CERTIFICATE-----
-18
View File
@@ -1,18 +0,0 @@
-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: DES-EDE3-CBC,FBB268FC75417BD4
G4/3WRZg/9peL3ym0S2LsTWvFkSCT/Co+qcCeKBunQ1UPH/pVyQjW0oxtmjBpBfp
YFNJmc5mEhwV30uKXLEYP6bhpHKlLDQWv926+UBIkSZ4cOkm9JNZUETlb+tlSgIN
i5l5KLaX198rGlQAEYX+TxTaxlfXxoBiXkoqxs64Jn0RApy1SPTXKjLffXHP2Yk5
q3jOZ4z4REdnmkH5NYuRHz6cyRr4XdmvPFMwBpzOL08go6yToYfYRvyO4hf2T1Kl
ug1ws6e1HNSm1t3PrZP2kj1oIQef80/DQf9eu1mOP0VQD1GlQSydt2+kAdEBba4d
FIlpO3oGCbCB1UhBOBCllFlXvd4sqj1inZhHS/g9R0vAwAPVpsssXYnWL2qnb+zj
gfSyk+ao56sOBIwhyFXX9IdLcFKMGVQDrxZhDxVieStwk9iVK4zGZW+clS+TzFY7
8qPDP53vXenumSnVq11Mj5gKwJzy40wGm61bQR1B5ldJJW7978Njahh0T0ZCxu48
n5H0FbVu9wrILehWxEI5IrXAAGbRYDlurSSvHtOX1qL0WvJa4EQD9De3u8kqD3Yx
soKJqII277UQBpPuyyE+eP1F+7i4cQdfCU31sK1LMz/wiJxRrG1CiOpV1FH22ABy
vxAh1gpTRgYHvNVWG37P9rYbrW2UcM4cjhbgOzTLhrThxteAgosaXWowc/lcobSB
G444RQXVPZEetqt2In2kBr7UmE2WuvM0CrC6sD336K2t0q/5HLPLntGozdadZ4F5
OS8Oi8I9Ygiqwz95JSUaOfETGZ6RpGRJXL9ysimBeEDuQmQ2lxtkZA==
-----END RSA PRIVATE KEY-----
-19
View File
@@ -1,19 +0,0 @@
please read this README.TXT file
ZIP file contains following 3 files.
- mcert.pem
- mpriv.pem
- keypass.enc
Copy these 3 files to directory [key/iniescrow0].
Merchant ID : iniescrow0
Key Password : 1111
Admin Password: 1111
please visit https://iniweb.inicis.com
for your Merchant Administration.
This site provides your payment transaction details and account details by calculation period.
You can also log on this site using your Merchant ID(iniescrow0).
-1
View File
@@ -1 +0,0 @@
pm/4rSNJdLw=
-17
View File
@@ -1,17 +0,0 @@
-----BEGIN CERTIFICATE-----
MIICtDCCAhwCAQAwDQYJKoZIhvcNAQEEBQAwgaExCzAJBgNVBAYTAktSMRUwEwYD
VQQIDAzrjIDtlZzrr7zqta0xDTALBgNVBAcTBG51bGwxJTAjBgNVBAoMHFNL7Luk
666k64uI7LyA7J207IWY7KaIKOyjvCkxCzAJBgNVBAsTAkVDMRMwEQYDVQQDEwpD
eXdvcmxkMDE0MSMwIQYKCZImiZPyLGQBAxQTc3VuZ21vY2tAaW5pY2lzLmNvbTAe
Fw0wNzExMTIwNjExMzBaFw0wODExMTEwNjExMzBaMIGhMQswCQYDVQQGEwJLUjEV
MBMGA1UECAwM64yA7ZWc66+86rWtMQ0wCwYDVQQHEwRudWxsMSUwIwYDVQQKDBxT
S+y7pOuupOuLiOy8gOydtOyFmOymiCjso7wpMQswCQYDVQQLEwJFQzETMBEGA1UE
AxMKQ3l3b3JsZDAxNDEjMCEGCgmSJomT8ixkAQMUE3N1bmdtb2NrQGluaWNpcy5j
b20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAV0zuTBHq1SZWArRHCNz1jlU
WUyTK3Gv6BGq3J6Tly/o6g51Nbjcu2TYMXLIhMgsqDPeJzOnXbSvnh3FWgAMcFm/
EZEs9oKw+jkiPfIEeSc7KZThqDm1oG4FgJZrXim6Y3jlLLaW1h0WyapCV2u60759
LX8YzmmFmUuXGZOb5s7DAgMBAAEwDQYJKoZIhvcNAQEEBQADgYIAAN4AumokztkK
z5UBScG4Ccvu3nwcuFlCqzDUm9xnZyfy96RIjTJjVelkLwk6NFPqbDEyDLmHm6fe
Zus+fvZBKQAyHigfuS/RVitcup52OkWCZerbcWsziX8Pzqb/MHu19Elt+y/QYe5x
ysyIsZn47Bp+7kbQtlMjJecXGEFfmoi1
-----END CERTIFICATE-----
-18
View File
@@ -1,18 +0,0 @@
-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: DES-EDE3-CBC,6B92FB59B7AB8A00
NSplji6yUKrk1LXAid9TcBIOSkA+oE+5b52s7GaebioGsGSMIW7RrK8VHWlTOpxs
GnFkTNg3ALZucdhYiAdm6vzaGmmJogoPnmpevs2JIDl3rkgcQH0AVU6nkKg9EcuP
QP/2DknfqzNO46fTMjUIRSrJ7AauDz6836Mm3GVNl7cA42ecM7xHSVK3ZvCvpTrJ
A9ik1zWZbzCIKg/mgMJkHu8xO8K9GKQAY1OM0KxK+oqS/Txmi6RplCHlrTAR+Ahb
J3W8vG3tCu6orlczvPYEnB0a1E/dycDPziBFm6nVAk8cb+yPbZnl/Nqfu6nvPsSx
iJYJR9YZ6L5i/IIhBc8tjNWeDB1KLsXZY41B//D/pjr9nfFUcJex8uPpOA0+GnGz
EhDT8j/WMylgAxKKIYjFqE7HnMQ+n+ZZqLKO6JLdu3HHNz0QC7nz/SZtEMw/of4e
1DlFHDTLTg0vJxwuLSBHVQN3H7SiFbxc/U5UmZEEVPprwbS9m0ok9JmBdfCv8iqu
vuJiYc3HCdJaTRu0U3fJM33yr//BrZxXw0RjABePprcQDf590Vws8tygc/L5voF6
lw8JYXuWKuRn4soNKwhrLL9YvQ0FNy1ITS2MpKGNYRPp5l3YCKO19y1dLMwrA33k
SL1laFxrXLDaaE7MJZ8VD9hIymnn0aivtJHelW9DNoWJdI/DgTNKRhgT2TWBqR09
VVCCKF3RLAQMvOFq/49A68px8/xHKxd6pYis/l8BONlZBMYRyIgjZ0IU81pmvHm+
8UphsgRGx1ZvNtP0ApnTMF9DdpPN6vkxmpDWTe93HWJTp3TV1wyZPA==
-----END RSA PRIVATE KEY-----
-21
View File
@@ -1,21 +0,0 @@
-----BEGIN CERTIFICATE-----
MIIDcTCCAtqgAwIBAgIBHjANBgkqhkiG9w0BAQQFADCBiDELMAkGA1UEBhMCS1Ix
DjAMBgNVBAgTBVNlb3VsMRgwFgYDVQQKEw9JbmljaXMgQ28sIEx0ZC4xDzANBgNV
BAsTBklOSXBheTEfMB0GA1UEAxMWSU5JcGF5IFBheW1lbnQgR2F0ZXdheTEdMBsG
CSqGSIb3DQEJARYOZGV2QGluaWNpcy5jb20wHhcNMDcwOTA2MDYxNTI0WhcNMTcw
OTAzMDYxNTI0WjCBiDELMAkGA1UEBhMCS1IxDjAMBgNVBAgTBVNlb3VsMRgwFgYD
VQQKEw9JbmljaXMgQ28sIEx0ZC4xDzANBgNVBAsTBklOSXBheTEfMB0GA1UEAxMW
SU5JcGF5IFBheW1lbnQgR2F0ZXdheTEdMBsGCSqGSIb3DQEJARYOZGV2QGluaWNp
cy5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAOC8v1rxqoo7tonq7t4d
c3FVfIlLyA9ku+l9+d5pUQrbiUXDe8NoJZnoSyud4WhOUrN2ZpzNmjGxuPquYrT/
LkXoR+ib9OAhFBp7izstjHEA+oUNTVO24MRRvOHWWaLrCeTNX9PeaZl9ploojyHc
Uxm5/gIlPEojiaWNc3HVnb55AgMBAAGjgegwgeUwHQYDVR0OBBYEFGgqMfJUMSUQ
pjyGnurepI+NUf6JMIG1BgNVHSMEga0wgaqAFGgqMfJUMSUQpjyGnurepI+NUf6J
oYGOpIGLMIGIMQswCQYDVQQGEwJLUjEOMAwGA1UECBMFU2VvdWwxGDAWBgNVBAoT
D0luaWNpcyBDbywgTHRkLjEPMA0GA1UECxMGSU5JcGF5MR8wHQYDVQQDExZJTklw
YXkgUGF5bWVudCBHYXRld2F5MR0wGwYJKoZIhvcNAQkBFg5kZXZAaW5pY2lzLmNv
bYIBHjAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBAUAA4GBANUj8vYzU2Q9pebQ
yX+6U9e36DeO/+15iDgU2PRK63uPaEa6vMqN2ibI8twolZB2t2oqIRgO44Hf3Nyf
1XKNzCP1eRF1XreGOnrPZtJ5UeUs3RNBqvQkIAdSW80jkXw0i/7i95BYxRIJWSIE
2fLjemy6r8gAQgWRAPv32F0xwRRT
-----END CERTIFICATE-----
-19
View File
@@ -1,19 +0,0 @@
please read this README.TXT file
ZIP file contains following 3 files.
- mcert.pem
- mpriv.pem
- keypass.enc
Copy these 3 files to directory [key/Cyworld014].
Merchant ID : Cyworld014
Key Password : 1111
Admin Password: 1111
please visit https://iniweb.inicis.com
for your Merchant Administration.
This site provides your payment transaction details and account details by calculation period.
You can also log on this site using your Merchant ID(Cyworld014).
Binary file not shown.
File diff suppressed because it is too large Load Diff
-673
View File
@@ -1,673 +0,0 @@
<?php
/**
* Copyright (C) 2007 INICIS Inc.
*
* 해당 라이브러리는 절대 수정되어서는 안됩니다.
* 임의로 수정된 코드에 대한 책임은 전적으로 수정자에게 있음을 알려드립니다.
*
* @version 5.0
* @author ddaemiri
*
* @buildno 5000
* @date 2007.12.27
* @note first release
*
* @buildno 5001
* @date 2008.01.15
* @note 자체에스크로 추가, DNS Lookup Timeout 추가, DNS Lookup 실패시 socket close안하는 부분 추가
* @date 2008.01.16
* @note Encrypt,Decrypt 모듈 개선, pkcs5 padding 추가
* @date 2008.01.24
* @note non block connect immediate return check code/str
* @date 2008.02.11
* @note key load 후 read에러발생시 fclose 추가
* @date 2008.03.03
* @note 참조에 의한 전달(passing by reference) 수정
* @date 2008.03.11
* @note 에스크로 망취소 Cmd 추가
* @date 2008.03.12
* @note 기존 연결된 IP로 망취소 수정
* @buildno 5002
* @note 망취소시 Sign추가(기존에 안했음->5001은 망취소시 서버측에서 서명오류가 남,그래도 망취소처리는 됨)
* @date 2008.03.12
* @buildno 5016
* @note pg1ip, pg2ip 추가/취소 원거래없음시 drpg로 재시도
* @date 2008.04.02
* @buildno 5017
* @note 1)chkfake시 파라미터 로깅 삭제(중복)
* 2)call-time pass-by-reference => pass-by-value로 수정
* @date 2009.01.12
* @buildno 5019
* @note delete UIP
* @date 2009.01.21
* @note add mkey/mergelog ( for Makeshop )
* @date 2009.02.24
* @note 1)define MKEY deprecated 2009.02.19 ( Makeshop 초기 한번나감. 서비스되고 있는지는 모름)
* 2)Makeshop PG Updrade용으로 새로나감 2009.02.19 (interface에서 mkey값을 받아 처리하게 변경)
* 3)Makeshop PG Updrade용으로 새로나감 2009.02.24 (interface에서 mergelog값을 받아 처리하게 변경)
* @date 2009.05.07
* @note add BUILDDATE in TXVersion
* @date 2009.08.05
* @buildno 5030
* @note add vacct refund
* @date 2009.12.16
* @buildno 5030
* @note add recv info
* @date 2010.07.14
* @note add Tax, TaxFree info(TX_TAX, TX_TAXFREE)
* @date 2010.09.09
* @note 취소요청시 PG 설정 변경(도메인->IP, INILib.php)
* @note BUILDDATE update(100414 -> 100909)
* @note 2011.05.23 5030 XML ELEMENT 중 ROOT 를 ROOTINFO로 수정
* @buildno 5032
* @note 2012.07.09 거래조회 추가 (TYPE_INQUIRY)
* @note 2012.07.09 PHP ini 파일 error display setting 추가
* @buildno 5036
* @note 2014.12.09 add gather parameter tid, type
* @note 20151113 주문번호 거래조회 추가
*/
ini_set('error_reporting', E_ALL ^ E_NOTICE);
ini_set('display_errors', 'Off');
/* GLOBAL */
define("PROGRAM", "INIPHP");
define("LANG", "PHP");
define("VERSION", "NV5053");
define("BUILDDATE", "20190404");
if( ! defined('TID_LEN')) define("TID_LEN", 40);
define("MAX_KEY_LEN", 24);
define("MAX_IV_LEN", 8);
/* TIMEOUT */
define("TIMEOUT_CONNECT", 5);
define("TIMEOUT_WRITE", 2);
define("TIMEOUT_READ", 20);
define("G_TIMEOUT_CONNECT", 2);
define("DNS_LOOKUP_TIMEOUT", 5);
/* LOG LEVEL */
define("CRITICAL", 1);
define("ERROR", 2);
define("NOTICE", 3);
define("INFO", 5);
define("DEBUG", 7);
/* SERVER INFO */
define("PG_HOST", "formpg.inicis.com");
define("PG_IP", "203.238.37.3");
define("KSPG_IP", "39.115.212.10");
define("PG_PORT", 34049);
define("G_SERVER", "gthr.inicis.com");
define("G_CGI", "/cgi-bin/g.cgi");
define("G_PORT", 80);
define("OK", "0");
define("IV", "Initiative Tech");
define("IMHK", "SFBQSU5JTkZPUk1BVElPTg==");
define("IMHV", "SU5JQ0lTIENJUEhFUi4uLg==");
define("IMJK", "UkVHSVNUX05PX1JDNEtFWQ==");
define("IMJV", "UkVHSVNUX05PX1JDNElW");
//define for mkey
//deprecated 2009.02.19 ( Makeshop 초기 한번나감. 서비스되고 있는지는 모름)
//Makeshop PG Updrade용으로 새로나감 2009.02.19 (interface에서 mkey값을 받아 처리하게 변경)
//define("MKEY", 1);
//non block connect immediate return check code/str
define("ERRSTR_INPROGRESS", "Operation now in progress");
define("ERRCODE_INPROGRESS_LINUX", 115);
define("ERRCODE_INPROGRESS_FREEBSD", 36);
define("ERRCODE_INPROGRESS_WIN", 10035);
//------------------------------------------------------
// IFD Header
//------------------------------------------------------
define("MSGHEADER_LEN", 150);
define("BODY_LEN", 5);
define("TAIL_LEN", 5);
define("FLGCRYPTO_LEN", 1);
define("FLGSIGN_LEN", 5);
define("MPUBSN_LEN", 20);
define("PIPGPUBSN_LEN", 20);
define("TXPGPUBSN_LEN", 20);
define("CMD_LEN", 4);
define("MID_LEN", 10);
define("TOTPRICE_LEN", 20);
//------------------------------------------------------
// IFD CMD
//------------------------------------------------------
define("CMD_REQ_PAY", "0200");
define("CMD_RES_PAY", "0210");
define("CMD_REQ_CAP", "0300");
define("CMD_RES_CAP", "0310");
define("CMD_REQ_CAN", "0420");
define("CMD_RES_CAN", "0430");
define("CMD_REQ_NETC", "0520");
define("CMD_RES_NETC", "0530");
define("CMD_REQ_PRTC", "0620");
define("CMD_RES_PRTC", "0630");
define("CMD_REQ_ACK", "0800");
define("CMD_RES_ACK", "0810");
//자체에스크로
//added 2008.01.08
define("CMD_REQ_DLV", "3020"); //배송등록
define("CMD_REQ_CNF", "3030"); //구매확인
define("CMD_REQ_DNY", "3040"); //구매거절
define("CMD_REQ_DNY_CNF", "3080"); //거절확인
define("CMD_REQ_DLV_NETC", "3520"); //배송등록망상취소
define("CMD_REQ_CNF_NETC", "3530"); //구매확인망상취소
define("CMD_REQ_DNY_NETC", "3540"); //구매거절망상취소
//가상계좌환불(09.08.05)
define("CMD_REQ_RFD", "0421");
define("CMD_RES_RFD", "0431");
//거래조회(12.04.20)
define("CMS_REQ_INQR", "0900");
define("CMS_RES_INQR", "0910");
//서브몰하위가맹점등록(14.03.06)
define("CMS_REQ_OPEN_SUB", "1040");
define("CMS_RES_OPEN_SUB", "1041");
//------------------------------------------------------
// HEADER FLAGS
//------------------------------------------------------
define("FLAG_TEST", "T");
define("FLAG_REAL", "R");
define("FLAG_CRYPTO_NONE", "N");
define("FLAG_CRYPTO_SEED", "S");
define("FLAG_CRYPTO_RC4", "R");
define("FLAG_CRYPTO_3DES", "D");
define("FLAG_SIGN_SHA", "SHA");
define("FLAG_SIGN_SHA1", "SHA1");
define("FLAG_SIGN_MD5", "MD5");
//------------------------------------------------------
//TYPE(서비스별)
//------------------------------------------------------
define("TYPE_SECUREPAY", "securepay");
define("TYPE_CANCEL", "cancel");
define("TYPE_FORMPAY", "formpay");
define("TYPE_RECEIPT", "receipt");
define("TYPE_REPAY", "repay");
define("TYPE_ESCROW", "escrow"); //자체에스크로!
define("TYPE_CONFIRM", "confirm");
define("TYPE_OCBQUERY", "ocbquery");
define("TYPE_OCBSAVE", "ocbsave");
define("TYPE_OCBPOINT", "OCBPoint");
define("TYPE_AUTH", "auth");
define("TYPE_AUTHBILL", "auth_bill");
define("TYPE_CAPTURE", "capture");
define("TYPE_CMS", "CMS");
define("TYPE_VBANK", "VBank");
define("TYPE_REQREALBILL", "reqrealbill");
define("TYPE_FORMAUTH", "formauth");
define("TYPE_CHKFAKE", "chkfake");
//가상계좌환불(09.08.05)
define("TYPE_REFUND", "refund");
//가상계좌부분환불(12.06.05)
define("TYPE_VACCTREPAY", "vacctrepay");
//거래조회(12.04.20)
define("TYPE_INQUIRY", "inquiry");
//서브몰하위가맹점등록(14.03.06)
define("TYPE_OPENSUB", "opensub");
//------------------------------------------------------
//EscrowType(자체에스크로 타입)
//added 2008.01.08
//------------------------------------------------------
define("TYPE_ESCROW_DLV", "dlv");
define("TYPE_ESCROW_CNF", "confirm"); //구매확인/거절(플러그인)
define("TYPE_ESCROW_DNY", "deny"); //위에서 처리됨,의미없음
define("TYPE_ESCROW_DNY_CNF", "dcnf");
//------------------------------------------------------
//PayMethod(서비스별, TX)
//------------------------------------------------------
define("NM_TX_ISP", "VCard");
define("NM_TX_CARD", "Card");
define("NM_TX_HPP", "HPP");
define("NM_TX_ACCT", "DirectBank");
define("NM_TX_VACT", "VBank");
define("NM_TX_OCB", "OCBPoint");
define("NM_TX_CSHR", "CASH");
define("NM_TX_ARSB", "Ars1588Bill");
define("NM_TX_PHNB", "PhoneBill");
define("NM_TX_CULT", "Culture");
define("NM_TX_GAMG", "DGCL");
define("NM_TX_EDUG", "EDCL");
define("NM_TX_TEEN", "TEEN");
define("NM_TX_ESCR", "Escrow");
//------------------------------------------------------
//PayMethod(서비스별, PG)
//------------------------------------------------------
define("NM_ISP", "ISP");
define("NM_CARD", "CARD");
define("NM_HPP", "HPP");
define("NM_ACCT", "ACCT");
define("NM_VACT", "VACT");
define("NM_OCB", "OCB");
define("NM_CSHR", "CASH");
define("NM_ARSB", "ARSB");
define("NM_PHNB", "PHNB");
define("NM_CULT", "CULT");
define("NM_GAMG", "DGCL");
define("NM_EDUG", "EDCL");
define("NM_TEEN", "TEEN");
define("NM_ESCR", "Escrow");
//------------------------------------------------------
//Charset
//------------------------------------------------------
define("EUCKR", "EUC-KR");
define("UTF8", "UTF-8");
//------------------------------------------------------
//URL Encoding/Decoding Name
//------------------------------------------------------
define("URLENCODE", "urlencode");
define("URLDECODE", "urldecode");
//------------------------------------------------------
//요청전문
//------------------------------------------------------
define("TX_GOOSCNT", "GoodsCnt");
define("TX_MOID", "MOID");
define("TX_CURRENCY", "Currency");
define("TX_SMID", "SMID");
define("TX_GOODSCNTS", "GoodsCnts");
define("TX_GOODSNAME", "GoodsName");
define("TX_GOODSPRICE", "GoodsPrice");
define("TX_BUYERNAME", "BuyerName");
define("TX_BUYEREMAIL", "BuyerEmail");
define("TX_BUYERTEL", "BuyerTel");
define("TX_PARENTEMAIL", "ParentEmail");
define("TX_RECVNAME", "RecvName");
define("TX_RECVTEL", "RecvTel");
define("TX_RECVMSG", "RecvMsg");
define("TX_RECVADDR", "RecvAddr");
define("TX_RECVPOSTNUM", "RecvPostNum");
define("TX_TAXFREE", "TaxFree");
define("TX_TAX", "Tax");
//PaymentInfo
define("TX_PAYMETHOD", "PayMethod");
define("TX_JOINCARD", "JoinCard");
define("TX_JOINEXPIRE", "JoinExpire");
define("TX_MAILORDER", "MailOrder");
define("TX_SESSIONKEY", "SessionKey");
define("TX_ENCRYPTED", "Encrypted");
//ReservedInfo
define("TX_MRESERVED1", "MReserved1");
define("TX_MRESERVED2", "MReserved2");
define("TX_MRESERVED3", "MReserved3");
//ManageInfo
define("TX_LANGUAGE", "Language");
define("TX_URL", "URL");
define("TX_TXVERSION", "TXVersion");
define("TX_TXUSERIP", "TXUserIP");
define("TX_TXUSERID", "TXUserID");
define("TX_TXREGNUM", "TXRegNum");
define("TX_ACK", "Ack");
define("TX_RN", "TXRN");
//CancelInfo
define("TX_CANCELTID", "CancelTID");
define("TX_CANCELMSG", "CancelMsg");
define("TX_CANCELREASON", "CancelReason"); //2012-10-19 취소사유코드 추가
//가상계좌환불(09.08.05)
define("TX_REFUNDACCTNUM", "RefundAcctNum");
define("TX_REFUNDBANKCODE", "RefundBankCode");
define("TX_REFUNDACCTNAME", "RefundAcctName");
define("TX_REFUNDFLGREMIT", "RefundFlgRemit");
//PartCancelInfo
define("TX_PRTC_TID", "PRTC_TID");
define("TX_PRTC_PRICE", "PRTC_Price");
define("TX_PRTC_REMAINS", "PRTC_Remains");
define("TX_PRTC_QUOTA", "PRTC_Quota");
define("TX_PRTC_INTEREST", "PRTC_Interest");
define("TX_PRTC_TAX", "Tax");
define("TX_PRTC_TAXFREE", "TaxFree");
define("TX_PRTC_CURRENCY", "Currency");
//국민은행 I계좌이체 부분취소시 계좌번호/계좌주성명추가 2011-10-06
define("TX_PRTC_NOACCT", "PRTC_NoAcctFNBC");
define("TX_PRTC_NMACCT", "PRTC_NmAcctFNBC");
//가상계좌 부분환불 관련 추가
define("TX_PRTC_REFUNDFLGREMIT", "PRTC_RefundFlgRemit");
define("TX_PRTC_REFUNDBANKCODE", "PRTC_RefundBankCode");
//CaptureInfo
define("TX_CAPTURETID", "CaptureTID");
//현금영수증
define("TX_CSHR_APPLPRICE", "CSHR_ApplPrice");
define("TX_CSHR_SUPPLYPRICE", "CSHR_SupplyPrice");
define("TX_CSHR_TAX", "CSHR_Tax");
define("TX_CSHR_SERVICEPRICE", "CSHR_ServicePrice");
define("TX_CSHR_REGNUM", "CSHR_RegNum");
define("TX_CSHR_TYPE", "CSHR_Type");
define("TX_CSHR_COMPANYNUM", "CSHR_CompanyNum");
define("TX_CSHR_OPENMARKET", "CSHR_OpenMarket");
define("TX_CSHR_SUBCNT", "CSHR_SubCnt");
define("TX_CSHR_SUBCOMPANYNAME1", "CSHR_SubCompanyName1");
define("TX_CSHR_SUBCOMPANYNUM1", "CSHR_SubCompanyNum1");
define("TX_CSHR_SUBREGNUM1", "CSHR_SubRegNum1");
define("TX_CSHR_SUBMID1", "CSHR_SubMID1");
define("TX_CSHR_SUBAPPLPRICE1", "CSHR_SubApplPrice1");
define("TX_CSHR_SUBSERVICEPRICE1", "CSHR_SubServicePrice1");
//거래조회(12.04.20)
define("TX_INQR_TID", "INQR_TID");
define("TX_INQR_OID", "INQR_OID");
//서브몰하위가맹점등록(14.03.06)
define("TX_OPENREG_TID", "OrgTID");
define("TX_OPENREG_MID", "MID");
define("TX_OPENREG_SUBCNT", "SubCnt");
define("TX_OPENREG_SUBGOODS", "SubGoods");
define("TX_OPENREG_SUBCOMPNO", "SubCompNo");
define("TX_OPENREG_SUBCOMPNM", "SubCompNm");
define("TX_OPENREG_SUBPRSUPPLY", "SubPrSupply");
define("TX_OPENREG_SUBPRFREE", "SubPrFree");
define("TX_OPENREG_SUBPRTAX", "SubPrTax");
define("TX_OPENREG_SUBPRSERVICE", "SubPrService");
define("TX_OPENREG_SUBPRICE", "SubPrice");
//------------------------------------------------------
//
//응답전문
//
//------------------------------------------------------
//HEAD
define("NM_MID", "MID");
define("NM_TID", "TID");
define("NM_TOTPRICE", "TotPrice");
//BODY
define("NM_GOODSCNT", "GoodsCnt");
define("NM_MOID", "MOID");
define("NM_CURRENCY", "Currency");
define("NM_SMID", "SMID");
define("NM_GOODSNAME", "GoodsName");
define("NM_GOODSPRICE", "GoodsPrice");
define("NM_PAYMETHOD", "PayMethod");
define("NM_RESULTCODE", "ResultCode");
define("NM_RESULTERRORCODE", "ResultErrorCode");
define("NM_RESULTMSG", "ResultMsg");
define("NM_SESSIONKEY", "SessionKey");
define("NM_ENCRYPTED", "Encrypted");
define("NM_CANCELDATE", "CancelDate");
define("NM_CANCELTIME", "CancelTime");
define("NM_EVENTCODE", "EventCode");
define("NM_ORGCURRENCY", "OrgCurrency");
define("NM_ORGPRICE", "OrgPrice");
define("NM_EXCHANGERATE", "ExchangeRate");
define("NM_RESERVEDINFO", "ReservedInfo");
define("NM_MRESERVED1", "MReserved1");
define("NM_MRESERVED2", "MReserved2");
define("NM_MRESERVED3", "MReserved3");
define("PRTC_TID", "PRTC_TID");
define("PRTC_PRICE", "PRTC_Price");
define("PRTC_REMAINS", "PRTC_Remains");
define("PRTC_QUOTA", "PRTC_Quota");
define("PRTC_INTEREST", "PRTC_Interest");
define("PRTC_TYPE", "PRTC_Type");
define("PRTC_CNT", "PRTC_Cnt");
define("NM_CAPTUREDATE", "CaptureDate");
define("NM_CAPTURETIME", "CaptureTime");
define("NM_PGPUBKEY", "PGcertKey");
//RECV DATA XPATH
//XML XPATH
define("ROOTINFO", "INIpay");
define("GOODSINFO", "GoodsInfo");
define("GOODS", "Goods");
define("BUYERINFO", "BuyerInfo");
define("PAYMENTINFO", "PaymentInfo");
define("PAYMENT", "Payment");
define("MANAGEINFO", "ManageInfo");
define("RESERVEDINFO", "ReservedInfo");
//Cancel(NetCancel)
define("CANCELINFO", "CancelInfo");
//PartCancel Encrypt
define("PARTCANCELINFO", "PartCancelInfo");
//Capture
define("CAPTUREINFO", "CaptureInfo");
//거래조회(12.04.20)
define("INQUIRYINFO", "InquiryInfo");
//서브몰하위가맹점등록(14.03.06)
define("OPENSUBINFO", "OpenSubInfo");
//Escrow
//added 2008.01.09
define("ESCROWINFO", "EscrowInfo");
define("ESCROW_DELIVERY", "Delivery");
define("ESCROW_CONFIRM", "Confirm");
define("ESCROW_DENY", "Deny");
define("ESCROW_DENYCONFIRM", "DenyConfirm");
//------------------------------------------------------
//Auth Encrypt XPATH
//------------------------------------------------------
//CARD COMMON
define("APPLDATE", "ApplDate");
define("APPLTIME", "ApplTime");
define("APPLNUM", "ApplNum");
//CARD
define("CARD_NUM", "CARD_Num");
define("CARD_EXPIRE", "CARD_Expire");
define("CARD_CODE", "CARD_Code");
define("CARD_APPLPRICE", "CARD_ApplPrice");
define("CARD_BANKCODE", "CARD_BankCode");
define("CARD_QUOTA", "CARD_Quota");
define("CARD_INTEREST", "CARD_Interest");
define("CARD_POINT", "CARD_Point");
define("CARD_AUTHTYPE", "CARD_AuthType");
define("CARD_REGNUM", "CARD_RegNum");
define("CARD_APPLDATE", "CARD_ApplDate");
define("CARD_APPLTIME", "CARD_ApplTime");
define("CARD_APPLNUM", "CARD_ApplNum");
define("CARD_RESULTCODE", "CARD_ResultCode");
define("CARD_RESULTMSG", "CARD_ResultMsg");
define("CARD_TERMINALNUM", "CARD_TerminalNum");
define("CARD_MEMBERNUM", "CARD_MemberNum");
define("CARD_PURCHASECODE", "CARD_PurchaseCode");
//ISP
define("ISP_BANKCODE", "ISP_BankCode");
define("ISP_QUOTA", "ISP_Quota");
define("ISP_INTEREST", "ISP_Interest");
define("ISP_APPLPRICE", "ISP_ApplPrice");
define("ISP_CARDCODE", "ISP_CardCode");
define("ISP_CARDNUM", "ISP_CardNum");
define("ISP_POINT", "ISP_Point");
define("ISP_APPLDATE", "ISP_ApplDate");
define("ISP_APPLTIME", "ISP_ApplTime");
define("ISP_APPLNUM", "ISP_ApplNum");
define("ISP_RESULTCODE", "ISP_ResultCode");
define("ISP_RESULTMSG", "ISP_ResultMsg");
define("ISP_TERMINALNUM", "ISP_TerminalNum");
define("ISP_MEMBERNUM", "ISP_MemberNum");
define("ISP_PURCHASECODE", "ISP_PurchaseCode");
//ACCT
define("ACCT_APPLDATE", "ACCT_ApplDate");
define("ACCT_APPLTIME", "ACCT_ApplTime");
define("ACCT_APPLNUM", "ACCT_ApplNum");
//HPP
define("HPP_APPLDATE", "HPP_ApplDate");
define("HPP_APPLTIME", "HPP_ApplTime");
define("HPP_APPLNUM", "HPP_ApplNum");
//VACT
define("VACT_APPLDATE", "VACT_ApplDate");
define("VACT_APPLTIME", "VACT_ApplTime");
//CASH
define("CSHR_APPLDATE", "CSHR_ApplDate");
define("CSHR_APPLTIME", "CSHR_ApplTime");
define("CSHR_APPLNUM", "CSHR_ApplNum");
//ARSB
define("ARSB_APPLDATE", "ARSB_ApplDate");
define("ARSB_APPLTIME", "ARSB_ApplTime");
define("ARSB_APPLNUM", "ARSB_ApplNum");
//PHNB
define("PHNB_APPLDATE", "PHNB_ApplDate");
define("PHNB_APPLTIME", "PHNB_ApplTime");
define("PHNB_APPLNUM", "PHNB_ApplNum");
//CULT
define("CULT_APPLDATE", "CULT_ApplDate");
define("CULT_APPLTIME", "CULT_ApplTime");
define("CULT_APPLNUM", "CULT_ApplNum");
//DGCL
define("GAMG_CNT", "GAMG_Cnt");
define("GAMG_APPLDATE", "GAMG_ApplDate");
define("GAMG_APPLTIME", "GAMG_ApplTime");
define("GAMG_APPLNUM", "GAMG_ApplNum");
function MakePathGAMG($cnt) {
for ($i = 1; $i <= $cnt; $i++) {
define("GAMG_NUM$i", "GAMG_Num$i");
define("GAMG_REMAINS$i", "GAMG_Remains$i");
define("GAMG_ERRMSG$i", "GAMG_ErrMsg$i");
}
}
//EDUG
define("EDUG_APPLDATE", "EDUG_ApplDate");
define("EDUG_APPLTIME", "EDUG_ApplTime");
define("EDUG_APPLNUM", "EDUG_ApplNum");
//TEEN
define("TEEN_APPLDATE", "TEEN_ApplDate");
define("TEEN_APPLTIME", "TEEN_ApplTime");
define("TEEN_APPLNUM", "TEEN_ApplNum");
//----------------------------------
//ERROR CODE
//----------------------------------
//!!신TX에 추가된 에러!!!
define("NULL_DIR_ERR", "TX9001");
define("NULL_TYPE_ERR", "TX9002");
define("NULL_NOINTEREST_ERR", "TX9003");
define("NULL_QUOTABASE_ERR", "TX9004");
define("DNS_LOOKUP_ERR", "TX9005");
define("MERCHANT_DB_ERR", "TX9006");
define("DNS_LOOKUP_TIMEOUT_ERR", "TX9007");
define("PGPUB_UPDATE_ERR", "TX9612");
//암복호화 에러
define("B64DECODE_UPDATE_ERR", "TX9101");
define("B64DECODE_FINAL_ERR", "TX9102");
define("B64DECODE_LENGTH_ERR", "TX9103");
define("GET_KEYPW_EVP_B2K_ERR", "TX9104");
define("GET_KEYPW_FILE_OPEN_ERR", "TX9105");
define("GET_KEYPW_FILE_READ_ERR", "TX9106");
define("GET_KEYPW_DECRYPT_INIT_ERR", "TX9107");
define("GET_KEYPW_DECRYPT_UPDATE_ERR", "TX9108");
define("GET_KEYPW_DECRYPT_FINAL_ERR", "TX9109");
define("ENC_RAND_BYTES_ERR", "TX9110");
define("ENC_INIT_ERR", "TX9111");
define("ENC_UPDATE_ERR", "TX9112");
define("ENC_FINAL_ERR", "TX9113");
define("ENC_RSA_ERR", "TX9114");
define("DEC_RSA_ERR", "TX9115");
define("DEC_CIPHER_ERR", "TX9116");
define("DEC_INIT_ERR", "TX9117");
define("DEC_UPDATE_ERR", "TX9118");
define("DEC_FINAL_ERR", "TX9119");
define("SIGN_FINAL_ERR", "TX9120");
define("SIGN_CHECK_ERR", "TX9121");
define("ENC_NULL_F_ERR", "TX9122");
define("ENC_INIT_RAND_ERR", "TX9123");
define("ENC_PUTENV_ERR", "TX9124");
//필드체크
define("NULL_KEYPW_ERR", "TX9201");
define("NULL_MID_ERR", "TX9202");
define("NULL_PGID_ERR", "TX9203");
define("NULL_TID_ERR", "TX9204");
define("NULL_UIP_ERR", "TX9205");
define("NULL_URL_ERR", "TX9206");
define("NULL_PRICE_ERR", "TX9207");
define("NULL_PRICE1_ERR", "TX9208");
define("NULL_PRICE2_ERR", "TX9209");
define("NULL_CARDNUMBER_ERR", "TX9210");
define("NULL_CARDEXPIRE_ERR", "TX9211");
define("NULL_ENCRYPTED_ERR", "TX9212");
define("NULL_CARDQUOTA_ERR", "TX9213");
define("NULL_QUOTAINTEREST_ERR", "TX9214");
define("NULL_AUTHENTIFICATION_ERR", "TX9215");
define("NULL_AUTHFIELD1_ERR", "TX9216");
define("NULL_AUTHFIELD2_ERR", "TX9217");
define("NULL_BANKCODE_ERR", "TX9218");
define("NULL_BANKACCOUNT_ERR", "TX9219");
define("NULL_REGNUMBER_ERR", "TX9220");
define("NULL_OCBCARDNUM_ERR", "TX9221");
define("NULL_OCBPASSWD_ERR", "TX9222");
define("NULL_PASSWD_ERR", "TX9223");
define("NULL_CURRENCY_ERR", "TX9224");
define("NULL_PAYMETHOD_ERR", "TX9225");
define("NULL_GOODNAME_ERR", "TX9226");
define("NULL_BUYERNAME_ERR", "TX9227");
define("NULL_BUYERTEL_ERR", "TX9228");
define("NULL_BUYEREMAIL_ERR", "TX9229");
define("NULL_SESSIONKEY_ERR", "TX9230");
//pg공개키 로드 오류
define("NULL_PGCERT_FP_ERR", "TX9231");
define("NULL_X509_ERR", "TX9232");
define("NULL_PGCERT_ERR", "TX9233");
define("RESULT_MSG_FORMAT_ERR", "TX9234");
// 가상 계좌 이체 예약
define("NULL_PERNO_ERR", "TX9235"); // 주민번호 빠짐
define("NULL_OID_ERR", "TX9236"); // 주문번호 빠짐
define("NULL_VCDBANK_ERR", "TX9237"); // 은행코드 빠짐
define("NULL_DTINPUT_ERR", "TX9238"); // 입금 예정일 빠짐
define("NULL_NMINPUT_ERR", "TX9239"); // 송금자 성명 빠짐
//실시간 빌링
define("NULL_BILLKEY_ERR", "TX9240"); // 빌키 빠짐
define("NULL_CARDPASS_ERR", "TX9241"); // 카드 비번 빠짐
define("NULL_BILLTYPE_ERR", "TX9242"); // 빌타입 누락
// CMS 계좌이체
define("NULL_PRICE_ORG_ERR", "TX9250"); // CMS 출금총금액 빠짐
define("NULL_CMSDAY_ERR", "TX9251"); // CMS 출금일자 빠짐
define("NULL_CMSDATEFROM_ERR", "TX9252"); // CMS 출금시작월 빠짐
define("NULL_CMSDATETO_ERR", "TX9253"); // CMS 출금종료월 빠짐
// 부분취소
define("NULL_CONFIRM_PRICE_ERR", "TX9260"); // 재승인 요청금액 누락 에러
// 현금영수증 발행
define("NULL_CR_PRICE_ERR", "TX9270"); // 현금결제 금액 빠짐
define("NULL_SUP_PRICE_ERR", "TX9271"); // 공급가액 빠짐
define("NULL_TAX_ERR", "TX9272"); // 부가세 빠짐
define("NULL_SRVC_PRICE_ERR", "TX9273"); // 봉사료 빠짐
define("NULL_REG_NUM_ERR", "TX9274"); // 주민번호(사업자번호)
define("NULL_USEOPT_ERR", "TX9275"); // 현금영수증 용도 구분자 빠짐
define("PRIVKEY_FILE_OPEN_ERR", "TX9301");
define("INVALID_KEYPASS_ERR", "TX9302");
define("MAKE_TID_ERR", "TX9401");
define("ACK_CHECKSUM_ERR", "TX9402");
define("NETCANCEL_SOCK_CREATE_ERR", "TX9403");
define("NETCANCEL_SOCK_SEND_ERR", "TX9404");
define("NETCANCEL_SOCK_RECV_ERR", "TX9405");
define("LOG_OPEN_ERR", "TX9406");
define("LOG_WRITE_ERR", "TX9407");
define("SOCK_MAKE_EP_ERR", "TX9501");
define("SOCK_CONN_ERR", "TX9502");
define("SOCK_SEND1_ERR", "TX9503");
define("SOCK_SEND2_ERR", "TX9504");
define("SOCK_CLOSED_BY_PEER_ERR", "TX9505");
define("SOCK_RECV1_ERR", "TX9506");
define("SOCK_RECV2_ERR", "TX9507");
define("SOCK_RECV_LEN_ERR", "TX9508");
define("SOCK_TIMEO_ERR", "TX9509");
define("SOCK_ETC1_ERR", "TX9510");
define("SOCK_ETC2_ERR", "TX9511");
define("NULL_ESCROWTYPE_ERR", "TX6000");
define("NULL_ESCROWMSG_ERR", "TX6001");
define("NULL_FIELD_REFUNDACCTNUM", "TX9245");
define("NULL_FIELD_REFUNDBANKCODE", "TX9243");
define("NULL_FIELD_REFUNDACCTNAME", "TX9244");
-735
View File
@@ -1,735 +0,0 @@
<?php
/**
* Copyright (C) 2007 INICIS Inc.
*
* 해당 라이브러리는 절대 수정되어서는 안됩니다.
* 임의로 수정된 코드에 대한 책임은 전적으로 수정자에게 있음을 알려드립니다.
*
*/
require_once('INICls.php');
require_once('INISoc.php');
class INIpay50 {
var $m_type; // 거래 유형
var $m_resulterrcode; // 결과메세지 에러코드
var $m_connIP;
var $m_cancelRC = 0;
var $m_Data;
var $m_Log;
var $m_Socket;
var $m_Crypto;
var $m_REQUEST = array();
var $m_REQUEST2 = array();
var $m_RESULT = array();
function INIpay() {
$this->UnsetField();
}
function UnsetField() {
unset($this->m_REQUEST);
unset($this->m_RESULT);
}
/* -------------------------------------------------- */
/* */
/* 결제/취소 요청값 Set or Add */
/* */
/* -------------------------------------------------- */
function SetField($key, $val) { //Default Entity
$this->m_REQUEST[$key] = $val;
}
function SetXPath($xpath, $val) { //User Defined Entity
$this->m_REQUEST2[$xpath] = $val;
}
/* -------------------------------------------------- */
/* */
/* 결제/취소 결과값 fetch */
/* */
/* -------------------------------------------------- */
function GetResult($name) { //Default Entity
$result = isset($this->m_RESULT[$name]) ? $this->m_RESULT[$name] : '';
if ($result == "")
$result = $this->m_Data->GetXMLData($name);
if ($result == "")
$result = $this->m_Data->m_RESULT[$name];
return $result;
}
/* -------------------------------------------------- */
/* */
/* 결제/취소 처리 메인 */
/* */
/* -------------------------------------------------- */
function startAction() {
/* -------------------------------------------------- */
/* Overhead Operation */
/* -------------------------------------------------- */
$this->m_Data = new INIData($this->m_REQUEST, $this->m_REQUEST2);
/* -------------------------------------------------- */
/* Log Start */
/* -------------------------------------------------- */
$this->m_Log = new INILog($this->m_REQUEST);
if (!$this->m_Log->StartLog()) {
$this->MakeTXErrMsg(LOG_OPEN_ERR, "로그파일을 열수가 없습니다.[" . $this->m_REQUEST["inipayhome"] . "]");
return;
}
/* -------------------------------------------------- */
/* Logging Request Parameter */
/* -------------------------------------------------- */
$this->m_Log->WriteLog(DEBUG, $this->m_REQUEST);
/* -------------------------------------------------- */
/* Set Type */
/* -------------------------------------------------- */
$this->m_type = $this->m_REQUEST["type"];
/* -------------------------------------------------- */
/* Check Field */
/* -------------------------------------------------- */
if (!$this->m_Data->CheckField()) {
$err_msg = "필수항목(" . $this->m_Data->m_ErrMsg . ")이 누락되었습니다.";
$this->MakeTXErrMsg($this->m_Data->m_ErrCode, $err_msg);
$this->m_Log->WriteLog(ERROR, $err_msg);
$this->m_Log->CloseLog($this->GetResult(NM_RESULTMSG));
return;
}
$this->m_Log->WriteLog(INFO, "Check Field OK");
/* -------------------------------------------------- */
//웹페이지위변조용 키생성. 여기서 끝!!
/* -------------------------------------------------- */
if ($this->m_type == TYPE_CHKFAKE) {
return $this->MakeChkFake();
}
//TID 인입 기반 거래의 경우 TID 를 기록함
$temp_request = array_change_key_case($this->m_REQUEST, CASE_LOWER);
if(isset($temp_request['tid'])){
$this->m_Log->WriteLog(INFO, "INPUT TID > ".$temp_request['tid']);
}
/* -------------------------------------------------- */
//Generate TID
/* -------------------------------------------------- */
if ($this->m_type == TYPE_SECUREPAY || $this->m_type == TYPE_FORMPAY || $this->m_type == TYPE_OCBSAVE ||
$this->m_type == TYPE_AUTHBILL || $this->m_type == TYPE_FORMAUTH || $this->m_type == TYPE_REQREALBILL ||
$this->m_type == TYPE_REPAY || $this->m_type == TYPE_VACCTREPAY || $this->m_type == TYPE_RECEIPT || $this->m_type == TYPE_AUTH
) {
if (!$this->m_Data->MakeTID()) {
$err_msg = "TID생성에 실패했습니다.::" . $this->m_Data->m_sTID;
$this->m_Log->WriteLog(ERROR, $err_msg);
$this->MakeTXErrMsg(MAKE_TID_ERR, $err_msg);
$this->m_Log->CloseLog($this->GetResult(NM_RESULTMSG));
return;
}
$this->m_Log->WriteLog(INFO, 'Make TID OK ' . $this->m_Data->m_sTID);
}
$this->m_Crypto = new INICrypto($this->m_REQUEST);
/* -------------------------------------------------- */
//PI공개키 로드
/* -------------------------------------------------- */
$this->m_Data->ParsePIEncrypted();
$this->m_Log->WriteLog(INFO, "PI PUB KEY LOAD OK [" . $this->m_Data->m_PIPGPubSN . "]");
/* -------------------------------------------------- */
//PG공개키 로드
/* -------------------------------------------------- */
if (($rtv = $this->m_Crypto->LoadPGPubKey($pg_cert_SN)) != OK) {
$err_msg = "PG공개키 로드오류";
$this->m_Log->WriteLog(ERROR, $err_msg);
$this->MakeTXErrMsg($rtv, $err_msg);
$this->m_Log->CloseLog($this->GetResult(NM_RESULTMSG));
return;
}
$this->m_Data->m_TXPGPubSN = $pg_cert_SN;
$this->m_Log->WriteLog(INFO, "PG PUB KEY LOAD OK [" . $this->m_Data->m_TXPGPubSN . "]");
/* -------------------------------------------------- */
//상점개인키 로드
/* -------------------------------------------------- */
if (($rtv = $this->m_Crypto->LoadMPrivKey()) != OK) {
$err_msg = "상점개인키 로드오류";
$this->m_Log->WriteLog(ERROR, $err_msg);
$this->MakeTXErrMsg($rtv, $err_msg);
$this->m_Log->CloseLog($this->GetResult(NM_RESULTMSG));
$this->m_Crypto->FreePubKey();
return;
}
$this->m_Log->WriteLog(INFO, "MERCHANT PRIV KEY LOAD OK");
/* -------------------------------------------------- */
//상점 공개키 로드(SN 를 알기위해!!)
/* -------------------------------------------------- */
if (($rtv = $this->m_Crypto->LoadMPubKey($m_cert_SN)) != OK) {
$err_msg = "상점공개키 로드오류";
$this->m_Log->WriteLog(ERROR, $err_msg);
$this->MakeTXErrMsg($rtv, $err_msg);
$this->m_Log->CloseLog($this->GetResult(NM_RESULTMSG));
return;
}
$this->m_Data->m_MPubSN = $m_cert_SN;
$this->m_Log->WriteLog(INFO, "MERCHANT PUB KEY LOAD OK [" . $this->m_Data->m_MPubSN . "]");
/* -------------------------------------------------- */
//폼페이 암호화( formpay, cancel, repay, recept, inquiry, opensub)
/* -------------------------------------------------- */
if ($this->m_type == TYPE_CANCEL || $this->m_type == TYPE_REPAY || $this->m_type == TYPE_VACCTREPAY ||
$this->m_type == TYPE_FORMPAY || $this->m_type == TYPE_RECEIPT ||
$this->m_type == TYPE_CAPTURE || $this->m_type == TYPE_INQUIRY || $this->m_type == TYPE_OPENSUB ||
($this->m_type == TYPE_ESCROW && $this->m_Data->m_EscrowType == TYPE_ESCROW_DLV ) ||
($this->m_type == TYPE_ESCROW && $this->m_Data->m_EscrowType == TYPE_ESCROW_DNY_CNF ) ||
$this->m_type == TYPE_REFUND
) {
if (($rtv = $this->m_Data->MakeEncrypt($this->m_Crypto)) != OK) {
$err_msg = "암호화 오류";
$this->m_Log->WriteLog(ERROR, $err_msg);
$this->MakeTXErrMsg($rtv, $err_msg);
$this->m_Log->CloseLog($this->GetResult(NM_RESULTMSG));
return;
}
//$this->m_Log->WriteLog( DEBUG, "MAKE ENCRYPT OK" );
$this->m_Log->WriteLog(DEBUG, "MAKE ENCRYPT OK[" . $this->m_Data->m_EncBody . "]");
}
/* -------------------------------------------------- */
//전문생성(Body)
/* -------------------------------------------------- */
$this->m_Data->MakeBody();
$this->m_Log->WriteLog(INFO, "MAKE BODY OK");
//$this->m_Log->WriteLog( INFO, "MAKE BODY OK[".$this->m_Data->m_sBody."]" );
/* -------------------------------------------------- */
//서명(sign)
/* -------------------------------------------------- */
if (($rtv = $this->m_Crypto->Sign($this->m_Data->m_sBody, $sign)) != OK) {
$err_msg = "싸인실패";
$this->m_Log->WriteLog(ERROR, $err_msg);
$this->MakeTXErrMsg($rtv, $err_msg);
$this->m_Log->CloseLog($this->GetResult(NM_RESULTMSG));
$this->m_Crypto->FreeAllKey();
return;
}
$this->m_Data->m_sTail = $sign;
$this->m_Log->WriteLog(INFO, "SIGN OK");
//$this->m_Log->WriteLog( INFO, "SIGN OK[".$sign."]" );
/* -------------------------------------------------- */
//전문생성(Head)
/* -------------------------------------------------- */
$this->m_Data->MakeHead();
$this->m_Log->WriteLog(INFO, "MAKE HEAD OK");
//$this->m_Log->WriteLog( INFO, "MAKE HEAD OK[".$head."]" );
$this->m_Log->WriteLog(DEBUG, "MSG_TO_PG:[" . $this->m_Data->m_sMsg . "]");
/* -------------------------------------------------- */
//소켓생성
/* -------------------------------------------------- */
//플러그인 에스크로 결제 구분 설정
$is_plugin_escrow = FALSE;
if($this->m_type == TYPE_ESCROW && ($this->m_Data->m_EscrowType == TYPE_ESCROW_CNF || $this->m_Data->m_EscrowType == TYPE_ESCROW_DNY)) $is_plugin_escrow = TRUE;
if(isset($this->m_REQUEST["pgn"]) && $this->m_REQUEST["pgn"] != "") {
$host = $this->m_REQUEST["pgn"];
} else {
if ($this->m_type == TYPE_SECUREPAY || $is_plugin_escrow == TRUE) { //plugin
$host = $this->m_Data->m_PG1;
} else if ($this->m_cancelRC == 1){ //원거래없음
$host = KSPG_IP;
} else {
$host = PG_HOST;
}
}
$this->m_Socket = new INISocket($host);
//1차 NSLOOKUP FAIL
if (($rtv = $this->m_Socket->DNSLookup()) != OK) {
$err_msg = "[" . $host . "] 1차 DNS LOOKUP 실패" . $this->m_Socket->getErr();
$this->m_Log->WriteLog(ERROR, $err_msg);
$this->MakeTXErrMsg($rtv, $err_msg);
if ($this->m_type == TYPE_SECUREPAY || $is_plugin_escrow == TRUE) {
$this->m_Socket->ip = $this->m_Data->m_PG1IP;
} else {
if ($this->m_cancelRC == 1) $this->m_Socket->ip = KSPG_IP;
else $this->m_Socket->ip = PG_IP;
}
}
$this->m_Log->WriteLog(INFO, "DNS LOOKUP OK(" . $this->m_Socket->host . ", " . $this->m_Socket->ip . ":" . $this->m_Socket->port . ") laptime:" . $this->m_Socket->dns_laptime);
if (($rtv = $this->m_Socket->open()) != OK) {
$this->m_Socket->close();
//PG2로 전환
$err_msg = "[" . $host."(". $this->m_Socket->ip .") 소켓연결오류(1차):: 2차 연결시도";
$this->m_Log->WriteLog(ERROR, $err_msg);
$this->MakeTXErrMsg($rtv, $err_msg);
if ($this->m_type == TYPE_SECUREPAY || $is_plugin_escrow == TRUE) {
$host = $this->m_Data->m_PG2;
} else {
$host = $this->m_Socket->ip == PG_IP ? KSPG_IP:PG_IP;
}
$this->m_Socket = new INISocket($host);
//SECUREPAY만 2차 NSLOOKUP 진행, 이외는 IP통신
if ($this->m_type == TYPE_SECUREPAY || $is_plugin_escrow == TRUE) {
if (($rtv = $this->m_Socket->DNSLookup()) != OK) {
$err_msg = "[" . $host . "] 2차 DNS LOOKUP 실패" . $this->m_Socket->getErr();
$this->m_Log->WriteLog(ERROR, $err_msg);
$this->MakeTXErrMsg($rtv, $err_msg);
$this->m_Socket->ip = $this->m_Data->m_PG2IP;
}
} else {
$this->m_Socket->ip = $host;
}
$this->m_Log->WriteLog(INFO, "DNS LOOKUP OK(" . $this->m_Socket->host . ", " . $this->m_Socket->ip . ":" . $this->m_Socket->port . ") laptime:" . $this->m_Socket->dns_laptime);
if (($rtv = $this->m_Socket->open()) != OK) {
$err_msg = "[" . $host . "소켓연결오류(2차)::" . $this->m_Socket->getErr();
$this->m_Log->WriteLog(ERROR, $err_msg);
$this->MakeTXErrMsg($rtv, $err_msg);
$this->m_Log->CloseLog($this->GetResult(NM_RESULTMSG));
$this->m_Socket->close();
$this->m_Crypto->FreeAllKey();
return;
}
}
$this->m_connIP = $this->m_Socket->ip;
$this->m_Log->WriteLog(INFO, "SOCKET CONNECT OK");
/* -------------------------------------------------- */
//전문송신
/* -------------------------------------------------- */
if (($rtv = $this->m_Socket->send($this->m_Data->m_sMsg)) != OK) {
$err_msg = "소켓송신오류(MAIN)::" . $this->m_Socket->getErr();
$this->m_Log->WriteLog(ERROR, $err_msg);
$this->MakeTXErrMsg($rtv, $err_msg);
$this->m_Log->CloseLog($this->GetResult(NM_RESULTMSG));
$this->m_Crypto->FreeAllKey();
$this->m_Socket->close();
return;
}
$this->m_Log->WriteLog(INFO, "SEND OK");
/* -------------------------------------------------- */
//전문수신
/* -------------------------------------------------- */
if (($rtv = $this->m_Socket->recv($head, $body, $tail)) != OK) {
$err_msg = "소켓수신오류(MAIN)::" . $this->m_Socket->getErr();
$this->m_Log->WriteLog(ERROR, $err_msg);
$this->MakeTXErrMsg($rtv, $err_msg);
$this->m_Socket->close();
$this->NetCancel();
$this->m_Log->CloseLog($this->GetResult(NM_RESULTMSG));
$this->m_Crypto->FreeAllKey();
return;
}
$this->m_Log->WriteLog(INFO, "RECV OK");
$this->m_Log->WriteLog(INFO, "MSG_FROM_PG:[" . $head . $body . $tail . "]");
$this->m_Data->m_Body = $body;
/* -------------------------------------------------- */
//서명확인
/* -------------------------------------------------- */
if (($rtv = $this->m_Crypto->Verify($body, $tail)) != OK) {
$err_msg = "VERIFY FAIL";
$this->m_Log->WriteLog(ERROR, $err_msg);
$this->MakeTXErrMsg($rtv, $err_msg);
$this->m_Socket->close();
$this->NetCancel();
$this->m_Log->CloseLog($this->GetResult(NM_RESULTMSG));
$this->m_Crypto->FreeAllKey();
return;
}
$this->m_Log->WriteLog(INFO, "VERIFY OK");
/* -------------------------------------------------- */
//Head 파싱
/* -------------------------------------------------- */
if (($rtv = $this->m_Data->ParseHead($head)) != OK) {
$err_msg = "수신전문(HEAD) 파싱 오류";
$this->m_Log->WriteLog(ERROR, $err_msg);
$this->MakeTXErrMsg($rtv, $err_msg);
$this->m_Socket->close();
$this->NetCancel();
$this->m_Log->CloseLog($this->GetResult(NM_RESULTMSG));
$this->m_Crypto->FreeAllKey();
return;
}
$this->m_Log->WriteLog(INFO, "PARSE HEAD OK");
/* -------------------------------------------------- */
//Body 파싱
/* -------------------------------------------------- */
if (($rtv = $this->m_Data->ParseBody($body, $encrypted, $sessionkey)) != OK) {
$err_msg = "수신전문(Body) 파싱 오류";
$this->m_Log->WriteLog(ERROR, $err_msg);
$this->MakeTXErrMsg($rtv, $err_msg);
$this->m_Socket->close();
$this->NetCancel();
$this->m_Log->CloseLog($this->GetResult(NM_RESULTMSG));
$this->m_Crypto->FreeAllKey();
return;
}
$this->m_Log->WriteLog(INFO, "PARSE BODY OK");
/* -------------------------------------------------- */
//복호화
/* -------------------------------------------------- */
if ($this->m_type == TYPE_SECUREPAY || $this->m_type == TYPE_FORMPAY || $this->m_type == TYPE_OCBSAVE ||
$this->m_type == TYPE_CANCEL || $this->m_type == TYPE_AUTHBILL || $this->m_type == TYPE_FORMAUTH ||
$this->m_type == TYPE_REQREALBILL || $this->m_type == TYPE_REPAY || $this->m_type == TYPE_VACCTREPAY || $this->m_type == TYPE_RECEIPT ||
$this->m_type == TYPE_AUTH || $this->m_type == TYPE_CAPTURE || $this->m_type == TYPE_ESCROW ||
$this->m_type == TYPE_REFUND || $this->m_type == TYPE_INQUIRY || $this->m_type == TYPE_OPENSUB
) {
if (($rtv = $this->m_Crypto->Decrypt($sessionkey, $encrypted, $decrypted)) != OK) {
$err_msg = "복호화 실패[" . $this->GetResult(NM_RESULTMSG) . "]";
$this->m_Log->WriteLog(ERROR, $err_msg);
$this->MakeTXErrMsg($rtv, $err_msg);
$this->m_Socket->close();
$this->NetCancel();
$this->m_Log->CloseLog($this->GetResult(NM_RESULTMSG));
$this->m_Crypto->FreeAllKey();
return;
}
$this->m_Log->WriteLog(INFO, "DECRYPT OK");
$this->m_Log->WriteLog(DEBUG, "DECRYPT MSG:[" . $decrypted . "]");
//Parse Decrypt
$this->m_Data->ParseDecrypt($decrypted);
$this->m_Log->WriteLog(INFO, "DECRYPT PARSE OK");
}
/* -------------------------------------------------- */
//Assign Interface Variables
/* -------------------------------------------------- */
$this->m_RESULT = $this->m_Data->m_RESULT;
/* -------------------------------------------------- */
//ACK
/* -------------------------------------------------- */
//if( $this->GetResult(NM_RESULTCODE) == "00" &&
if ((strcmp($this->GetResult(NM_RESULTCODE), "00") == 0) &&
( $this->m_type == TYPE_SECUREPAY || $this->m_type == TYPE_OCBSAVE ||
$this->m_type == TYPE_FORMPAY || $this->m_type == TYPE_RECEIPT
)
) {
$this->m_Log->WriteLog(INFO, "WAIT ACK INVOKING");
if (($rtv = $this->Ack()) != OK) {
//ERROR
$err_msg = "ACK 실패";
$this->m_Log->WriteLog(ERROR, $err_msg);
$this->MakeTXErrMsg($rtv, $err_msg);
$this->m_Socket->close();
$this->NetCancel();
$this->m_Log->CloseLog($this->GetResult(NM_RESULTMSG));
$this->m_Crypto->FreeAllKey();
return;
}
$this->m_Log->WriteLog(INFO, "SUCCESS ACK INVOKING");
}
/* -------------------------------------------------- */
//PG 공개키가 바뀌었으면 공개키 UPDATE
/* -------------------------------------------------- */
$pgpubkey = $this->m_Data->GetXMLData(NM_PGPUBKEY);
if ($pgpubkey != "") {
if (($rtv = $this->m_Crypto->UpdatePGPubKey($pgpubkey)) != OK) {
$err_msg = "PG공개키 업데이트 실패";
$this->m_Log->WriteLog(ERROR, $err_msg);
$this->m_Data->GTHR($rtv, $err_msg);
} else
$this->m_Log->WriteLog(INFO, "PGPubKey UPDATED!!");
}
$this->m_Log->CloseLog($this->GetResult(NM_RESULTMSG));
$this->m_Crypto->FreeAllKey();
$this->m_Socket->close();
return;
}
// End of StartAction
/* -------------------------------------------------- */
/* */
/* 웹페이지 위변조 방지용 데이타 생성 */
/* */
/* -------------------------------------------------- */
function MakeChkFake() {
$this->m_Crypto = new INICrypto($this->m_REQUEST);
/* -------------------------------------------------- */
//상점개인키 로드
/* -------------------------------------------------- */
if (($rtv = $this->m_Crypto->LoadMPrivKey()) != OK) {
$err_msg = "상점개인키 로드오류";
$this->m_Log->WriteLog(ERROR, $err_msg);
$this->MakeTXErrMsg($rtv, $err_msg);
$this->m_Log->CloseLog($this->GetResult(NM_RESULTMSG));
$this->m_Crypto->FreePubKey();
return;
}
$this->m_Log->WriteLog(INFO, "MERCHANT PRIV KEY LOAD OK");
/* -------------------------------------------------- */
//상점 공개키 로드(SN 를 알기위해!!)
/* -------------------------------------------------- */
if (($rtv = $this->m_Crypto->LoadMPubKey($m_cert_SN)) != OK) {
$err_msg = "상점공개키 로드오류";
$this->m_Log->WriteLog(ERROR, $err_msg);
$this->MakeTXErrMsg($rtv, $err_msg);
$this->m_Log->CloseLog($this->GetResult(NM_RESULTMSG));
return;
}
$this->m_Log->WriteLog(INFO, "MERCHANT PUB KEY LOAD OK [" . $this->m_Data->m_MPubSN . "]");
foreach ($this->m_REQUEST as $key => $val) {
if ($key == "inipayhome" || $key == "type" || $key == "debug" ||
$key == "admin" || $key == "checkopt" || $key == "enctype")
continue;
if ($key == "mid")
$temp1 .= $key . "=" . $val . "&"; //msg
else
$temp2 .= $key . "=" . $val . "&"; //hashmsg
}
//Make RN
$this->m_RESULT["rn"] = $this->m_Data->MakeRN();
$temp1 .= "rn=" . $this->m_RESULT["rn"] . "&";
$checkMsg = $temp1;
$checkHashMsg = $temp2;
$retHashStr = Base64Encode(sha1($checkHashMsg, TRUE));
$checkMsg .= "data=" . $retHashStr;
$HashMid = Base64Encode(sha1($this->m_REQUEST["mid"], TRUE));
$this->m_Crypto->RSAMPrivEncrypt($checkMsg, $RSATemp);
$this->m_RESULT["encfield"] = "enc=" . $RSATemp . "&src=" . Base64Encode($checkHashMsg);
$this->m_RESULT["certid"] = $HashMid . $m_cert_SN;
$this->m_Log->WriteLog(INFO, "CHKFAKE KEY MAKE OK:" . $this->m_RESULT["rn"]);
$this->m_Log->CloseLog($this->GetResult(NM_RESULTMSG));
$this->m_Crypto->FreeAllKey();
$this->m_RESULT[NM_RESULTCODE] = "00";
return;
}
/* -------------------------------------------------- */
/* */
/* 결제처리 확인 메세지 전송 */
/* */
/* -------------------------------------------------- */
function Ack() {
//ACK용 Data
$this->m_Data->m_sBody = "";
$this->m_Data->m_sTail = "";
$this->m_Data->m_sCmd = CMD_REQ_ACK;
//전문생성(Head)
$this->m_Data->MakeHead();
$this->m_Log->WriteLog(DEBUG, "MAKE HEAD OK");
//$this->m_Log->WriteLog( DEBUG, "MSG_TO_PG:[".$this->m_Data->m_sMsg."]" );
//Send
if (($rtv = $this->m_Socket->send($this->m_Data->m_sMsg)) != OK) {
$err_msg = "ACK 전송오류";
$this->m_Log->WriteLog(ERROR, $err_msg);
return ACK_CHECKSUM_ERR;
}
//$this->m_Log->WriteLog( DEBUG, "SEND OK" );
if (($rtv = $this->m_Socket->recv($head, $body, $tail)) != OK) {
$err_msg = "ACK 수신오류(ACK)";
$this->m_Log->WriteLog(ERROR, $err_msg);
return ACK_CHECKSUM_ERR;
}
//$this->m_Log->WriteLog( DEBUG, "RECV OK" );
//$this->m_Log->WriteLog( INFO, "MSG_FROM_PG:[".$recv."]" );
return OK;
}
/* -------------------------------------------------- */
/* */
/* 망취소 메세지 전송 */
/* */
/* -------------------------------------------------- */
function NetCancel() {
$this->m_Log->WriteLog(INFO, "WAIT NETCANCEL INVOKING");
if ($this->m_type == TYPE_CANCEL || $this->m_type == TYPE_REPAY || $this->m_type == TYPE_VACCTREPAY || $this->m_type == TYPE_RECEIPT ||
$this->m_type == TYPE_CONFIRM || $this->m_type == TYPE_OCBQUERY || $this->m_type == TYPE_ESCROW ||
$this->m_type == TYPE_CAPTURE || $this->m_type == TYPE_AUTH || $this->m_type == TYPE_AUTHBILL ||
($this->m_type == TYPE_ESCROW && $this->m_Data->m_EscrowType == TYPE_ESCROW_DNY_CNF ) ||
$this->m_type == TYPE_NETCANCEL
) {
$this->m_Log->WriteLog(INFO, "DON'T NEED NETCANCEL");
return true;
}
//NetCancel용 Data
$this->m_Data->m_REQUEST["cancelmsg"] = "망취소";
$body = "";
$sign = "";
$this->m_Data->m_Type = TYPE_CANCEL; //망취소 전문은 취소전문과 같음.헤더만틀리고..쩝~
//added escrow netcancel, 08.03.11
if ($this->m_type == TYPE_ESCROW && $this->m_Data->m_EscrowType == TYPE_ESCROW_DLV)
$this->m_Data->m_sCmd = CMD_REQ_DLV_NETC;
else if ($this->m_type == TYPE_ESCROW && $this->m_Data->m_EscrowType == TYPE_ESCROW_CNF)
$this->m_Data->m_sCmd = CMD_REQ_CNF_NETC;
else if ($this->m_type == TYPE_ESCROW && $this->m_Data->m_EscrowType == TYPE_ESCROW_DNY)
$this->m_Data->m_sCmd = CMD_REQ_DNY_NETC;
else
$this->m_Data->m_sCmd = CMD_REQ_NETC;
$this->m_Data->m_sCrypto = FLAG_CRYPTO_3DES;
//암호화
if (($rtv = $this->m_Data->MakeEncrypt($this->m_Crypto)) != OK) {
$err_msg = "암호화 오류";
$this->m_Log->WriteLog(ERROR, $err_msg);
//$this->MakeTXErrMsg( $rtv, $err_msg );
return;
}
$this->m_Log->WriteLog(DEBUG, "MAKE ENCRYPT OK[" . $this->m_Data->m_EncBody . "]");
//전문생성(Body)
$this->m_Data->MakeBody();
$this->m_Log->WriteLog(INFO, "MAKE BODY OK");
//서명(sign)
if (($rtv = $this->m_Crypto->Sign($this->m_Data->m_sBody, $sign)) != OK) {
$err_msg = "싸인실패";
$this->m_Log->WriteLog(ERROR, $err_msg);
//$this->MakeTXErrMsg( $rtv, $err_msg );
return false;
}
$this->m_Data->m_sTail = $sign;
$this->m_Log->WriteLog(INFO, "SIGN OK");
//전문생성(Head)
$this->m_Data->MakeHead();
$this->m_Log->WriteLog(INFO, "MAKE HEAD OK");
$this->m_Log->WriteLog(DEBUG, "MSG_TO_PG:[" . $this->m_Data->m_sMsg . "]");
//소켓생성
$this->m_Socket = new INISocket("");
$this->m_Socket->ip = $this->m_connIP; //기존연결된 IP 사용, 08.03.12
if (($rtv = $this->m_Socket->open()) != OK) {
$err_msg = "[" . $this->m_Socket->ip . "]소켓연결오류(NETC)::" . $this->m_Socket->getErr();
$this->m_Log->WriteLog(ERROR, $err_msg);
//$this->MakeTXErrMsg( $rtv, $err_msg );
$this->m_Log->CloseLog($this->GetResult(NM_RESULTMSG));
$this->m_Socket->close();
$this->m_Crypto->FreeAllKey();
return;
}
$this->m_Log->WriteLog(INFO, "SOCKET CONNECT OK::" . $this->m_Socket->ip);
//전문송신
if (($rtv = $this->m_Socket->send($this->m_Data->m_sMsg)) != OK) {
$err_msg = "소켓송신오류(NETC)" . $this->m_Socket->getErr();
$this->m_Log->WriteLog(ERROR, $err_msg);
//$this->MakeTXErrMsg( $rtv, $err_msg );
$this->m_Socket->close();
return false;
}
$this->m_Log->WriteLog(INFO, "SEND OK");
//전문수신
if (($rtv = $this->m_Socket->recv($head, $body, $tail)) != OK) {
$err_msg = "소켓수신오류(NETC)";
$this->m_Log->WriteLog(ERROR, $err_msg);
//$this->MakeTXErrMsg( $rtv, $err_msg );
$this->m_Socket->close();
return false;
}
$this->m_Log->WriteLog(INFO, "RECV OK");
$this->m_Log->WriteLog(DEBUG, "MSG_FROM_PG:[" . $head . $body . $tail . "]");
//서명확인
if (($rtv = $this->m_Crypto->Verify($body, $tail)) != OK) {
$err_msg = "VERIFY FAIL";
$this->m_Log->WriteLog(ERROR, $err_msg);
//$this->MakeTXErrMsg( $rtv, $err_msg );
$this->m_Socket->close();
return false;
}
$this->m_Log->WriteLog(INFO, "VERIFY OK");
//이하 헤더나 본문은 파싱하지 않는다!!!!
//그냥 여기서 끝내자 피곤하다.-_-;;
//Head 파싱
if (($rtv = $this->m_Data->ParseHead($head)) != OK) {
$err_msg = "수신전문(HEAD) 파싱 오류";
$this->m_Log->WriteLog(ERROR, $err_msg);
//$this->MakeTXErrMsg( $rtv, $err_msg );
$this->m_Socket->close();
return;
}
//Body 파싱
if (($rtv = $this->m_Data->ParseBody($body, $encrypted, $sessionkey)) != OK) {
$err_msg = "수신전문(Body) 파싱 오류";
$this->m_Log->WriteLog(ERROR, $err_msg);
//$this->MakeTXErrMsg( $rtv, $err_msg );
$this->m_Socket->close();
return;
}
//if( $this->GetResult(NM_RESULTCODE) == "00" )
if (strcmp($this->GetResult(NM_RESULTCODE), "00") == 0)
$this->m_Log->WriteLog(INFO, "SUCCESS NETCANCEL");
else
$this->m_Log->WriteLog(ERROR, "ERROR NETCANCEL[" . $this->GetResult(NM_RESULTMSG) . "]");
return true;
}
function MakeIMStr($s, $t) {
$this->m_Crypto = new INICrypto($this->m_REQUEST);
if ($t == "H")
return $this->m_Crypto->MakeIMStr($s, base64_decode(IMHK));
else if ($t == "J")
return $this->m_Crypto->MakeIMStr($s, base64_decode(IMJK));
}
/* -------------------------------------------------- */
/* */
/* 에러메세지 Make */
/* */
/* -------------------------------------------------- */
function MakeTXErrMsg($err_code, $err_msg) {
$this->m_RESULT[NM_RESULTCODE] = "01";
$this->m_RESULT[NM_RESULTERRORCODE] = $err_code;
$this->m_RESULT[NM_RESULTMSG] = "[" . $err_code . "|" . $err_msg . "]";
$this->m_Data->GTHR($err_code, $err_msg);
return;
}
}
-226
View File
@@ -1,226 +0,0 @@
<?php
/**
* Copyright (C) 2007 INICIS Inc.
*
* 해당 라이브러리는 절대 수정되어서는 안됩니다.
* 임의로 수정된 코드에 대한 책임은 전적으로 수정자에게 있음을 알려드립니다.
*
*/
class INISocket {
var $hnd;
var $host;
var $ip;
var $port;
var $type;
var $family;
var $protocol;
var $bConnected;
var $sBuffer;
var $sSocErr;
var $dns_laptime;
function error($msg = null) {
$errCode = socket_last_error($this->hnd);
if ($errCode != 0) {
//Connection reset by peer
if ($errCode == 104)
$this->bConnected = false;
$errMsg = socket_strerror($errCode);
$this->sSocErr = "(" . $errCode . ")(" . $errMsg . ")";
socket_clear_error($this->hnd);
}
elseif (strlen($msg)) {
$this->sSocErr = $errMsg;
}
return false;
}
function __construct($host) {
$this->family = AF_INET;
$this->type = SOCK_STREAM;
$this->protocol = SOL_TCP;
$this->hnd = @socket_create($this->family, $this->type, $this->protocol);
$this->error();
$this->sBuffer = false;
$this->ip = null;
$this->host = $host;
$this->port = PG_PORT;
}
function DNSLookUP() {
$starttime = GetMicroTime();
$ip = @gethostbyname($this->host);
if ($ip == PG_IP || $ip == KSPG_IP) {
$this->ip = $ip;
} else {
$this->error("Hostname " . $this->host . " could not be resolved");
return DNS_LOOKUP_ERR;
}
$this->dns_laptime = round(GetMicroTime() - $starttime, 3);
if ($this->dns_laptime > DNS_LOOKUP_TIMEOUT)
return DNS_LOOKUP_TIMEOUT_ERR;
return OK;
}
function open() {
//Connect timeout Trickkkkkkkkk ##2. NONBLOCKING NEED , less CPU clocking!!^^
//modified by ddaemiri, 2007.08.30
socket_set_nonblock($this->hnd);
if (!@socket_connect($this->hnd, $this->ip, $this->port)) {
$err = socket_last_error($this->hnd);
$err_str = socket_strerror($err);
if ($err == 106) { //EISCONN
$this->bConnected = true;
socket_set_block($this->hnd);
return OK;
}
//EINPROGRESS( Linux:115, Window Socket:10035, FreeBSD4.10:36, 모든 OS 체크 불가능해서 str으로도 검색 )
if ($err != ERRCODE_INPROGRESS_LINUX && $err != ERRCODE_INPROGRESS_WIN &&
$err != ERRCODE_INPROGRESS_FREEBSD && $err_str != ERRSTR_INPROGRESS) {
$this->error();
socket_close($this->hnd);
return SOCK_CONN_ERR;
}
}
$read = array($this->hnd);
$write = array($this->hnd);
$except = NULL;
$rtv = @socket_select($read, $write, $except, TIMEOUT_CONNECT);
if ($rtv == 0) { //TIMEOUT
$this->error();
socket_close($this->hnd);
return SOCK_TIMEO_ERR;
} else if ($rtv === FALSE) {
$this->error();
socket_close($this->hnd);
return SOCK_ETC1_ERR;
}
if (in_array($this->hnd, $read) || in_array($this->hnd, $write)) {
if (@socket_get_option($this->hnd, SOL_SOCKET, SO_ERROR) === FALSE) {
$this->error();
socket_close($this->hnd);
return SOCK_ETC2_ERR;
}
}
$this->bConnected = true;
socket_set_block($this->hnd);
return OK;
}
function close() {
//if(!$this->bConnected) return;
@socket_shutdown($this->hnd, 2);
@socket_close($this->hnd);
}
function send($sBuf) {
if (!$this->bConnected) {
$this->error("Socket error. Cannot send data on a closed socket.");
return SOCK_SEND1_ERR;
}
$vWrite = array($this->hnd);
$vRead = null;
$vExcept = null;
while (($rtv = @socket_select($vRead, $vWrite, $vExcept, TIMEOUT_WRITE)) === FALSE);
if ($rtv == 0) {
$this->error();
//return SOCK_TIMEO_ERR;
return SOCK_CONN_ERR; //modify 2008.04.01
}
if ($rtv === FALSE) {
$this->error();
return SOCK_SEND2_ERR;
}
$tmpBuf = strlen($sBuf) ? $sBuf : $this->sBuffer;
$iBufLen = strlen($tmpBuf);
$res = @socket_send($this->hnd, $tmpBuf, $iBufLen, 0);
if ($res === FALSE) {
$this->error();
return SOCK_SEND2_ERR;
} elseif ($res < $iBufLen) {
$tmpBuf = substr($tmpBuf, $res);
$this->send($tmpBuf);
}
return OK;
}
function WaitRecv(&$recv_buf, $nleft) {
$recv_buf = null;
$read = array($this->hnd);
$buf = null;
while ($nleft > 0) {
$write = null;
$except = null;
$rtv = @socket_select($read, $write, $except, TIMEOUT_READ);
if ($rtv == 0) {
$this->error();
return SOCK_TIMEO_ERR;
} else if ($rtv === FALSE) {
$this->error();
return SOCK_ETC1_ERR;
}
if (!in_array($this->hnd, $read)) {
$this->error();
return SOCK_RECV1_ERR;
}
if ($buf = @socket_read($this->hnd, $nleft)) {
$recv_buf .= $buf;
} else {
$this->error();
return SOCK_RECV1_ERR;
}
$nleft -= strlen($buf);
}
return OK;
}
function recv(&$head, &$body, &$tail) {
if (!$this->bConnected) {
$this->error("Socket error. Cannot read any data on a closed socket.");
return SOCK_RECV1_ERR;
}
//------------------------------------------------------
//head
//------------------------------------------------------
if (($rtv = $this->WaitRecv($head, MSGHEADER_LEN)) != OK)
return $rtv;
if ($head == "")
return SOCK_RECV2_ERR;
$body_len = intval(substr($head, 0, BODY_LEN));
$tail_len = intval(substr($head, BODY_LEN, TAIL_LEN));
//------------------------------------------------------
//body
//------------------------------------------------------
if (($rtv = $this->WaitRecv($body, $body_len)) != OK)
return $rtv;
//------------------------------------------------------
//tail
//------------------------------------------------------
if (($rtv = $this->WaitRecv($tail, $tail_len)) != OK)
return $rtv;
return OK;
}
function getErr() {
return $this->sSocErr;
}
}
File diff suppressed because it is too large Load Diff
+38 -38
View File
@@ -153,7 +153,7 @@ class Services_JSON
return mb_convert_encoding($utf16, 'UTF-8', 'UTF-16');
}
$bytes = (ord($utf16{0}) << 8) | ord($utf16{1});
$bytes = (ord($utf16[0]) << 8) | ord($utf16[1]);
switch(true) {
case ((0x7F & $bytes) == $bytes):
@@ -206,17 +206,17 @@ class Services_JSON
case 2:
// return a UTF-16 character from a 2-byte UTF-8 char
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
return chr(0x07 & (ord($utf8{0}) >> 2))
. chr((0xC0 & (ord($utf8{0}) << 6))
| (0x3F & ord($utf8{1})));
return chr(0x07 & (ord($utf8[0]) >> 2))
. chr((0xC0 & (ord($utf8[0]) << 6))
| (0x3F & ord($utf8[1])));
case 3:
// return a UTF-16 character from a 3-byte UTF-8 char
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
return chr((0xF0 & (ord($utf8{0}) << 4))
| (0x0F & (ord($utf8{1}) >> 2)))
. chr((0xC0 & (ord($utf8{1}) << 6))
| (0x7F & ord($utf8{2})));
return chr((0xF0 & (ord($utf8[0]) << 4))
| (0x0F & (ord($utf8[1]) >> 2)))
. chr((0xC0 & (ord($utf8[1]) << 6))
| (0x7F & ord($utf8[2])));
}
// ignoring UTF-32 for now, sorry
@@ -261,7 +261,7 @@ class Services_JSON
*/
for ($c = 0; $c < $strlen_var; ++$c) {
$ord_var_c = ord($var{$c});
$ord_var_c = ord($var[$c]);
switch (true) {
case $ord_var_c == 0x08:
@@ -284,18 +284,18 @@ class Services_JSON
case $ord_var_c == 0x2F:
case $ord_var_c == 0x5C:
// double quote, slash, slosh
$ascii .= '\\'.$var{$c};
$ascii .= '\\'.$var[$c];
break;
case (($ord_var_c >= 0x20) && ($ord_var_c <= 0x7F)):
// characters U-00000000 - U-0000007F (same as ASCII)
$ascii .= $var{$c};
$ascii .= $var[$c];
break;
case (($ord_var_c & 0xE0) == 0xC0):
// characters U-00000080 - U-000007FF, mask 110XXXXX
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
$char = pack('C*', $ord_var_c, ord($var{$c + 1}));
$char = pack('C*', $ord_var_c, ord($var[$c + 1]));
$c += 1;
$utf16 = $this->utf82utf16($char);
$ascii .= sprintf('\u%04s', bin2hex($utf16));
@@ -305,8 +305,8 @@ class Services_JSON
// characters U-00000800 - U-0000FFFF, mask 1110XXXX
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
$char = pack('C*', $ord_var_c,
ord($var{$c + 1}),
ord($var{$c + 2}));
ord($var[$c + 1]),
ord($var[$c + 2]));
$c += 2;
$utf16 = $this->utf82utf16($char);
$ascii .= sprintf('\u%04s', bin2hex($utf16));
@@ -316,9 +316,9 @@ class Services_JSON
// characters U-00010000 - U-001FFFFF, mask 11110XXX
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
$char = pack('C*', $ord_var_c,
ord($var{$c + 1}),
ord($var{$c + 2}),
ord($var{$c + 3}));
ord($var[$c + 1]),
ord($var[$c + 2]),
ord($var[$c + 3]));
$c += 3;
$utf16 = $this->utf82utf16($char);
$ascii .= sprintf('\u%04s', bin2hex($utf16));
@@ -328,10 +328,10 @@ class Services_JSON
// characters U-00200000 - U-03FFFFFF, mask 111110XX
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
$char = pack('C*', $ord_var_c,
ord($var{$c + 1}),
ord($var{$c + 2}),
ord($var{$c + 3}),
ord($var{$c + 4}));
ord($var[$c + 1]),
ord($var[$c + 2]),
ord($var[$c + 3]),
ord($var[$c + 4]));
$c += 4;
$utf16 = $this->utf82utf16($char);
$ascii .= sprintf('\u%04s', bin2hex($utf16));
@@ -341,11 +341,11 @@ class Services_JSON
// characters U-04000000 - U-7FFFFFFF, mask 1111110X
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
$char = pack('C*', $ord_var_c,
ord($var{$c + 1}),
ord($var{$c + 2}),
ord($var{$c + 3}),
ord($var{$c + 4}),
ord($var{$c + 5}));
ord($var[$c + 1]),
ord($var[$c + 2]),
ord($var[$c + 3]),
ord($var[$c + 4]),
ord($var[$c + 5]));
$c += 5;
$utf16 = $this->utf82utf16($char);
$ascii .= sprintf('\u%04s', bin2hex($utf16));
@@ -520,7 +520,7 @@ class Services_JSON
for ($c = 0; $c < $strlen_chrs; ++$c) {
$substr_chrs_c_2 = substr($chrs, $c, 2);
$ord_chrs_c = ord($chrs{$c});
$ord_chrs_c = ord($chrs[$c]);
switch (true) {
case $substr_chrs_c_2 == '\b':
@@ -550,7 +550,7 @@ class Services_JSON
case $substr_chrs_c_2 == '\\/':
if (($delim == '"' && $substr_chrs_c_2 != '\\\'') ||
($delim == "'" && $substr_chrs_c_2 != '\\"')) {
$utf8 .= $chrs{++$c};
$utf8 .= $chrs[++$c];
}
break;
@@ -563,7 +563,7 @@ class Services_JSON
break;
case ($ord_chrs_c >= 0x20) && ($ord_chrs_c <= 0x7F):
$utf8 .= $chrs{$c};
$utf8 .= $chrs[$c];
break;
case ($ord_chrs_c & 0xE0) == 0xC0:
@@ -610,7 +610,7 @@ class Services_JSON
} elseif (preg_match('/^\[.*\]$/s', $str) || preg_match('/^\{.*\}$/s', $str)) {
// array, or object notation
if ($str{0} == '[') {
if ($str[0] == '[') {
$stk = array(SERVICES_JSON_IN_ARR);
$arr = array();
} else {
@@ -649,7 +649,7 @@ class Services_JSON
$top = end($stk);
$substr_chrs_c_2 = substr($chrs, $c, 2);
if (($c == $strlen_chrs) || (($chrs{$c} == ',') && ($top['what'] == SERVICES_JSON_SLICE))) {
if (($c == $strlen_chrs) || (($chrs[$c] == ',') && ($top['what'] == SERVICES_JSON_SLICE))) {
// found a comma that is not inside a string, array, etc.,
// OR we've reached the end of the character list
$slice = substr($chrs, $top['where'], ($c - $top['where']));
@@ -691,12 +691,12 @@ class Services_JSON
}
} elseif ((($chrs{$c} == '"') || ($chrs{$c} == "'")) && ($top['what'] != SERVICES_JSON_IN_STR)) {
} elseif ((($chrs[$c] == '"') || ($chrs[$c] == "'")) && ($top['what'] != SERVICES_JSON_IN_STR)) {
// found a quote, and we are not inside a string
array_push($stk, array('what' => SERVICES_JSON_IN_STR, 'where' => $c, 'delim' => $chrs{$c}));
array_push($stk, array('what' => SERVICES_JSON_IN_STR, 'where' => $c, 'delim' => $chrs[$c]));
//print("Found start of string at {$c}\n");
} elseif (($chrs{$c} == $top['delim']) &&
} elseif (($chrs[$c] == $top['delim']) &&
($top['what'] == SERVICES_JSON_IN_STR) &&
((strlen(substr($chrs, 0, $c)) - strlen(rtrim(substr($chrs, 0, $c), '\\'))) % 2 != 1)) {
// found a quote, we're in a string, and it's not escaped
@@ -705,24 +705,24 @@ class Services_JSON
array_pop($stk);
//print("Found end of string at {$c}: ".substr($chrs, $top['where'], (1 + 1 + $c - $top['where']))."\n");
} elseif (($chrs{$c} == '[') &&
} elseif (($chrs[$c] == '[') &&
in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {
// found a left-bracket, and we are in an array, object, or slice
array_push($stk, array('what' => SERVICES_JSON_IN_ARR, 'where' => $c, 'delim' => false));
//print("Found start of array at {$c}\n");
} elseif (($chrs{$c} == ']') && ($top['what'] == SERVICES_JSON_IN_ARR)) {
} elseif (($chrs[$c] == ']') && ($top['what'] == SERVICES_JSON_IN_ARR)) {
// found a right-bracket, and we're in an array
array_pop($stk);
//print("Found end of array at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
} elseif (($chrs{$c} == '{') &&
} elseif (($chrs[$c] == '{') &&
in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {
// found a left-brace, and we are in an array, object, or slice
array_push($stk, array('what' => SERVICES_JSON_IN_OBJ, 'where' => $c, 'delim' => false));
//print("Found start of object at {$c}\n");
} elseif (($chrs{$c} == '}') && ($top['what'] == SERVICES_JSON_IN_OBJ)) {
} elseif (($chrs[$c] == '}') && ($top['what'] == SERVICES_JSON_IN_OBJ)) {
// found a right-brace, and we're in an object
array_pop($stk);
//print("Found end of object at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");

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