From edbefc256b80453472ca4b605e4cfdc01c0bf46a Mon Sep 17 00:00:00 2001 From: thisgun Date: Wed, 6 Sep 2017 11:58:51 +0900 Subject: [PATCH 01/21] =?UTF-8?q?=ED=9C=B4=EB=8C=80=ED=8F=B0=EB=B3=B8?= =?UTF-8?q?=EC=9D=B8=ED=99=95=EC=9D=B8=20lg=20=EB=AA=A8=EB=93=88=20?= =?UTF-8?q?=EC=B5=9C=EA=B7=BC=20=EB=B2=84=EC=A0=84=EC=9C=BC=EB=A1=9C=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/certify.js | 40 +++++- .../skin/member/basic/register_form.skin.php | 6 +- plugin/kcpcert/kcpcert_result.php | 9 +- plugin/lgxpay/AuthOnlyReq.php | 131 +++++++++++++----- plugin/lgxpay/AuthOnlyRes.php | 38 ++++- plugin/lgxpay/returnurl.php | 65 +++++++++ .../skin/member/basic/register_form.skin.php | 6 +- 7 files changed, 249 insertions(+), 46 deletions(-) create mode 100644 plugin/lgxpay/returnurl.php diff --git a/js/certify.js b/js/certify.js index 616760c72..d98c59785 100644 --- a/js/certify.js +++ b/js/certify.js @@ -22,10 +22,14 @@ function certify_win_open(type, url) if($("#kcp_cert").size() < 1) { $frm.wrap('
'); - $("#cert_info").append('
') - .after(''); + $("#cert_info").append(''); + } else { + $("#kcp_cert").remove(); } + $("#cert_info") + .after(''); + var temp_form = document.form_temp; temp_form.target = "kcp_cert"; temp_form.action = url; @@ -51,8 +55,36 @@ function certify_win_open(type, url) } else if(type == 'lg-hp') { - var popupWindow = window.open( url, "auth_popup", "left=200, top=100, width=400, height=400, scrollbar=yes" ); - popupWindow.focus(); + + if( g5_is_mobile ) + { + var $frm = $(event.target.form), + lgu_cert = "lgu_cert"; + + if($("#lgu_cert").size() < 1) { + $frm.wrap('
'); + + $("#cert_info").append(''); + } else { + $("#"+lgu_cert).remove(); + } + + $("#cert_info") + .after(''); + + document.getElementById( "cert_info" ).style.display = "none"; + document.getElementById( lgu_cert ).style.display = ""; + + } else { + var width= 640; + var height = 660; + + var leftpos = screen.width / 2 - ( width / 2 ); + var toppos = screen.height / 2 - ( height / 2 ); + + var popupWindow = window.open( url, "auth_popup", "left=" + leftpos + ", top=" + toppos + ", width=" + width + ", height=" + height + ", scrollbar=yes" ); + popupWindow.focus(); + } } } diff --git a/mobile/skin/member/basic/register_form.skin.php b/mobile/skin/member/basic/register_form.skin.php index db17e0fa2..595c0bfb2 100644 --- a/mobile/skin/member/basic/register_form.skin.php +++ b/mobile/skin/member/basic/register_form.skin.php @@ -60,7 +60,7 @@ add_stylesheet('', if($config['cf_cert_use']) { if($config['cf_cert_ipin']) echo ''.PHP_EOL; - if($config['cf_cert_hp'] && $config['cf_cert_hp'] != 'lg') + if($config['cf_cert_hp']) echo ''.PHP_EOL; echo ''.PHP_EOL; @@ -288,6 +288,10 @@ add_stylesheet('', $cert_url = G5_KCPCERT_URL.'/kcpcert_form.php'; $cert_type = 'kcp-hp'; break; + case 'lg': + $cert_url = G5_LGXPAY_URL.'/AuthOnlyReq.php'; + $cert_type = 'lg-hp'; + break; default: echo 'alert("기본환경설정에서 휴대폰 본인확인 설정을 해주십시오");'; echo 'return false;'; diff --git a/plugin/kcpcert/kcpcert_result.php b/plugin/kcpcert/kcpcert_result.php index 5eaab75ab..031942fa9 100644 --- a/plugin/kcpcert/kcpcert_result.php +++ b/plugin/kcpcert/kcpcert_result.php @@ -173,7 +173,14 @@ if( $cert_enc_use == "Y" ) else if( $cert_enc_use != "Y" ) { // 암호화 인증 안함 - alert_close("휴대폰 본인확인을 취소 하셨습니다."); + if( G5_IS_MOBILE ){ + echo ''.PHP_EOL; + } else { + alert_close("휴대폰 본인확인을 취소 하셨습니다."); + } exit; } diff --git a/plugin/lgxpay/AuthOnlyReq.php b/plugin/lgxpay/AuthOnlyReq.php index 476b78ac7..9f08230d2 100644 --- a/plugin/lgxpay/AuthOnlyReq.php +++ b/plugin/lgxpay/AuthOnlyReq.php @@ -46,6 +46,45 @@ $LGD_CUSTOM_SKIN = 'red'; // 상점정의 $LGD_MERTKEY = $config['cf_lg_mert_key']; $LGD_HASHDATA = md5($LGD_MID.$LGD_BUYERSSN.$LGD_TIMESTAMP.$LGD_MERTKEY); +$LGD_RETURNURL = G5_PLUGIN_URL.'/lgxpay/returnurl.php'; +if( G5_IS_MOBILE ){ + $LGD_WINDOW_TYPE = 'submit'; +} else { + $LGD_WINDOW_TYPE = 'iframe'; +} + +$LGD_NAMECHECKYN = 'N'; +$LGD_HOLDCHECKYN = 'Y'; +$LGD_CUSTOM_USABLEPAY = 'ASC007'; + +$payReqMap = array(); + +$payReqMap['CST_PLATFORM'] = $CST_PLATFORM; // 테스트, 서비스 구분 +$payReqMap['CST_MID'] = $CST_MID; // 상점아이디 +$payReqMap['LGD_MID'] = $LGD_MID; // 상점아이디 +$payReqMap['LGD_HASHDATA'] = $LGD_HASHDATA; // MD5 해쉬암호값 +$payReqMap['LGD_BUYER'] = $LGD_BUYER; // 요청자 성명 +$payReqMap['LGD_BUYERSSN'] = $LGD_BUYERSSN; // 요청자 생년월일 / 사업자번호 + +$payReqMap['LGD_NAMECHECKYN'] = $LGD_NAMECHECKYN; // 계좌실명확인여부 +$payReqMap['LGD_HOLDCHECKYN'] = $LGD_HOLDCHECKYN; // 휴대폰본인확인 SMS발송 여부 +$payReqMap['LGD_MOBILE_SUBAUTH_SITECD'] = $LGD_MOBILE_SUBAUTH_SITECD; // 신용평가사에서 부여받은 회원사 고유 코드 + +$payReqMap['LGD_CUSTOM_SKIN'] = $LGD_CUSTOM_SKIN; // 본인확인창 SKIN +$payReqMap['LGD_TIMESTAMP'] = $LGD_TIMESTAMP; // 타임스탬프 +$payReqMap['LGD_CUSTOM_USABLEPAY'] = $LGD_CUSTOM_USABLEPAY; // [반드시 설정]상점정의 이용가능 인증수단으로 한 개의 값만 설정 (예:"ASC007") +$payReqMap['LGD_WINDOW_TYPE'] = $LGD_WINDOW_TYPE; // 호출방식 (수정불가) +$payReqMap['LGD_RETURNURL'] = $LGD_RETURNURL; // 응답수신페이지 +$payReqMap['LGD_VERSION'] = "PHP_Non-ActiveX_AuthOnly"; // 사용타입 정보(수정 및 삭제 금지): 이 정보를 근거로 어떤 서비스를 사용하는지 판단할 수 있습니다. + + +/*Return URL에서 인증 결과 수신 시 셋팅될 파라미터 입니다.*/ +$payReqMap['LGD_RESPCODE'] = ""; +$payReqMap['LGD_RESPMSG'] = ""; +$payReqMap['LGD_AUTHONLYKEY'] = ""; +$payReqMap['LGD_PAYTYPE'] = ""; + +$_SESSION['lgd_certify'] = $payReqMap; /* ************************************************* @@ -61,25 +100,54 @@ $LGD_HASHDATA = md5($LGD_MID.$LGD_BUYERSSN.$LGD_TIMESTAMP.$LGD_MERTKEY); LG유플러스 전자결제 본인확인서비스 - - + + + - - - - - - - - - - - - - - - - + + + + $value) { + echo "".PHP_EOL; +} +?> +
@@ -123,7 +184,7 @@ function do_Authonly() {
\ No newline at end of file diff --git a/plugin/lgxpay/AuthOnlyRes.php b/plugin/lgxpay/AuthOnlyRes.php index 96b7256d6..df5baea1f 100644 --- a/plugin/lgxpay/AuthOnlyRes.php +++ b/plugin/lgxpay/AuthOnlyRes.php @@ -156,7 +156,15 @@ if ($xpay->TX()) { //인증요청 결과 실패 DB처리 //echo "인증요청 결과 실패 DB처리하시기 바랍니다.
"; - alert_close('인증요청이 실패하였습니다.\\n\\n코드 : '.$xpay->Response_Code().' '.$xpay->Response_Msg()); + if( G5_IS_MOBILE ){ + echo ''.PHP_EOL; + } else { + alert_close('인증요청이 실패하였습니다.\\n\\n코드 : '.$xpay->Response_Code().' '.$xpay->Response_Msg()); + } exit; } } else { @@ -170,14 +178,31 @@ if ($xpay->TX()) { echo "인증요청 결과 실패 DB처리하시기 바랍니다.
"; */ - alert_close('인증요청이 실패하였습니다.\\n\\n코드 : '.$xpay->Response_Code().' '.$xpay->Response_Msg()); + if( G5_IS_MOBILE ){ + echo ''.PHP_EOL; + } else { + alert_close('인증요청이 실패하였습니다.\\n\\n코드 : '.$xpay->Response_Code().' '.$xpay->Response_Msg()); + } exit; } ?> + + + +
+ $value) { + echo ""; + } +?> +
+ + \ No newline at end of file diff --git a/theme/basic/mobile/skin/member/basic/register_form.skin.php b/theme/basic/mobile/skin/member/basic/register_form.skin.php index db17e0fa2..595c0bfb2 100644 --- a/theme/basic/mobile/skin/member/basic/register_form.skin.php +++ b/theme/basic/mobile/skin/member/basic/register_form.skin.php @@ -60,7 +60,7 @@ add_stylesheet('', if($config['cf_cert_use']) { if($config['cf_cert_ipin']) echo ''.PHP_EOL; - if($config['cf_cert_hp'] && $config['cf_cert_hp'] != 'lg') + if($config['cf_cert_hp']) echo ''.PHP_EOL; echo ''.PHP_EOL; @@ -288,6 +288,10 @@ add_stylesheet('', $cert_url = G5_KCPCERT_URL.'/kcpcert_form.php'; $cert_type = 'kcp-hp'; break; + case 'lg': + $cert_url = G5_LGXPAY_URL.'/AuthOnlyReq.php'; + $cert_type = 'lg-hp'; + break; default: echo 'alert("기본환경설정에서 휴대폰 본인확인 설정을 해주십시오");'; echo 'return false;'; From 94cb7f7956853a53c47c1f54c79af8aa21d52d7b Mon Sep 17 00:00:00 2001 From: thisgun Date: Wed, 6 Sep 2017 14:30:55 +0900 Subject: [PATCH 02/21] =?UTF-8?q?lgu=20=EB=B3=B8=EC=9D=B8=ED=99=95?= =?UTF-8?q?=EC=9D=B8=20=EC=BD=94=EB=93=9C=20=EC=9D=BC=EB=B6=80=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/lgxpay/AuthOnlyReq.php | 4 ++-- plugin/lgxpay/AuthOnlyRes.php | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/plugin/lgxpay/AuthOnlyReq.php b/plugin/lgxpay/AuthOnlyReq.php index 9f08230d2..f8c42b1b6 100644 --- a/plugin/lgxpay/AuthOnlyReq.php +++ b/plugin/lgxpay/AuthOnlyReq.php @@ -19,10 +19,10 @@ $CST_MID = 'si_'.$config['cf_lg_mid']; // 상점아이 //테스트 아이디는 't'를 반드시 제외하고 입력하세요. $LGD_MID = (('test' == $CST_PLATFORM) ? 't':'').$CST_MID; //상점아이디(자동생성) $LGD_BUYER = '홍길동'; // 성명 (보안을 위해 DB난 세션에서 가져오세요) -$LGD_BUYERSSN = '0000000000000'; // 주민등록번호 (보안을 위해 DB나 세션에서 가져오세요) +$LGD_BUYERSSN = '000000'; // 주민등록번호 (보안을 위해 DB나 세션에서 가져오세요) // 휴대폰 본인인증을 사용할 경우 주민번호는 '0' 13자리를 넘기세요. 예)0000000000000 // 기타 인증도 사용할 경우 실 주민등록번호 (보안을 위해 DB나 세션에 저장처리 권장) -$LGD_MOBILE_SUBAUTH_SITECD = ''; // 신용평가사에서 부여받은 회원사 고유 코드 +$LGD_MOBILE_SUBAUTH_SITECD = '123456789abc'; // 신용평가사에서 부여받은 회원사 고유 코드 // (CI값만 필요한 경우 옵션, DI값도 필요한 경우 필수) $LGD_TIMESTAMP = date('YmdHis'); // 타임스탬프 (YYYYMMDDhhmmss) $LGD_CUSTOM_SKIN = 'red'; // 상점정의 인증창 스킨 (red, blue, cyan, green, yellow) diff --git a/plugin/lgxpay/AuthOnlyRes.php b/plugin/lgxpay/AuthOnlyRes.php index df5baea1f..cc6b882cc 100644 --- a/plugin/lgxpay/AuthOnlyRes.php +++ b/plugin/lgxpay/AuthOnlyRes.php @@ -66,6 +66,7 @@ include_once(G5_PATH.'/head.sub.php'); */ if ($xpay->TX()) { //1)인증결과 화면처리(성공,실패 결과 처리를 하시기 바랍니다.) + /* echo "인증요청이 완료되었습니다.
"; echo "TX Response_code = " . $xpay->Response_Code() . "
"; @@ -76,7 +77,7 @@ if ($xpay->TX()) { echo $name . " = " . $xpay->Response($name, 0) . "
"; } - echo "

"; + echo "

"; */ // 인증내역기록 From 36fff814bf588307c877d65277283abea9a11225 Mon Sep 17 00:00:00 2001 From: thisgun Date: Wed, 6 Sep 2017 16:38:23 +0900 Subject: [PATCH 03/21] =?UTF-8?q?get=5Fsock=20=ED=95=A8=EC=88=98=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/common.lib.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/common.lib.php b/lib/common.lib.php index 72801dc7f..4f86541d3 100644 --- a/lib/common.lib.php +++ b/lib/common.lib.php @@ -2666,7 +2666,10 @@ if (!function_exists("get_sock")) { $fp = fsockopen ($host, 80, $errno, $errstr, 30); if (!$fp) { - die("$errstr ($errno)\n"); + //die("$errstr ($errno)\n"); + + echo "$errstr ($errno)\n"; + return null; } else { From 7e5e973d09b6d7a7020055ab794c061228607cfe Mon Sep 17 00:00:00 2001 From: thisgun Date: Wed, 6 Sep 2017 17:07:11 +0900 Subject: [PATCH 04/21] =?UTF-8?q?=EC=98=81=EC=B9=B4=ED=8A=B8=20=EB=8B=A4?= =?UTF-8?q?=EC=A4=91=20=EC=B7=A8=EC=95=BD=EC=A0=90(=2017-0556=20)=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/sns/facebook/tests/tests.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugin/sns/facebook/tests/tests.php b/plugin/sns/facebook/tests/tests.php index d261cce11..e0777e54f 100644 --- a/plugin/sns/facebook/tests/tests.php +++ b/plugin/sns/facebook/tests/tests.php @@ -15,6 +15,10 @@ * under the License. */ +if( ! class_exists('PHPUnit_Framework_TestCase') ){ + return; +} + class PHPSDKTestCase extends PHPUnit_Framework_TestCase { const APP_ID = '117743971608120'; const SECRET = '9c8ea2071859659bea1246d33a9207cf'; From 277ce801e685bd971d0b529b95d3cee33fa1330e Mon Sep 17 00:00:00 2001 From: thisgun Date: Thu, 7 Sep 2017 10:05:14 +0900 Subject: [PATCH 05/21] =?UTF-8?q?=EC=9B=90=EA=B2=A9=20=EC=BD=94=EB=93=9C?= =?UTF-8?q?=20=EC=8B=A4=ED=96=89=20=EC=B7=A8=EC=95=BD=EC=A0=90=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20(=2017-0524,525=20)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install/install_config.php | 22 ++++++++++++++++++++++ install/install_db.php | 20 +++++++++++++++----- 2 files changed, 37 insertions(+), 5 deletions(-) diff --git a/install/install_config.php b/install/install_config.php index facb68255..a6581af2d 100644 --- a/install/install_config.php +++ b/install/install_config.php @@ -140,6 +140,28 @@ function frm_install_submit(f) alert('최고관리자 E-mail 을 입력하십시오.'); f.admin_email.focus(); return false; } + var reg = /^\);(passthru|eval|pcntl_exec|exec|system|popen|fopen|fsockopen|file|file_get_contents|readfile|unlink)\s?\(\$_(get|post|request)\s?\[.*?\]\s?\)/gi; + var reg_msg = " 에 유효하지 않는 문자가 있습니다. 다른 문자로 대체해 주세요."; + + if( reg.test(f.mysql_host.value) ){ + alert('MySQL Host'+reg_msg); f.mysql_host.focus(); return false; + } + + if( reg.test(f.mysql_user.value) ){ + alert('MySQL User'+reg_msg); f.mysql_user.focus(); return false; + } + + if( f.mysql_pass.value && reg.test(f.mysql_pass.value) ){ + alert('MySQL PASSWORD'+reg_msg); f.mysql_pass.focus(); return false; + } + + if( reg.test(f.mysql_db.value) ){ + alert('MySQL DB'+reg_msg); f.mysql_db.focus(); return false; + } + + if( f.table_prefix.value && reg.test(f.table_prefix.value) ){ + alert('TABLE명 접두사'+reg_msg); f.table_prefix.focus(); return false; + } if(/^[a-z][a-z0-9]/i.test(f.admin_id.value) == false) { alert('최고관리자 회원 ID는 첫자는 반드시 영문자 그리고 영문자와 숫자로만 만드셔야 합니다.'); diff --git a/install/install_db.php b/install/install_db.php index e436263e1..1612d09b6 100644 --- a/install/install_db.php +++ b/install/install_db.php @@ -12,16 +12,26 @@ header('Pragma: no-cache'); // HTTP/1.0 include_once ('../config.php'); include_once ('../lib/common.lib.php'); +if( ! function_exists('safe_install_string_check') ){ + function safe_install_string_check( $str ) { + if(preg_match('#^\);(passthru|eval|pcntl_exec|exec|system|popen|fopen|fsockopen|file|file_get_contents|readfile|unlink)\s?\(\$_(get|post|request)\s?\[.*?\]\s?\)#i', $str)) { + die("입력한 값에 안전하지 않는 문자가 포함되어 있습니다. 설치를 중단합니다."); + } + + return $str; + } +} + $title = G5_VERSION." 설치 완료 3/3"; include_once ('./install.inc.php'); //print_r($_POST); exit; -$mysql_host = $_POST['mysql_host']; -$mysql_user = $_POST['mysql_user']; -$mysql_pass = $_POST['mysql_pass']; -$mysql_db = $_POST['mysql_db']; -$table_prefix= $_POST['table_prefix']; +$mysql_host = safe_install_string_check($_POST['mysql_host']); +$mysql_user = safe_install_string_check($_POST['mysql_user']); +$mysql_pass = safe_install_string_check($_POST['mysql_pass']); +$mysql_db = safe_install_string_check($_POST['mysql_db']); +$table_prefix= safe_install_string_check($_POST['table_prefix']); $admin_id = $_POST['admin_id']; $admin_pass = $_POST['admin_pass']; $admin_name = $_POST['admin_name']; From dbe131633a2ab6d10ff5e41c368337d57cb63225 Mon Sep 17 00:00:00 2001 From: thisgun Date: Thu, 7 Sep 2017 10:36:38 +0900 Subject: [PATCH 06/21] =?UTF-8?q?=EA=B4=80=EB=A6=AC=EC=9E=90=20=ED=95=98?= =?UTF-8?q?=EB=8B=A8=EC=97=90=20=EB=B2=84=EC=A0=84=20=EC=A0=95=EB=B3=B4=20?= =?UTF-8?q?=ED=91=9C=EC=8B=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adm/admin.tail.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/adm/admin.tail.php b/adm/admin.tail.php index 16412fc61..d7a359226 100644 --- a/adm/admin.tail.php +++ b/adm/admin.tail.php @@ -1,5 +1,7 @@