Merge branch 'gnuboard:master' into master
This commit is contained in:
@ -9,10 +9,11 @@ if( !function_exists('che_reprocessImage') ){
|
||||
function che_reprocessImage($file_path, $callback){
|
||||
|
||||
$MIME_TYPES_PROCESSORS = array(
|
||||
"image/gif" => array("imagecreatefromgif", "imagegif"),
|
||||
"image/gif" => array("imagecreatefromgif", "imagegif"),
|
||||
"image/jpg" => array("imagecreatefromjpeg", "imagejpeg"),
|
||||
"image/jpeg" => array("imagecreatefromjpeg", "imagejpeg"),
|
||||
"image/png" => array("imagecreatefrompng", "imagepng"),
|
||||
"image/png" => array("imagecreatefrompng", "imagepng"),
|
||||
"image/webp" => array("imagecreatefromwebp", "imagewebp"),
|
||||
"image/bmp" => array("imagecreatefromwbmp", "imagewbmp")
|
||||
);
|
||||
|
||||
@ -69,12 +70,14 @@ if( !$is_editor_upload ){
|
||||
exit;
|
||||
}
|
||||
|
||||
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);
|
||||
$found = false;
|
||||
switch ($type) {
|
||||
@ -82,10 +85,11 @@ switch ($type) {
|
||||
case "jpeg":
|
||||
case "gif":
|
||||
case "png":
|
||||
case "webp":
|
||||
$found = true;
|
||||
}
|
||||
|
||||
if ($found != true) {
|
||||
if ($found != true || $filename_len != 23) {
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
<div style="margin: 0px 0px 10px 0px;">
|
||||
<img src="../icons/imageUpload/remove_all.gif" class="remove-button" onclick="removeImages();"
|
||||
alt="" style="vertical-align: middle" />
|
||||
<input type="file" name="imageUpload[]" accept="image/jpeg,image/png,image/gif" id="inputImageUpload" multiple="multiple"
|
||||
<input type="file" name="imageUpload[]" accept="image/jpeg,image/png,image/gif,image/webp" id="inputImageUpload" multiple="multiple"
|
||||
onchange="selectedFiles(event)" style="vertical-align: middle; visibility: hidden; width: 0px"/>
|
||||
<img id="fileSelectButton" src="../icons/imageUpload/add.gif" alt="image button" onclick="inputImageUpload.click()"
|
||||
style="vertical-align: middle; margin-left: -5px; cursor: pointer"/>
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
<div style="margin: 0px 0px 10px 0px;">
|
||||
<img src="../icons/imageUpload/remove_all.gif" class="remove-button" onclick="removeImages();"
|
||||
alt="" style="vertical-align: middle" />
|
||||
<input type="file" name="imageUpload[]" accept="image/jpeg,image/png,image/gif" id="inputImageUpload" multiple="multiple"
|
||||
<input type="file" name="imageUpload[]" accept="image/jpeg,image/png,image/gif,image/webp" id="inputImageUpload" multiple="multiple"
|
||||
onchange="selectedFiles(event)" style="vertical-align: middle; visibility: hidden; width: 0px"/>
|
||||
<img id="fileSelectButton" src="../icons/imageUpload/add.gif" alt="image button" onclick="inputImageUpload.click()"
|
||||
style="vertical-align: middle; margin-left: -5px; cursor: pointer"/>
|
||||
|
||||
@ -14,7 +14,7 @@ var activeImage = null,
|
||||
dragDropDiv,
|
||||
eventDiff_x = 0,
|
||||
eventDiff_y = 0,
|
||||
fileTypeRe = /^image\/(png|jpeg|gif)$/i,
|
||||
fileTypeRe = /^image\/(png|jpeg|gif|webp)$/i,
|
||||
geckoOffsetX_marker = -3,
|
||||
geckoOffsetY_marker = -1,
|
||||
imageCompleted = 0,
|
||||
@ -434,7 +434,12 @@ function startUpload(list) {
|
||||
|
||||
function fileFilterError(file) {
|
||||
alert("선택하신 '" + file + "' 파일은 전송할 수 없습니다.\n" +
|
||||
"gif, png, jpg 사진 파일만 전송할 수 있습니다.");
|
||||
"gif, png, jpg, webp 사진 파일만 전송할 수 있습니다.");
|
||||
}
|
||||
|
||||
function explorerFileFilterError(file) {
|
||||
alert("선택하신 '" + file + "' 파일은 전송할 수 없습니다.\n" +
|
||||
"익스플로러 환경에서는 gif, png, jpg 사진 파일만 \n전송할 수 있습니다.");
|
||||
}
|
||||
|
||||
function imgComplete(img, imgSize, boxId) {
|
||||
@ -962,7 +967,13 @@ DoUpload.prototype = {
|
||||
file = files[i];
|
||||
|
||||
if (!file.type.match(fileTypeRe)) {
|
||||
fileFilterError(file.name);
|
||||
// 엣지를 제외한 ie브라우저인지 체크
|
||||
var agent = navigator.userAgent.toLowerCase();
|
||||
if (agent.indexOf('trident') != -1 || agent.indexOf("msie") != -1) {
|
||||
explorerFileFilterError(file.name);
|
||||
} else {
|
||||
FileFilterError(file.name);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
this.list.push(file);
|
||||
|
||||
@ -14,7 +14,7 @@ var activeImage = null,
|
||||
dragDropDiv,
|
||||
eventDiff_x = 0,
|
||||
eventDiff_y = 0,
|
||||
fileTypeRe = /^image\/(png|jpeg|gif)$/i,
|
||||
fileTypeRe = /^image\/(png|jpeg|gif|webp)$/i,
|
||||
geckoOffsetX_marker = -3,
|
||||
geckoOffsetY_marker = -1,
|
||||
imageCompleted = 0,
|
||||
@ -434,7 +434,12 @@ function startUpload(list) {
|
||||
|
||||
function fileFilterError(file) {
|
||||
alert("선택하신 '" + file + "' 파일은 전송할 수 없습니다.\n" +
|
||||
"gif, png, jpg 사진 파일만 전송할 수 있습니다.");
|
||||
"gif, png, jpg, webp 사진 파일만 전송할 수 있습니다.");
|
||||
}
|
||||
|
||||
function explorerFileFilterError(file) {
|
||||
alert("선택하신 '" + file + "' 파일은 전송할 수 없습니다.\n" +
|
||||
"익스플로러 환경에서는 gif, png, jpg 사진 파일만 \n전송할 수 있습니다.");
|
||||
}
|
||||
|
||||
function imgComplete(img, imgSize, boxId) {
|
||||
@ -962,10 +967,16 @@ DoUpload.prototype = {
|
||||
file = files[i];
|
||||
|
||||
if (!file.type.match(fileTypeRe)) {
|
||||
fileFilterError(file.name);
|
||||
// 엣지를 제외한 ie브라우저인지 체크
|
||||
var agent = navigator.userAgent.toLowerCase();
|
||||
if (agent.indexOf('trident') != -1 || agent.indexOf("msie") != -1) {
|
||||
explorerFileFilterError(file.name);
|
||||
} else {
|
||||
FileFilterError(file.name);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
this.list.push(file);
|
||||
this.list.push(file);
|
||||
}
|
||||
|
||||
if (this.list.length < 1) {
|
||||
|
||||
@ -335,7 +335,7 @@ function startUpload(count) {
|
||||
|
||||
function fileFilterError(file) {
|
||||
alert("선택하신 '" + file + "' 파일은 전송할 수 없습니다.\n" +
|
||||
"gif, png, jpg, 그림 파일만 전송할 수 있습니다.");
|
||||
"gif, png, jpg, webp 그림 파일만 전송할 수 있습니다.");
|
||||
}
|
||||
|
||||
function imgComplete(img, imgSize, boxId) {
|
||||
|
||||
@ -54,7 +54,7 @@ function chkImgFormat (url)
|
||||
{
|
||||
var imageName = getFilename(url);
|
||||
var allowSubmit = false;
|
||||
var extArray = [".gif", ".jpg", ".jpeg", ".png"];
|
||||
var extArray = [".gif", ".jpg", ".jpeg", ".png", ".webp"];
|
||||
|
||||
extArray.join(" ");
|
||||
if (imageName === "") {
|
||||
@ -72,7 +72,7 @@ function chkImgFormat (url)
|
||||
}
|
||||
|
||||
if (!allowSubmit) {
|
||||
alert("사진은 GIF, JPG, PNG 형식만 넣을 수 있습니다.");
|
||||
alert("사진은 GIF, JPG, PNG, WEBP 형식만 넣을 수 있습니다.");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@ -1,64 +1,67 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html lang="ko">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
|
||||
<title>사진 첨부하기 :: SmartEditor2</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<!-- Generic page styles -->
|
||||
<link rel="stylesheet" href="css/style.css?v=140715">
|
||||
<!-- CSS to style the file input field as button and adjust the Bootstrap progress bars -->
|
||||
<link rel="stylesheet" href="css/jquery.fileupload.css">
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
|
||||
<title>사진 첨부하기 :: SmartEditor2</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<!-- Generic page styles -->
|
||||
<link rel="stylesheet" href="css/style.css?v=140715">
|
||||
<!-- CSS to style the file input field as button and adjust the Bootstrap progress bars -->
|
||||
<link rel="stylesheet" href="css/jquery.fileupload.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container pop_container">
|
||||
<!-- header -->
|
||||
<div id="pop_header">
|
||||
<h1>사진 첨부하기</h1>
|
||||
</div>
|
||||
<!-- //header -->
|
||||
<div class="content_container">
|
||||
<div class="drag_explain">
|
||||
<p>마우스로 드래그하여 순서를 바꿀수 있습니다.</p>
|
||||
<div class="file_selet_group">
|
||||
<span class="btn btn-success fileinput-button">
|
||||
<span>파일선택</span>
|
||||
<!-- The file input field used as target for the file upload widget -->
|
||||
<input id="fileupload" type="file" name="files[]" multiple accept="image/*">
|
||||
</span>
|
||||
<button type="button" class="btn btn-danger delete" id="all_remove_btn">
|
||||
<span>전체삭제</span>
|
||||
</button>
|
||||
<div class="container pop_container">
|
||||
<!-- header -->
|
||||
<div id="pop_header">
|
||||
<h1>사진 첨부하기</h1>
|
||||
</div>
|
||||
<!-- //header -->
|
||||
<div class="content_container">
|
||||
<div class="drag_explain">
|
||||
<p>마우스로 드래그하여 순서를 바꿀수 있습니다.</p>
|
||||
<div class="file_selet_group">
|
||||
<span class="btn btn-success fileinput-button">
|
||||
<span>파일선택</span>
|
||||
<!-- The file input field used as target for the file upload widget -->
|
||||
<input id="fileupload" type="file" name="files[]" multiple accept="image/*">
|
||||
</span>
|
||||
<button type="button" class="btn btn-danger delete" id="all_remove_btn">
|
||||
<span>전체삭제</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drag_area" id="drag_area">
|
||||
<ul class="sortable" id="sortable">
|
||||
</ul>
|
||||
<em class="blind">마우스로 드래그해서 이미지를 추가해주세요.</em><span id="guide_text" class="bg hidebg"></span>
|
||||
</div>
|
||||
<div class="seletion_explain">이미지는 한번에 10개까지 선택할수 있습니다.</div>
|
||||
<div class="btn_group">
|
||||
<button type="button" class="btn" id="img_upload_submit">
|
||||
<span>등록</span>
|
||||
</button>
|
||||
<button type="button" class="btn" id="close_w_btn">
|
||||
<span>취소</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drag_area" id="drag_area">
|
||||
<ul class="sortable" id="sortable">
|
||||
</ul>
|
||||
<em class="blind">마우스로 드래그해서 이미지를 추가해주세요.</em><span id="guide_text" class="bg hidebg"></span>
|
||||
</div>
|
||||
<div class="seletion_explain">이미지는 한번에 10개까지 선택할수 있습니다.</div>
|
||||
<div class="btn_group">
|
||||
<button type="button" class="btn" id="img_upload_submit">
|
||||
<span>등록</span>
|
||||
</button>
|
||||
<button type="button" class="btn" id="close_w_btn" >
|
||||
<span>취소</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
|
||||
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js"></script>
|
||||
<!-- The Iframe Transport is required for browsers without support for XHR file uploads -->
|
||||
<script src="./js/jquery.iframe-transport.js"></script>
|
||||
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
|
||||
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js"></script>
|
||||
<!-- The Iframe Transport is required for browsers without support for XHR file uploads -->
|
||||
<script src="./js/jquery.iframe-transport.js"></script>
|
||||
|
||||
<script type="text/javascript" src="./swfupload/swfupload.js"></script>
|
||||
<script type="text/javascript" src="./swfupload/jquery.swfupload.js"></script>
|
||||
<script type="text/javascript" src="./swfupload/swfupload.js?v=210625-1329"></script>
|
||||
<script type="text/javascript" src="./swfupload/jquery.swfupload.js?v=210625-1329"></script>
|
||||
|
||||
<!-- The basic File Upload plugin -->
|
||||
<script src="./js/jquery.fileupload.js?v=140715"></script>
|
||||
<!-- The basic File Upload plugin -->
|
||||
<script src="./js/jquery.fileupload.js?v=210625-1329"></script>
|
||||
|
||||
<script src="./js/basic.js?v=210625-1329"></script>
|
||||
</body>
|
||||
|
||||
<script src="./js/basic.js?v3"></script>
|
||||
</body>
|
||||
</html>
|
||||
@ -1,9 +1,9 @@
|
||||
jQuery.fn.bindAll = function(options) {
|
||||
var $this = this;
|
||||
jQuery.each(options, function(key, val){
|
||||
$this.bind(key, val);
|
||||
});
|
||||
return this;
|
||||
jQuery.fn.bindAll = function (options) {
|
||||
var $this = this;
|
||||
jQuery.each(options, function (key, val) {
|
||||
$this.bind(key, val);
|
||||
});
|
||||
return this;
|
||||
}
|
||||
|
||||
jQuery(function ($) {
|
||||
@ -11,131 +11,133 @@ jQuery(function ($) {
|
||||
|
||||
var ed_nonce = '';
|
||||
|
||||
if( !!opener && !!opener.window && !!opener.window.nhn ){
|
||||
if (!!opener && !!opener.window && !!opener.window.nhn) {
|
||||
ed_nonce = opener.window.nhn.husky.SE2M_Configuration.SE2M_Accessibility.ed_nonce;
|
||||
}
|
||||
|
||||
// Change this to the location of your server-side upload handler:
|
||||
var gnu = {
|
||||
url : './php/?_nonce='+ed_nonce,
|
||||
container_el : 'body',
|
||||
dreg_area : '#drag_area',
|
||||
dreg_area_list : '#drag_area > ul',
|
||||
progress_bar : '#progress .progress-bar',
|
||||
filter : /^(image\/bmp|image\/gif|image\/jpg|image\/jpeg|image\/png)$/i,
|
||||
files : [],
|
||||
file_limit : 10, //한번에 올릴수 파일갯수 제한
|
||||
imgw : 100,
|
||||
imgh : 70,
|
||||
file_api_support : !!(window.ProgressEvent && window.FileReader),
|
||||
$elTextGuide : $("#guide_text"),
|
||||
init : function(){
|
||||
url: './php/?_nonce=' + ed_nonce,
|
||||
container_el: 'body',
|
||||
dreg_area: '#drag_area',
|
||||
dreg_area_list: '#drag_area > ul',
|
||||
progress_bar: '#progress .progress-bar',
|
||||
filter: /^(image\/bmp|image\/gif|image\/jpg|image\/jpeg|image\/png|image\/webp)$/i,
|
||||
files: [],
|
||||
file_limit: 10, //한번에 올릴수 파일갯수 제한
|
||||
imgw: 100,
|
||||
imgh: 70,
|
||||
file_api_support: !!(window.ProgressEvent && window.FileReader),
|
||||
$elTextGuide: $("#guide_text"),
|
||||
init: function () {
|
||||
$(this.dreg_area_list).sortable({
|
||||
'cursor':'pointer',
|
||||
'placeholder':'placeholder'
|
||||
'cursor': 'pointer',
|
||||
'placeholder': 'placeholder'
|
||||
});
|
||||
$(this.dreg_area_list).disableSelection();
|
||||
if( this.file_api_support ) this.$elTextGuide.removeClass("hidebg").addClass("showbg");
|
||||
if (this.file_api_support) this.$elTextGuide.removeClass("hidebg").addClass("showbg");
|
||||
},
|
||||
file_push : function(file){
|
||||
file_push: function (file) {
|
||||
var othis = this,
|
||||
last = othis.files.length;
|
||||
|
||||
othis.files.push(file);
|
||||
},
|
||||
_readymodebg : function(){
|
||||
if( this.file_api_support ) {
|
||||
_readymodebg: function () {
|
||||
if (this.file_api_support) {
|
||||
var sClass = this.$elTextGuide.attr('class');
|
||||
if(sClass.indexOf('hidebg') > 0){
|
||||
if (sClass.indexOf('hidebg') > 0) {
|
||||
this.$elTextGuide.removeClass('hidebg');
|
||||
this.$elTextGuide.addClass('showbg');
|
||||
}
|
||||
}
|
||||
},
|
||||
_startmodebg : function(){
|
||||
if( this.file_api_support ) {
|
||||
_startmodebg: function () {
|
||||
if (this.file_api_support) {
|
||||
var sClass = this.$elTextGuide.attr('class');
|
||||
if(sClass.indexOf('hidebg') < 0){
|
||||
if (sClass.indexOf('hidebg') < 0) {
|
||||
this.$elTextGuide.removeClass('showbg');
|
||||
this.$elTextGuide.addClass('hidebg');
|
||||
}
|
||||
}
|
||||
},
|
||||
_delete : function(e){
|
||||
_delete: function (e) {
|
||||
e.preventDefault();
|
||||
var othis = gnu,
|
||||
$button = $(e.currentTarget),
|
||||
delete_url = $button.attr("data-delete");
|
||||
if( delete_url ){
|
||||
if (delete_url) {
|
||||
$.ajax({
|
||||
url: othis.url+"&del=1&file="+ delete_url
|
||||
url: othis.url + "&del=1&file=" + delete_url
|
||||
}).done(function (result) {
|
||||
});
|
||||
}
|
||||
$button.parents('li.sort_list').fadeOut(300, function(){
|
||||
$button.parents('li.sort_list').fadeOut(300, function () {
|
||||
$(this).remove();
|
||||
var $dreg_area = $(othis.dreg_area_list);
|
||||
$dreg_area.sortable('refresh');
|
||||
if( !$dreg_area.children('li').length ) othis._readymodebg();
|
||||
if (!$dreg_area.children('li').length) othis._readymodebg();
|
||||
});
|
||||
},
|
||||
_add : function(e, data, preload){
|
||||
_add: function (e, data, preload) {
|
||||
var othis = this;
|
||||
othis._startmodebg();
|
||||
data.context = $('<li/>').addClass("sort_list").appendTo(this.dreg_area_list);
|
||||
$.each(data.files, function (index, file) {
|
||||
if ( !preload && !othis.filter.test(file.type)) {
|
||||
if (!preload && !othis.filter.test(file.type)) {
|
||||
var agent = navigator.userAgent.toLowerCase();
|
||||
var msg = '';
|
||||
msg = (agent.indexOf('trident') != -1 || agent.indexOf("msie") != -1)? "익스플로러 환경에서는 gif, png, jpg 파일만 \n전송할 수 있습니다.":"이미지만 허용합니다.";
|
||||
data.context.remove();
|
||||
alert('이미지만 허용합니다.');
|
||||
alert(msg);
|
||||
return true;
|
||||
}
|
||||
var node = $('<div/>')
|
||||
.append($('<span/>').text(file.name))
|
||||
.append($('<span/>').addClass("delete_img").attr({"data-delete":file.name,"data-url":file.url}).html("<img src='./img/system_delete.png' alt='삭제' title='삭제' >")),
|
||||
.append($('<span/>').text(file.name))
|
||||
.append($('<span/>').addClass("delete_img").attr({ "data-delete": file.name, "data-url": file.url }).html("<img src='./img/system_delete.png' alt='삭제' title='삭제' >")),
|
||||
$img = "<img src='./img/loading.gif' class='pre_thumb' />",
|
||||
size_text = '';
|
||||
|
||||
if ( preload && preload != 'swfupload' ){
|
||||
var ret = othis.get_ratio( file.width, file.height ),
|
||||
size_text = file.width+" x "+file.height;
|
||||
$img = "<img src='"+file.url+"' width='"+ret['width']+"' height='"+ret['height']+"' class='pre_thumb' />";
|
||||
|
||||
}
|
||||
if (!index) {
|
||||
node
|
||||
.prepend('<br>')
|
||||
.prepend($img);
|
||||
if(size_text){
|
||||
node.append('<br>')
|
||||
|
||||
if (preload && preload != 'swfupload') {
|
||||
var ret = othis.get_ratio(file.width, file.height),
|
||||
size_text = file.width + " x " + file.height;
|
||||
$img = "<img src='" + file.url + "' width='" + ret['width'] + "' height='" + ret['height'] + "' class='pre_thumb' />";
|
||||
|
||||
}
|
||||
if (!index) {
|
||||
node.prepend('<br>')
|
||||
.prepend($img);
|
||||
if (size_text) {
|
||||
node.append('<br>')
|
||||
.append($('<span/>').text(size_text))
|
||||
}
|
||||
}
|
||||
}
|
||||
node.appendTo(data.context);
|
||||
node.find(".delete_img").on("click", othis._delete);
|
||||
});
|
||||
$(othis.dreg_area_list).sortable('refresh');
|
||||
},
|
||||
get_file_all : function(){
|
||||
get_file_all: function () {
|
||||
var othis = this,
|
||||
oDate = new Date();
|
||||
$.ajax({
|
||||
// Uncomment the following to send cross-domain cookies:
|
||||
//xhrFields: {withCredentials: true},
|
||||
//url: $('#fileupload').fileupload('option', 'url'),
|
||||
url: this.url+"&t="+ oDate.getTime(),
|
||||
url: this.url + "&t=" + oDate.getTime(),
|
||||
dataType: 'json',
|
||||
context: $('#fileupload')[0]
|
||||
}).always(function () {
|
||||
//$(this).removeClass('fileupload-processing');
|
||||
}).done(function (result) {
|
||||
$.each(result.files, function (index, data) {
|
||||
var tmp = { files : [] };
|
||||
var tmp = { files: [] };
|
||||
tmp.files[0] = data;
|
||||
othis._add( $.Event('add'), tmp, 'preload' );
|
||||
othis._add($.Event('add'), tmp, 'preload');
|
||||
});
|
||||
});
|
||||
},
|
||||
_processalways : function(e, data){
|
||||
_processalways: function (e, data) {
|
||||
var index = data.index,
|
||||
file = data.files[index],
|
||||
node = $(data.context.children()[index]);
|
||||
@ -150,29 +152,29 @@ jQuery(function ($) {
|
||||
.prop('disabled', !!data.files.error);
|
||||
}
|
||||
},
|
||||
obj_to_arr : function(obj){
|
||||
var array = $.map(obj, function(value, index) {
|
||||
obj_to_arr: function (obj) {
|
||||
var array = $.map(obj, function (value, index) {
|
||||
return [value];
|
||||
});
|
||||
return array;
|
||||
},
|
||||
_done : function(e, data){
|
||||
_done: function (e, data) {
|
||||
var othis = this;
|
||||
$.each(data.result.files, function (index, file) {
|
||||
if (file.url && !file.error) {
|
||||
var ret = othis.get_ratio( file.width, file.height ),
|
||||
var ret = othis.get_ratio(file.width, file.height),
|
||||
node = $(data.context.children()[index]),
|
||||
size_text = file.width+" x "+file.height,
|
||||
size_text = file.width + " x " + file.height,
|
||||
//$img = "<img src='"+file.url+"' width='"+ret['width']+"' height='"+ret['height']+"' />",
|
||||
link = $('<a>')
|
||||
.attr('target', '_blank')
|
||||
.prop('href', file.url);
|
||||
node
|
||||
//.wrap(link)
|
||||
.append('<br>')
|
||||
.append($('<span/>').text(size_text))
|
||||
.find("img.pre_thumb").attr({"src":file.url,"width":ret['width'],"height":ret['height']})
|
||||
.end().find(".delete_img").attr({"data-delete":file.name,"data-url":file.url});
|
||||
.attr('target', '_blank')
|
||||
.prop('href', file.url);
|
||||
node
|
||||
//.wrap(link)
|
||||
.append('<br>')
|
||||
.append($('<span/>').text(size_text))
|
||||
.find("img.pre_thumb").attr({ "src": file.url, "width": ret['width'], "height": ret['height'] })
|
||||
.end().find(".delete_img").attr({ "data-delete": file.name, "data-url": file.url });
|
||||
} else if (file.error) {
|
||||
var error = $('<span class="text-danger"/>').text(file.error);
|
||||
$(data.context.children()[index])
|
||||
@ -182,20 +184,20 @@ jQuery(function ($) {
|
||||
othis.file_push(file);
|
||||
});
|
||||
},
|
||||
get_ratio : function(width, height){
|
||||
get_ratio: function (width, height) {
|
||||
var ratio = 0,
|
||||
ret_img = [];
|
||||
if( !width || !height ){
|
||||
if (!width || !height) {
|
||||
ret_img['width'] = this.imgw;
|
||||
ret_img['height'] = this.imgh;
|
||||
return ret_img;
|
||||
}
|
||||
if(width > this.imgw){
|
||||
if (width > this.imgw) {
|
||||
ratio = this.imgw / width;
|
||||
height = height * ratio;
|
||||
width = this.imgw;
|
||||
}
|
||||
if( height > this.imgh ){
|
||||
if (height > this.imgh) {
|
||||
ratio = this.imgh / height;
|
||||
width = width * ratio;
|
||||
height = this.imgh;
|
||||
@ -204,7 +206,7 @@ jQuery(function ($) {
|
||||
ret_img['height'] = parseInt(height);
|
||||
return ret_img;
|
||||
},
|
||||
setPhotoToEditor : function(oFileInfo){
|
||||
setPhotoToEditor: function (oFileInfo) {
|
||||
if (!!opener && !!opener.nhn && !!opener.nhn.husky && !!opener.nhn.husky.PopUpManager) {
|
||||
//스마트 에디터 플러그인을 통해서 넣는 방법 (oFileInfo는 Array)
|
||||
opener.nhn.husky.PopUpManager.setCallback(window, 'SET_PHOTO', [oFileInfo]);
|
||||
@ -221,19 +223,19 @@ jQuery(function ($) {
|
||||
dropZone: $(gnu.dreg_area),
|
||||
autoUpload: true,
|
||||
sequentialUploads: true,
|
||||
acceptFileTypes: /(\.|\/)(gif|jpe?g|bmp|png)$/i,
|
||||
acceptFileTypes: /(\.|\/)(gif|jpe?g|bmp|png|webp)$/i,
|
||||
// Enable image resizing, except for Android and Opera,
|
||||
// which actually support image resizing, but fail to
|
||||
// send Blob objects via XHR requests:
|
||||
disableImageResize: true,
|
||||
limit_filesLength : gnu.file_limit
|
||||
limit_filesLength: gnu.file_limit
|
||||
}).on('fileuploadadd', function (e, data) {
|
||||
gnu._add(e, data);
|
||||
}).on('fileuploadprocessalways', function (e, data) {
|
||||
gnu._processalways(e, data);
|
||||
}).on('fileuploaddone', function (e, data) {
|
||||
|
||||
gnu._done( e, data );
|
||||
gnu._done(e, data);
|
||||
|
||||
}).on('fileuploadfail', function (e, data) {
|
||||
$.each(data.files, function (index, file) {
|
||||
@ -247,85 +249,84 @@ jQuery(function ($) {
|
||||
|
||||
gnu.init();
|
||||
|
||||
var listeners = {
|
||||
data : {},
|
||||
log : false,
|
||||
swfuploadLoaded: function(event){
|
||||
if(this.log) $('.log', this).append('<li>Loaded</li>');
|
||||
},
|
||||
fileQueued: function(event, file){
|
||||
if(this.log) $('.log', this).append('<li>File queued - '+file.name+'</li>');
|
||||
// start the upload once it is queued
|
||||
// but only if this queue is not disabled
|
||||
if (!$('input[name=disabled]:checked', this).length) {
|
||||
$(this).swfupload('startUpload');
|
||||
}
|
||||
},
|
||||
fileQueueError: function(event, file, errorCode, message){
|
||||
switch (errorCode)
|
||||
{
|
||||
case -100 :
|
||||
alert("파일을 "+message+"개 이하로 선택해주세요.");
|
||||
var listeners = {
|
||||
data: {},
|
||||
log: false,
|
||||
swfuploadLoaded: function (event) {
|
||||
if (this.log) $('.log', this).append('<li>Loaded</li>');
|
||||
},
|
||||
fileQueued: function (event, file) {
|
||||
if (this.log) $('.log', this).append('<li>File queued - ' + file.name + '</li>');
|
||||
// start the upload once it is queued
|
||||
// but only if this queue is not disabled
|
||||
if (!$('input[name=disabled]:checked', this).length) {
|
||||
$(this).swfupload('startUpload');
|
||||
}
|
||||
},
|
||||
fileQueueError: function (event, file, errorCode, message) {
|
||||
switch (errorCode) {
|
||||
case -100:
|
||||
alert("파일을 " + message + "개 이하로 선택해주세요.");
|
||||
break;
|
||||
}
|
||||
if(this.log) $('.log', this).append('<li>File queue error - '+message+'</li>');
|
||||
},
|
||||
fileDialogStart: function(event){
|
||||
if(this.log) $('.log', this).append('<li>File dialog start</li>');
|
||||
},
|
||||
fileDialogComplete: function(event, numFilesSelected, numFilesQueued){
|
||||
if(this.log) $('.log', this).append('<li>File dialog complete</li>');
|
||||
},
|
||||
uploadStart: function(event, file){
|
||||
if (this.log) $('.log', this).append('<li>File queue error - ' + message + '</li>');
|
||||
},
|
||||
fileDialogStart: function (event) {
|
||||
if (this.log) $('.log', this).append('<li>File dialog start</li>');
|
||||
},
|
||||
fileDialogComplete: function (event, numFilesSelected, numFilesQueued) {
|
||||
if (this.log) $('.log', this).append('<li>File dialog complete</li>');
|
||||
},
|
||||
uploadStart: function (event, file) {
|
||||
listeners.data.files = $.makeArray(file);
|
||||
gnu._add( event, listeners.data, 'swfupload' );
|
||||
if(this.log) $('.log', this).append('<li>Upload start - '+file.name+'</li>');
|
||||
},
|
||||
uploadProgress: function(event, file, bytesLoaded){
|
||||
if(this.log) $('.log', this).append('<li>Upload progress - '+bytesLoaded+'</li>');
|
||||
},
|
||||
uploadSuccess: function(event, file, serverData){
|
||||
listeners.data.result = jQuery.parseJSON( serverData );
|
||||
gnu._done( event, listeners.data );
|
||||
if(this.log) $('.log', this).append('<li>Upload success - '+file.name+'</li>');
|
||||
gnu._add(event, listeners.data, 'swfupload');
|
||||
if (this.log) $('.log', this).append('<li>Upload start - ' + file.name + '</li>');
|
||||
},
|
||||
uploadProgress: function (event, file, bytesLoaded) {
|
||||
if (this.log) $('.log', this).append('<li>Upload progress - ' + bytesLoaded + '</li>');
|
||||
},
|
||||
uploadSuccess: function (event, file, serverData) {
|
||||
listeners.data.result = jQuery.parseJSON(serverData);
|
||||
gnu._done(event, listeners.data);
|
||||
if (this.log) $('.log', this).append('<li>Upload success - ' + file.name + '</li>');
|
||||
|
||||
},
|
||||
uploadComplete: function(event, file){
|
||||
if(this.log) $('.log', this).append('<li>Upload complete - '+file.name+'</li>');
|
||||
// upload has completed, lets try the next one in the queue
|
||||
// but only if this queue is not disabled
|
||||
if (!$('input[name=disabled]:checked', this).length) {
|
||||
$(this).swfupload('startUpload');
|
||||
}
|
||||
},
|
||||
uploadError: function(event, file, errorCode, message){
|
||||
if(this.log) $('.log', this).append('<li>Upload error - '+message+'</li>');
|
||||
}
|
||||
};
|
||||
},
|
||||
uploadComplete: function (event, file) {
|
||||
if (this.log) $('.log', this).append('<li>Upload complete - ' + file.name + '</li>');
|
||||
// upload has completed, lets try the next one in the queue
|
||||
// but only if this queue is not disabled
|
||||
if (!$('input[name=disabled]:checked', this).length) {
|
||||
$(this).swfupload('startUpload');
|
||||
}
|
||||
},
|
||||
uploadError: function (event, file, errorCode, message) {
|
||||
if (this.log) $('.log', this).append('<li>Upload error - ' + message + '</li>');
|
||||
}
|
||||
};
|
||||
|
||||
$(gnu.container_el).bindAll(listeners);
|
||||
$(gnu.container_el).bindAll(listeners);
|
||||
/* listeners이벤트 */
|
||||
|
||||
$(gnu.dreg_area).bind('drop dragover', function (e) {
|
||||
e.preventDefault();
|
||||
if( !gnu.file_api_support && e.type == 'drop' ) alert("브라우저가 드래그 앤 드랍을 지원하지 않습니다.");
|
||||
if (!gnu.file_api_support && e.type == 'drop') alert("브라우저가 드래그 앤 드랍을 지원하지 않습니다.");
|
||||
});
|
||||
$("#all_remove_btn").bind("click", function(e){
|
||||
$("#all_remove_btn").bind("click", function (e) {
|
||||
e.preventDefault();
|
||||
if( $(gnu.dreg_area_list).children().length ){
|
||||
if (confirm("추가한 이미지가 있습니다.정말 삭제 하시겠습니까?")){
|
||||
$(gnu.dreg_area_list).find(".delete_img").each( function(i){
|
||||
if ($(gnu.dreg_area_list).children().length) {
|
||||
if (confirm("추가한 이미지가 있습니다.정말 삭제 하시겠습니까?")) {
|
||||
$(gnu.dreg_area_list).find(".delete_img").each(function (i) {
|
||||
$(this).trigger("click");
|
||||
});
|
||||
$(gnu.dreg_area_list).sortable('refresh');
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#img_upload_submit").bind("click", function(e){
|
||||
$("#img_upload_submit").bind("click", function (e) {
|
||||
e.preventDefault();
|
||||
var aResult = [], j = 0;
|
||||
$(gnu.dreg_area_list).find(".delete_img").each( function(i, f){
|
||||
if( !$(this).attr("data-url") ) return true;
|
||||
var aResult = [], j = 0;
|
||||
$(gnu.dreg_area_list).find(".delete_img").each(function (i, f) {
|
||||
if (!$(this).attr("data-url")) return true;
|
||||
aResult[j] = [];
|
||||
aResult[j]['bNewLine'] = 'true';
|
||||
aResult[j]['sAlign'] = '';
|
||||
@ -333,13 +334,13 @@ jQuery(function ($) {
|
||||
aResult[j]['sFileURL'] = $(this).attr("data-url");
|
||||
j++;
|
||||
});
|
||||
if( aResult.length ){
|
||||
if (aResult.length) {
|
||||
gnu.setPhotoToEditor(aResult);
|
||||
aResult = null;
|
||||
}
|
||||
window.close();
|
||||
});
|
||||
$("#close_w_btn").bind("click", function(e){
|
||||
$("#close_w_btn").bind("click", function (e) {
|
||||
e.preventDefault();
|
||||
window.close();
|
||||
});
|
||||
|
||||
@ -1283,8 +1283,8 @@
|
||||
file_size_limit : "10 MB",
|
||||
file_upload_limit: 0,
|
||||
file_queue_limit : this.options.limit_filesLength,
|
||||
file_types : "*.jpeg; *.bmp; *.png; *.jpg; *.gif",
|
||||
file_types_description : "Image Files (JPG, JPEG, PNG, BMP, GIF)",
|
||||
file_types : "*.jpeg; *.bmp; *.png; *.jpg; *.gif; *.webp",
|
||||
file_types_description : "Image Files (JPG, JPEG, PNG, BMP, GIF, WEBP)",
|
||||
flash_url : "./swfupload/swfupload.swf",
|
||||
button_placeholder : this.options.fileInput[0],
|
||||
button_width : "100%",
|
||||
|
||||
@ -26,6 +26,7 @@ class UploadHandler
|
||||
"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")
|
||||
);
|
||||
|
||||
@ -93,10 +94,10 @@ class UploadHandler
|
||||
// is enabled, set to 0 to disable chunked reading of files:
|
||||
'readfile_chunk_size' => 10 * 1024 * 1024, // 10 MiB
|
||||
// Defines which files can be displayed inline when downloaded:
|
||||
'inline_file_types' => '/\.(gif|jpe?g|bmp|png)$/i',
|
||||
'inline_file_types' => '/\.(gif|jpe?g|bmp|png|webp)$/i',
|
||||
// Defines which files (based on their names) are accepted for upload:
|
||||
//'accept_file_types' => '/.+$/i',
|
||||
'accept_file_types' => '/\.(gif|jpe?g|bmp|png)$/i',
|
||||
'accept_file_types' => '/\.(gif|jpe?g|bmp|png|webp)$/i',
|
||||
// The php.ini settings upload_max_filesize and post_max_size
|
||||
// take precedence over the following max_file_size setting:
|
||||
'max_file_size' => null,
|
||||
@ -104,7 +105,7 @@ class UploadHandler
|
||||
// The maximum number of files for the upload directory:
|
||||
'max_number_of_files' => null,
|
||||
// Defines which files are handled as image files:
|
||||
'image_file_types' => '/\.(gif|jpe?g|bmp|png)$/i',
|
||||
'image_file_types' => '/\.(gif|jpe?g|bmp|png|webp)$/i',
|
||||
'is_resize' => (defined('SMARTEDITOR_UPLOAD_RESIZE') && SMARTEDITOR_UPLOAD_RESIZE) ? true : false,
|
||||
'resize_max_width' => (defined('SMARTEDITOR_UPLOAD_MAX_WIDTH') && SMARTEDITOR_UPLOAD_MAX_WIDTH) ? SMARTEDITOR_UPLOAD_MAX_WIDTH : 800,
|
||||
'resize_max_height' => (defined('SMARTEDITOR_UPLOAD_MAX_HEIGHT') && SMARTEDITOR_UPLOAD_MAX_HEIGHT) ? SMARTEDITOR_UPLOAD_MAX_HEIGHT : 800,
|
||||
@ -498,7 +499,7 @@ class UploadHandler
|
||||
}
|
||||
// Add missing file extension for known image types:
|
||||
if (strpos($name, '.') === false &&
|
||||
preg_match('/^image\/(gif|jpe?g|png)/', $type, $matches)) {
|
||||
preg_match('/^image\/(gif|jpe?g|png|webp)/', $type, $matches)) {
|
||||
$name .= '.'.$matches[1];
|
||||
}
|
||||
if (function_exists('exif_imagetype') && $file_path) {
|
||||
@ -512,6 +513,9 @@ class UploadHandler
|
||||
case IMAGETYPE_GIF:
|
||||
$extensions = array('gif');
|
||||
break;
|
||||
case IMAGETYPE_WEBP:
|
||||
$extensions = array('webp');
|
||||
break;
|
||||
}
|
||||
// Adjust incorrect image file extensions:
|
||||
if (!empty($extensions)) {
|
||||
@ -688,7 +692,7 @@ class UploadHandler
|
||||
$src_func = 'imagecreatefromjpeg';
|
||||
$write_func = 'imagejpeg';
|
||||
$image_quality = isset($options['jpeg_quality']) ?
|
||||
$options['jpeg_quality'] : 75;
|
||||
$options['jpeg_quality'] : 75;
|
||||
break;
|
||||
case 'gif':
|
||||
$src_func = 'imagecreatefromgif';
|
||||
@ -699,7 +703,12 @@ class UploadHandler
|
||||
$src_func = 'imagecreatefrompng';
|
||||
$write_func = 'imagepng';
|
||||
$image_quality = isset($options['png_quality']) ?
|
||||
$options['png_quality'] : 9;
|
||||
$options['png_quality'] : 9;
|
||||
break;
|
||||
case 'webp':
|
||||
$src_func = 'imagecreatefromwebp';
|
||||
$write_func = 'imagewebp';
|
||||
$image_quality = null;
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
@ -1083,11 +1092,16 @@ class UploadHandler
|
||||
//throw new Exception("Invalid image MIME type");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
$image_from_file = self::$MIME_TYPES_PROCESSORS[$mime_type][0];
|
||||
$image_to_file = self::$MIME_TYPES_PROCESSORS[$mime_type][1];
|
||||
|
||||
// webp 의 경우 gd-webp cannot allocate temporary buffer 오류가 발생하여 webp 이미지가 업로드 되지 않을 수 있음
|
||||
// $reprocessed_image = imagecreatefromwebp($file_path); 이 코드로 웹서버의 error_log 에서 확인해 볼 수 있음
|
||||
// https://stackoverflow.com/questions/61394477/php-e-error-gd-webp-cannot-allocate-temporary-buffer
|
||||
// 움직이는 webp 이미지나 큰사이즈의 webp 이미지에 대한 해결 방안은 아직 없는 것 같다
|
||||
$reprocessed_image = @$image_from_file($file_path);
|
||||
// error_log("\$image_from_file = '$image_from_file', \$image_to_file = '$image_to_file', \$reprocessed_image = '$reprocessed_image', \$file_path ='$file_path' ");
|
||||
|
||||
if (!$reprocessed_image) {
|
||||
//throw new Exception("Unable to create reprocessed image from file");
|
||||
@ -1288,6 +1302,8 @@ class UploadHandler
|
||||
return 'image/png';
|
||||
case 'gif':
|
||||
return 'image/gif';
|
||||
case 'webp':
|
||||
return 'image/webp';
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
|
||||
@ -40,6 +40,8 @@ if( isset($_GET['_nonce']) && ft_nonce_is_valid( $_GET['_nonce'] , 'smarteditor'
|
||||
}
|
||||
|
||||
if( $is_editor_upload ) {
|
||||
|
||||
run_event('smarteditor_photo_upload', $data_dir, $data_url);
|
||||
|
||||
require('UploadHandler.php');
|
||||
$options = array(
|
||||
|
||||
@ -287,7 +287,7 @@ function preview(thumb) {
|
||||
var thumb = file.bf_file;
|
||||
}
|
||||
|
||||
var pattern = /\.(jpg|png|gif)$/i;
|
||||
var pattern = /\.(jpg|png|gif|webp)$/i;
|
||||
if (pattern.test(thumb)) {
|
||||
var thumb_kind = "img";
|
||||
} else {
|
||||
@ -321,7 +321,7 @@ function file_to_editor() {
|
||||
var file = get_file_info(files_list.options[i].value);
|
||||
var path = board_file_path + '/' + file.bf_file;
|
||||
|
||||
var pattern = /\.(jpg|png|gif)$/i;
|
||||
var pattern = /\.(jpg|png|gif|webp)$/i;
|
||||
if (pattern.test(file.bf_file)) {
|
||||
if (wr_id) {
|
||||
html = "{이미지:" + file.bf_no + "}";
|
||||
|
||||
3
plugin/inicert/_common.php
Normal file
3
plugin/inicert/_common.php
Normal file
@ -0,0 +1,3 @@
|
||||
<?php
|
||||
define('G5_CERT_IN_PROG', true);
|
||||
include_once('../../common.php');
|
||||
109
plugin/inicert/ini_find_result.php
Normal file
109
plugin/inicert/ini_find_result.php
Normal file
@ -0,0 +1,109 @@
|
||||
<?php
|
||||
include_once('./_common.php');
|
||||
|
||||
$txId = $_POST['txId'];
|
||||
$mid = substr($txId, 6, 10);
|
||||
|
||||
if ($_POST["resultCode"] === "0000") {
|
||||
|
||||
$data = array(
|
||||
'mid' => $mid,
|
||||
'txId' => $txId
|
||||
);
|
||||
|
||||
$post_data = json_encode($data);
|
||||
|
||||
// curl 통신 시작
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, $_POST["authRequestUrl"]);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
|
||||
curl_setopt($ch, CURLOPT_POST, 1);
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: application/json', 'Content-Type: application/json'));
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
||||
|
||||
$response = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
$res_data = json_decode($response, true);
|
||||
|
||||
if($res_data['resultCode'] === "0000") {
|
||||
|
||||
$cert_type = 'simple'; // 인증타입
|
||||
$cert_no = $res_data['txId']; // 이니시스 트랜잭션 ID
|
||||
$phone_no = $res_data['userPhone']; // 전화번호
|
||||
$user_name = $res_data['userName']; // 이름
|
||||
$birth_day = $res_data['userBirthday']; // 생년월일
|
||||
$ci = $res_data['userCi']; // CI
|
||||
|
||||
@insert_cert_history($member['mb_id'], 'inicis', $cert_type); // 인증성공 시 내역 기록
|
||||
|
||||
if(!$phone_no)
|
||||
alert_close("정상적인 인증이 아닙니다. 올바른 방법으로 이용해 주세요.");
|
||||
|
||||
$md5_ci = md5($ci . $ci);
|
||||
$phone_no = hyphen_hp_number($phone_no);
|
||||
$mb_dupinfo = $md5_ci;
|
||||
|
||||
$row = sql_fetch("select mb_id from {$g5['member_table']} where mb_id <> '{$member['mb_id']}' and mb_dupinfo = '{$mb_dupinfo}'"); // ci데이터로 찾음
|
||||
if(empty($row['mb_id'])) { // ci로 등록된 계정이 없다면
|
||||
alert_close("인증하신 정보로 가입된 회원정보가 없습니다.");
|
||||
exit;
|
||||
}
|
||||
|
||||
$md5_cert_no = md5($cert_no);
|
||||
$hash_data = md5($user_name.$cert_type.$birth_day.$phone_no.$md5_cert_no);
|
||||
|
||||
// 성인인증결과
|
||||
$adult_day = date("Ymd", strtotime("-19 years", G5_SERVER_TIME));
|
||||
$adult = ((int)$birth_day <= (int)$adult_day) ? 1 : 0;
|
||||
|
||||
set_session("ss_cert_type", $cert_type);
|
||||
set_session("ss_cert_no", $md5_cert_no);
|
||||
set_session("ss_cert_hash", $hash_data);
|
||||
set_session("ss_cert_adult", $adult);
|
||||
set_session("ss_cert_birth", $birth_day);
|
||||
//set_session("ss_cert_sex", ($sex_code=="01"?"M":"F")); // 이니시스 간편인증은 성별정보 리턴 없음
|
||||
set_session('ss_cert_dupinfo', $mb_dupinfo);
|
||||
set_session('ss_cert_mb_id', $row['mb_id']);
|
||||
} else {
|
||||
// 인증실패 curl의 인증실패 체크
|
||||
alert_close('코드 : '.$res_data['resultCode'].' '.urldecode($res_data['resultMsg']));
|
||||
exit;
|
||||
}
|
||||
} else { // resultCode===0000 아닐경우 아래 인증 실패를 출력함
|
||||
// 인증실패
|
||||
alert_close('코드 : '.$_POST['resultCode'].' '.urldecode($_POST['resultMsg']));
|
||||
exit;
|
||||
}
|
||||
|
||||
$g5['title'] = 'KG이니시스 간편인증 결과';
|
||||
include_once(G5_PATH.'/head.sub.php');
|
||||
?>
|
||||
<form name="mbFindForm" method="POST">
|
||||
<input type="hidden" name="mb_id" value="<?php echo $row["mb_id"]; ?>">
|
||||
</form>
|
||||
<script>
|
||||
jQuery(function($) {
|
||||
|
||||
var $opener = window.opener;
|
||||
var is_mobile = false;
|
||||
$opener.name="parentPage";
|
||||
|
||||
if (typeof g5_is_mobile != "undefined" && g5_is_mobile ) {
|
||||
$opener = window.parent;
|
||||
is_mobile = true;
|
||||
} else {
|
||||
$opener = window.opener;
|
||||
}
|
||||
|
||||
document.mbFindForm.target = "parentPage";
|
||||
document.mbFindForm.action = "<?php echo G5_BBS_URL.'/password_reset.php'?>";
|
||||
document.mbFindForm.submit();
|
||||
|
||||
alert("본인인증이 완료되었습니다.");
|
||||
window.close();
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
include_once(G5_PATH.'/tail.sub.php');
|
||||
83
plugin/inicert/ini_request.php
Normal file
83
plugin/inicert/ini_request.php
Normal file
@ -0,0 +1,83 @@
|
||||
<?php
|
||||
include_once('./_common.php');
|
||||
|
||||
$sql = "select MAX(cr_id) as max_cr_id from {$g5['cert_history_table']} limit 1";
|
||||
$res = sql_fetch($sql);
|
||||
$max_cr_id = $res['max_cr_id'];
|
||||
if(empty($max_cr_id)) $max_cr_id = 0;
|
||||
|
||||
if($config['cf_cert_use'] == 2) { // 실서비스 일때
|
||||
$mid = 'SRA'.$config['cf_cert_kg_mid']; // 부여받은 MID(상점ID) 입력(영업담당자 문의)
|
||||
$apiKey = $config['cf_cert_kg_cd']; // 부여받은 MID 에 대한 apiKey
|
||||
$mTxId ='SIR_'.$max_cr_id;
|
||||
certify_count_check($member['mb_id'], 'simple'); // 금일 인증시도 횟수 체크
|
||||
} else { // 테스트 일때
|
||||
$mid = "INIiasTest";
|
||||
$apiKey = "TGdxb2l3enJDWFRTbTgvREU3MGYwUT09";
|
||||
$mTxId ='test_'.$max_cr_id;
|
||||
}
|
||||
$reqSvcCd ='01';
|
||||
|
||||
// 등록가맹점 확인
|
||||
$plainText1 = hash("sha256",(string)$mid.(string)$mTxId.(string)$apiKey);
|
||||
$authHash = $plainText1;
|
||||
|
||||
//$flgFixedUser = (!empty($member['mb_id']) && !empty($member['mb_name']) && !empty($member['mb_hp']) && !empty($member['mb_birth']))? 'Y' : 'N'; // 특정사용자 고정시 : Y 세팅및 아래 해시 데이터 생성
|
||||
$flgFixedUser = 'N'; // 특정사용자 구분하지 않기로 하여 수정
|
||||
|
||||
// php8버전 값체크 경고 때문에 필수값이 아닌 값이 없을수 있는 선택값들은 초기화해주어야함
|
||||
$userName = '';
|
||||
$userPhone = '';
|
||||
$userBirth = '';
|
||||
$userHash = '';
|
||||
|
||||
if($flgFixedUser == 'Y') {
|
||||
$userName = $member['mb_name']; // 사용자 이름
|
||||
$userPhone = preg_replace("/-/","" , $member['mb_hp']); // 사용자 전화번호 하이픈만 제거
|
||||
$userBirth = $member['mb_birth']; // 사용자 생년월일
|
||||
|
||||
$plainText2 = hash("sha256",(string)$userName.(string)$mid.(string)$userPhone.(string)$mTxId.(string)$userBirth.(string)$reqSvcCd);
|
||||
$userHash = $plainText2;
|
||||
}
|
||||
|
||||
switch($_GET['pageType']) {
|
||||
case "register":
|
||||
$resultPage = "/ini_result.php";
|
||||
break;
|
||||
case "find":
|
||||
$resultPage = "/ini_find_result.php";
|
||||
break;
|
||||
default:
|
||||
alert_close('잘못된 접근입니다.');
|
||||
}
|
||||
|
||||
$resultUrl = G5_INICERT_URL . $resultPage;
|
||||
$g5['title'] = 'KG이니시스 간편인증';
|
||||
include_once(G5_PATH.'/head.sub.php');
|
||||
?>
|
||||
<form name="saForm">
|
||||
<input type="hidden" name="mid" value="<?php echo $mid ?>"> <!-- 필수 값 -->
|
||||
<input type="hidden" name="reqSvcCd" value="<?php echo $reqSvcCd ?>"> <!-- 필수 값 -->
|
||||
<input type="hidden" name="mTxId" value="<?php echo $mTxId ?>"> <!-- 필수 값 -->
|
||||
|
||||
<input type="hidden" name="authHash" value="<?php echo $authHash ?>"> <!-- 필수 값 -->
|
||||
<input type="hidden" name="flgFixedUser" value="<?php echo $flgFixedUser ?>"> <!-- 필수 값 Y/N 특정사용자 인증 요청 여부 -->
|
||||
<input type="hidden" name="userName" value="<?php echo $userName ?>">
|
||||
<input type="hidden" name="userPhone" value="<?php echo $userPhone ?>">
|
||||
<input type="hidden" name="userBirth" value="<?php echo $userBirth ?>">
|
||||
<input type="hidden" name="userHash" value="<?php echo $userHash ?>">
|
||||
<input type="hidden" name="mbId" value="<?php echo $member['mb_id'] ?>">
|
||||
<input type="hidden" name="directAgency" value="<?php echo $_GET['directAgency']; ?>">
|
||||
|
||||
<input type="hidden" name="successUrl" value="<?php echo $resultUrl; ?>"> <!-- 필수 값 -->
|
||||
<input type="hidden" name="failUrl" value="<?php echo $resultUrl; ?>"> <!-- 필수 값 -->
|
||||
<!-- successUrl / failUrl 은 분리 하여 이용가능!-->
|
||||
</form>
|
||||
<script>
|
||||
document.saForm.setAttribute("target", "_self");
|
||||
document.saForm.setAttribute("post", "post");
|
||||
document.saForm.setAttribute("action", "https://sa.inicis.com/auth");
|
||||
document.saForm.submit();
|
||||
</script>
|
||||
<?php
|
||||
include_once(G5_PATH.'/tail.sub.php');
|
||||
110
plugin/inicert/ini_result.php
Normal file
110
plugin/inicert/ini_result.php
Normal file
@ -0,0 +1,110 @@
|
||||
<?php
|
||||
include_once('./_common.php');
|
||||
|
||||
$txId = $_POST['txId'];
|
||||
$mid = substr($txId, 6, 10);
|
||||
|
||||
if ($_POST["resultCode"] === "0000") {
|
||||
|
||||
$data = array(
|
||||
'mid' => $mid,
|
||||
'txId' => $txId
|
||||
);
|
||||
|
||||
$post_data = json_encode($data);
|
||||
|
||||
// curl 통신 시작
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, $_POST["authRequestUrl"]);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
|
||||
curl_setopt($ch, CURLOPT_POST, 1);
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: application/json', 'Content-Type: application/json'));
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
||||
|
||||
$response = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
$res_data = json_decode($response, true);
|
||||
// -------------------- 결과 수신 -------------------------------------------
|
||||
// echo '<결과내역>'." '{$mid}' <br/><br/>";
|
||||
// echo $response;
|
||||
|
||||
if($res_data['resultCode'] === "0000") {
|
||||
$cert_type = 'simple'; // 인증타입
|
||||
$cert_no = $res_data['txId']; // 이니시스 트랜잭션 ID
|
||||
$phone_no = $res_data['userPhone']; // 전화번호
|
||||
$user_name = $res_data['userName']; // 이름
|
||||
$birth_day = $res_data['userBirthday']; // 생년월일
|
||||
$ci = $res_data['userCi']; // CI
|
||||
|
||||
@insert_cert_history($member['mb_id'], 'inicis', $cert_type); // 인증성공 시 내역 기록
|
||||
|
||||
if(!$phone_no)
|
||||
alert_close("정상적인 인증이 아닙니다. 올바른 방법으로 이용해 주세요.");
|
||||
|
||||
$mb_dupinfo = md5($ci . $ci);
|
||||
$phone_no = hyphen_hp_number($phone_no);
|
||||
|
||||
// 명의 변경 체크
|
||||
if (!empty($member['mb_certify']) && !empty($member['mb_dupinfo']) && strlen($member['mb_dupinfo']) != 64) { // 이미 인증된 계정중에 dupinfo가 di(64 length)가 아닐때
|
||||
if($member['mb_dupinfo'] != $mb_dupinfo) alert_close("해당 계정은 이미 다른명의로 본인인증 되어있는 계정입니다.");
|
||||
}
|
||||
|
||||
$sql = " select mb_id from {$g5['member_table']} where mb_id <> '{$member['mb_id']}' and mb_dupinfo = '{$mb_dupinfo}' ";
|
||||
$row = sql_fetch($sql);
|
||||
if (!empty($row['mb_id'])) {
|
||||
alert_close("입력하신 본인확인 정보로 이미 가입된 내역이 존재합니다.\\n회원아이디 : ".$row['mb_id']);
|
||||
}
|
||||
|
||||
// hash 데이터
|
||||
|
||||
$md5_cert_no = md5($cert_no);
|
||||
$hash_data = md5($user_name.$cert_type.$birth_day.$phone_no.$md5_cert_no);
|
||||
|
||||
// 성인인증결과
|
||||
$adult_day = date("Ymd", strtotime("-19 years", G5_SERVER_TIME));
|
||||
$adult = ((int)$birth_day <= (int)$adult_day) ? 1 : 0;
|
||||
|
||||
set_session("ss_cert_type", $cert_type);
|
||||
set_session("ss_cert_no", $md5_cert_no);
|
||||
set_session("ss_cert_hash", $hash_data);
|
||||
set_session("ss_cert_adult", $adult);
|
||||
set_session("ss_cert_birth", $birth_day);
|
||||
//set_session("ss_cert_sex", ($sex_code=="01"?"M":"F")); // 이니시스 간편인증은 성별정보 리턴 없음
|
||||
set_session('ss_cert_dupinfo', $mb_dupinfo);
|
||||
|
||||
} else {
|
||||
// 인증실패 curl의 인증실패 체크
|
||||
alert_close('코드 : '.$res_data['resultCode'].' '.urldecode($res_data['resultMsg']));
|
||||
exit;
|
||||
}
|
||||
} else { // resultCode===0000 아닐경우 아래 인증 실패를 출력함
|
||||
// 인증실패
|
||||
alert_close('코드 : '.$_POST['resultCode'].' '.urldecode($_POST['resultMsg']));
|
||||
exit;
|
||||
}
|
||||
|
||||
$g5['title'] = 'KG이니시스 간편인증 결과';
|
||||
include_once(G5_PATH.'/head.sub.php');
|
||||
?>
|
||||
<script>
|
||||
jQuery(function($) {
|
||||
var $opener = window.opener;
|
||||
|
||||
// 인증정보
|
||||
$opener.$("input[name=cert_type]").val("<?php echo $cert_type; ?>");
|
||||
$opener.$("input[name=mb_name]").val("<?php echo $user_name; ?>").attr("readonly", true);
|
||||
$opener.$("input[name=mb_hp]").val("<?php echo $phone_no; ?>").attr("readonly", true);
|
||||
$opener.$("input[name=cert_no]").val("<?php echo $md5_cert_no; ?>");
|
||||
|
||||
alert("본인인증이 완료되었습니다.");
|
||||
|
||||
if($opener.$("form[name=fcertrefreshform]") != undefined){
|
||||
$opener.$("form[name=fcertrefreshform]").submit();
|
||||
}
|
||||
window.close();
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
include_once(G5_PATH.'/tail.sub.php');
|
||||
@ -16,7 +16,7 @@ function make_mp3()
|
||||
$mp3s[] = $file;
|
||||
}
|
||||
|
||||
$ip = sprintf("%u", ip2long($_SERVER['REMOTE_ADDR']));
|
||||
$ip = md5(sha1($_SERVER['REMOTE_ADDR']));
|
||||
$mp3_file = 'cache/kcaptcha-'.$ip.'_'.G5_SERVER_TIME.'.mp3';
|
||||
|
||||
$contents = '';
|
||||
|
||||
@ -1,2 +1,3 @@
|
||||
<?php
|
||||
define('G5_CERT_IN_PROG', true);
|
||||
include_once('../../common.php');
|
||||
237
plugin/kcpcert/find_kcpcert_result.php
Normal file
237
plugin/kcpcert/find_kcpcert_result.php
Normal file
@ -0,0 +1,237 @@
|
||||
<?php
|
||||
include_once('./_common.php');
|
||||
include_once(G5_KCPCERT_PATH.'/kcpcert_config.php');
|
||||
|
||||
$site_cd = "";
|
||||
$ordr_idxx = "";
|
||||
|
||||
$cert_no = "";
|
||||
$cert_enc_use = "";
|
||||
$enc_info = "";
|
||||
$enc_data = "";
|
||||
$req_tx = "";
|
||||
|
||||
$enc_cert_data = "";
|
||||
$cert_info = "";
|
||||
|
||||
$tran_cd = "";
|
||||
$res_cd = "";
|
||||
$res_msg = "";
|
||||
|
||||
$dn_hash = "";
|
||||
|
||||
/*------------------------------------------------------------------------*/
|
||||
/* :: 전체 파라미터 남기기 */
|
||||
/*------------------------------------------------------------------------*/
|
||||
|
||||
// request 로 넘어온 값 처리
|
||||
$key = array_keys($_POST);
|
||||
$sbParam ="";
|
||||
|
||||
for($i=0; $i<count($key); $i++)
|
||||
{
|
||||
$nmParam = $key[$i];
|
||||
$valParam = $_POST[$nmParam];
|
||||
|
||||
if ( $nmParam == "site_cd" )
|
||||
{
|
||||
$site_cd = f_get_parm_str ( $valParam );
|
||||
}
|
||||
|
||||
if ( $nmParam == "ordr_idxx" )
|
||||
{
|
||||
$ordr_idxx = f_get_parm_str ( $valParam );
|
||||
}
|
||||
|
||||
if ( $nmParam == "res_cd" )
|
||||
{
|
||||
$res_cd = f_get_parm_str ( $valParam );
|
||||
}
|
||||
|
||||
if ( $nmParam == "cert_enc_use" )
|
||||
{
|
||||
$cert_enc_use = f_get_parm_str ( $valParam );
|
||||
}
|
||||
|
||||
if ( $nmParam == "req_tx" )
|
||||
{
|
||||
$req_tx = f_get_parm_str ( $valParam );
|
||||
}
|
||||
|
||||
if ( $nmParam == "cert_no" )
|
||||
{
|
||||
$cert_no = f_get_parm_str ( $valParam );
|
||||
}
|
||||
|
||||
if ( $nmParam == "enc_cert_data" )
|
||||
{
|
||||
$enc_cert_data = f_get_parm_str ( $valParam );
|
||||
}
|
||||
|
||||
if ( $nmParam == "dn_hash" )
|
||||
{
|
||||
$dn_hash = f_get_parm_str ( $valParam );
|
||||
}
|
||||
|
||||
// 부모창으로 넘기는 form 데이터 생성 필드
|
||||
$sbParam .= "<input type='hidden' name='" . $nmParam . "' value='" . f_get_parm_str( $valParam ) . "'/>";
|
||||
}
|
||||
|
||||
$ct_cert = new C_CT_CLI;
|
||||
$ct_cert->mf_clear();
|
||||
|
||||
|
||||
$g5['title'] = '휴대폰인증 결과';
|
||||
include_once(G5_PATH.'/head.sub.php');
|
||||
|
||||
// 결과 처리
|
||||
|
||||
if( $cert_enc_use == "Y" )
|
||||
{
|
||||
// 인증내역기록
|
||||
@insert_cert_history($member['mb_id'], 'kcp', 'hp');
|
||||
|
||||
if( $res_cd == "0000" )
|
||||
{
|
||||
// dn_hash 검증
|
||||
// KCP 가 리턴해 드리는 dn_hash 와 사이트 코드, 주문번호 , 인증번호를 검증하여
|
||||
// 해당 데이터의 위변조를 방지합니다
|
||||
$veri_str = $site_cd.$ordr_idxx.$cert_no; // 사이트 코드 + 주문번호 + 인증거래번호
|
||||
|
||||
if ( $ct_cert->check_valid_hash ( $home_dir , $dn_hash , $veri_str ) != "1" )
|
||||
{
|
||||
if(strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {
|
||||
// 검증 실패시 처리 영역
|
||||
if(PHP_INT_MAX == 2147483647) // 32-bit
|
||||
$bin_exe = '/bin/ct_cli';
|
||||
else
|
||||
$bin_exe = '/bin/ct_cli_x64';
|
||||
} else {
|
||||
$bin_exe = '/bin/ct_cli_exe.exe';
|
||||
}
|
||||
|
||||
echo "dn_hash 변조 위험있음 (".G5_KCPCERT_PATH.$bin_exe." 파일에 실행권한이 있는지 확인하세요.)";
|
||||
exit;
|
||||
// 오류 처리 ( dn_hash 변조 위험있음)
|
||||
}
|
||||
|
||||
// 가맹점 DB 처리 페이지 영역
|
||||
|
||||
// 인증데이터 복호화 함수
|
||||
// 해당 함수는 암호화된 enc_cert_data 를
|
||||
// site_cd 와 cert_no 를 가지고 복화화 하는 함수 입니다.
|
||||
// 정상적으로 복호화 된경우에만 인증데이터를 가져올수 있습니다.
|
||||
$opt = "1" ; // 복호화 인코딩 옵션 ( UTF - 8 사용시 "1" )
|
||||
$ct_cert->decrypt_enc_cert( $home_dir , $site_cd , $cert_no , $enc_cert_data , $opt );
|
||||
|
||||
$comm_id = $ct_cert->mf_get_key_value("comm_id" ); // 이동통신사 코드
|
||||
$phone_no = $ct_cert->mf_get_key_value("phone_no" ); // 전화번호
|
||||
$user_name = $ct_cert->mf_get_key_value("user_name" ); // 이름
|
||||
$birth_day = $ct_cert->mf_get_key_value("birth_day" ); // 생년월일
|
||||
$sex_code = $ct_cert->mf_get_key_value("sex_code" ); // 성별코드
|
||||
$local_code = $ct_cert->mf_get_key_value("local_code" ); // 내/외국인 정보
|
||||
$ci = $ct_cert->mf_get_key_value("ci" ); // CI
|
||||
$di = $ct_cert->mf_get_key_value("di" ); // DI 중복가입 확인값
|
||||
$ci_url = urldecode( $ct_cert->mf_get_key_value("ci" ) ); // CI
|
||||
$di_url = urldecode( $ct_cert->mf_get_key_value("di" ) ); // DI 중복가입 확인값
|
||||
$dec_res_cd = $ct_cert->mf_get_key_value("res_cd" ); // 암호화된 결과코드
|
||||
$dec_mes_msg = $ct_cert->mf_get_key_value("res_msg" ); // 암호화된 결과메시지
|
||||
|
||||
if(strtoupper(substr(PHP_OS, 0, 3)) === 'WIN' && function_exists('mb_detect_encoding') ){
|
||||
if( mb_detect_encoding($user_name, 'EUC-KR') === 'EUC-KR' ){
|
||||
$user_name = iconv_utf8($user_name);
|
||||
$dec_mes_msg = iconv_utf8($dec_mes_msg);
|
||||
}
|
||||
}
|
||||
|
||||
// 정상인증인지 체크
|
||||
if(!$phone_no)
|
||||
alert_close("정상적인 인증이 아닙니다. 올바른 방법으로 이용해 주세요.");
|
||||
|
||||
$phone_no = hyphen_hp_number($phone_no);
|
||||
$mb_dupinfo = $di;
|
||||
$md5_ci = md5($ci.$ci);
|
||||
|
||||
$row = sql_fetch("select mb_id from {$g5['member_table']} where mb_id <> '{$member['mb_id']}' and mb_dupinfo = '{$md5_ci}'"); // ci데이터로 찾음
|
||||
if (empty($row['mb_id'])) { // ci로 등록된 계정이 없다면
|
||||
$row = sql_fetch("select mb_id from {$g5['member_table']} where mb_id <> '{$member['mb_id']}' and mb_dupinfo = '{$mb_dupinfo}'"); // di데이터로 찾음
|
||||
if (empty($row['mb_id'])) { // di로 등록된 계정도 없다면
|
||||
alert_close("인증하신 정보로 가입된 회원정보가 없습니다.");
|
||||
exit;
|
||||
}
|
||||
}else{
|
||||
$mb_dupinfo = $md5_ci;
|
||||
}
|
||||
|
||||
$md5_cert_no = md5($cert_no);
|
||||
$hash_data = md5($user_name.$cert_type.$birth_day.$phone_no.$md5_cert_no);
|
||||
|
||||
// 성인인증결과
|
||||
$adult_day = date("Ymd", strtotime("-19 years", G5_SERVER_TIME));
|
||||
$adult = ((int)$birth_day <= (int)$adult_day) ? 1 : 0;
|
||||
|
||||
set_session("ss_cert_type", $cert_type);
|
||||
set_session("ss_cert_no", $md5_cert_no);
|
||||
set_session("ss_cert_hash", $hash_data);
|
||||
set_session("ss_cert_adult", $adult);
|
||||
set_session("ss_cert_birth", $birth_day);
|
||||
set_session("ss_cert_sex", ($sex_code=="01"?"M":"F")); // 이니시스 간편인증은 성별정보 리턴 없음
|
||||
set_session('ss_cert_dupinfo', $mb_dupinfo);
|
||||
set_session('ss_cert_mb_id', $row['mb_id']);
|
||||
}
|
||||
else if( $res_cd != "0000" )
|
||||
{
|
||||
// 인증실패
|
||||
alert_close('코드 : '.$_POST['res_cd'].' '.urldecode($_POST['res_msg']));
|
||||
exit;
|
||||
}
|
||||
}
|
||||
else if( $cert_enc_use != "Y" )
|
||||
{
|
||||
// 암호화 인증 안함
|
||||
if( G5_IS_MOBILE ){
|
||||
echo '<script>'.PHP_EOL;
|
||||
echo 'window.parent.$("#cert_info").css("display", "");'.PHP_EOL;
|
||||
echo 'window.parent.$("#kcp_cert" ).css("display", "none");'.PHP_EOL;
|
||||
echo '</script>'.PHP_EOL;
|
||||
} else {
|
||||
alert_close("휴대폰 본인확인을 취소 하셨습니다.");
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
$ct_cert->mf_clear();
|
||||
?>
|
||||
<form name="mbFindForm" method="POST">
|
||||
<input type="hidden" name="mb_id" value="<?php echo $row["mb_id"]; ?>">
|
||||
<?php echo $sbParam; ?>
|
||||
</form>
|
||||
<script>
|
||||
jQuery(function($) {
|
||||
|
||||
var $opener = window.opener;
|
||||
var is_mobile = false;
|
||||
$opener.name="parentPage";
|
||||
|
||||
if (typeof g5_is_mobile != "undefined" && g5_is_mobile ) {
|
||||
$opener = window.parent;
|
||||
is_mobile = true;
|
||||
} else {
|
||||
$opener = window.opener;
|
||||
}
|
||||
|
||||
// up_hash 검증
|
||||
if( document.mbFindForm.up_hash.value != $opener.$("input[name=veri_up_hash]").val() ) {
|
||||
alert("up_hash 변조 위험있음");
|
||||
}
|
||||
|
||||
document.mbFindForm.target = "parentPage";
|
||||
document.mbFindForm.action = "<?php echo G5_BBS_URL.'/password_reset.php'?>";
|
||||
document.mbFindForm.submit();
|
||||
|
||||
alert("본인인증이 완료되었습니다.");
|
||||
window.close();
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
include_once(G5_PATH.'/tail.sub.php');
|
||||
@ -6,6 +6,17 @@ certify_count_check($member['mb_id'], 'hp');
|
||||
|
||||
setlocale(LC_CTYPE, 'ko_KR.euc-kr');
|
||||
|
||||
switch($_GET['pageType']){ // 페이지 타입 체크
|
||||
case "register":
|
||||
$resultPage = "/kcpcert_result.php";
|
||||
break;
|
||||
case "find":
|
||||
$resultPage = "/find_kcpcert_result.php";
|
||||
break;
|
||||
default:
|
||||
alert_close('잘못된 접근입니다.');
|
||||
}
|
||||
|
||||
// kcp 휴대폰인증파일
|
||||
include_once(G5_KCPCERT_PATH.'/kcpcert_config.php');
|
||||
|
||||
@ -69,7 +80,7 @@ $ct_cert->mf_clear();
|
||||
<!-- 사이트코드 -->
|
||||
<input type="hidden" name="site_cd" value="<?php echo $site_cd; ?>" />
|
||||
<!-- Ret_URL : 인증결과 리턴 페이지 ( 가맹점 URL 로 설정해 주셔야 합니다. ) -->
|
||||
<input type="hidden" name="Ret_URL" value="<?php echo G5_KCPCERT_URL; ?>/kcpcert_result.php" />
|
||||
<input type="hidden" name="Ret_URL" value="<?php echo G5_KCPCERT_URL.$resultPage; ?>" />
|
||||
<!-- cert_otp_use 필수 ( 메뉴얼 참고)
|
||||
Y : 실명 확인 + OTP 점유 확인 , N : 실명 확인 only
|
||||
-->
|
||||
@ -108,7 +119,7 @@ function cert_page()
|
||||
|
||||
if ( ( frm.req_tx.value == "auth" || frm.req_tx.value == "otp_auth" ) )
|
||||
{
|
||||
frm.action="./kcpcert_result.php";
|
||||
frm.action=".<?php echo $resultPage; ?>";
|
||||
|
||||
// MOBILE
|
||||
if( ( navigator.userAgent.indexOf("Android") > - 1 || navigator.userAgent.indexOf("iPhone") > - 1 ) )
|
||||
|
||||
@ -149,18 +149,23 @@ if( $cert_enc_use == "Y" )
|
||||
alert_close("정상적인 인증이 아닙니다. 올바른 방법으로 이용해 주세요.");
|
||||
|
||||
$phone_no = hyphen_hp_number($phone_no);
|
||||
$mb_dupinfo = $di;
|
||||
$mb_dupinfo = md5($ci.$ci);
|
||||
|
||||
// 명의 변경 체크
|
||||
if (!empty($member['mb_certify']) && !empty($member['mb_dupinfo']) && strlen($member['mb_dupinfo']) != 64) { // 이미 인증된 계정중에 dupinfo가 di(64 length)가 아닐때
|
||||
if($member['mb_dupinfo'] != $mb_dupinfo) alert_close("해당 계정은 이미 다른명의로 본인인증 되어있는 계정입니다.");
|
||||
}
|
||||
|
||||
$sql = " select mb_id from {$g5['member_table']} where mb_id <> '{$member['mb_id']}' and mb_dupinfo = '{$mb_dupinfo}' ";
|
||||
$row = sql_fetch($sql);
|
||||
if ($row['mb_id']) {
|
||||
if (!empty($row['mb_id'])) {
|
||||
alert_close("입력하신 본인확인 정보로 가입된 내역이 존재합니다.\\n회원아이디 : ".$row['mb_id']);
|
||||
}
|
||||
|
||||
// hash 데이터
|
||||
$cert_type = 'hp';
|
||||
$md5_cert_no = md5($cert_no);
|
||||
$hash_data = md5($user_name.$cert_type.$birth_day.$md5_cert_no);
|
||||
$hash_data = md5($user_name.$cert_type.$birth_day.$phone_no.$md5_cert_no);
|
||||
|
||||
// 성인인증결과
|
||||
$adult_day = date("Ymd", strtotime("-19 years", G5_SERVER_TIME));
|
||||
@ -232,6 +237,10 @@ $(function() {
|
||||
|
||||
alert("본인의 휴대폰번호로 확인 되었습니다.");
|
||||
|
||||
if($opener.$("form[name=fcertrefreshform]") != undefined){
|
||||
$opener.$("form[name=fcertrefreshform]").submit();
|
||||
}
|
||||
|
||||
window.close();
|
||||
});
|
||||
</script>
|
||||
|
||||
@ -4,6 +4,17 @@ include_once('./_common.php');
|
||||
// 금일 인증시도 회수 체크
|
||||
certify_count_check($member['mb_id'], 'hp');
|
||||
|
||||
switch($_GET['pageType']){ // 페이지 타입 체크
|
||||
case "register":
|
||||
$resultPage = "/AuthOnlyRes.php";
|
||||
break;
|
||||
case "find":
|
||||
$resultPage = "/find_AuthOnlyRes.php";
|
||||
break;
|
||||
default:
|
||||
alert_close('잘못된 접근입니다.');
|
||||
}
|
||||
|
||||
/*
|
||||
* [본인확인 요청페이지]
|
||||
*
|
||||
@ -138,7 +149,7 @@ $_SESSION['lgd_certify'] = $payReqMap;
|
||||
document.getElementById("LGD_PAYTYPE").value = fDoc.document.getElementById('LGD_PAYTYPE').value;
|
||||
|
||||
document.getElementById(lgd_form).target = "_self";
|
||||
document.getElementById("LGD_PAYINFO").action = "AuthOnlyRes.php";
|
||||
document.getElementById("LGD_PAYINFO").action = "<?php echo $resultPage; ?>";
|
||||
document.getElementById(lgd_form).submit();
|
||||
} else {
|
||||
alert("LGD_RESPCODE (결과코드2) : " + fDoc.document.getElementById('LGD_RESPCODE').value + "\n" + "LGD_RESPMSG (결과메시지): " + fDoc.document.getElementById('LGD_RESPMSG').value);
|
||||
@ -161,7 +172,7 @@ $_SESSION['lgd_certify'] = $payReqMap;
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<form method="post" name ="LGD_PAYINFO" id="LGD_PAYINFO" action="<?php echo G5_LGXPAY_URL; ?>/AuthOnlyRes.php">
|
||||
<form method="post" name ="LGD_PAYINFO" id="LGD_PAYINFO" action="<?php echo G5_LGXPAY_URL.$resultPage; ?>">
|
||||
<input type="hidden" name="LGD_ENCODING" value="UTF-8"/>
|
||||
<?php
|
||||
foreach ($payReqMap as $key => $value) {
|
||||
|
||||
@ -84,6 +84,9 @@ if ($xpay->TX()) {
|
||||
//인증요청 결과 성공 DB처리
|
||||
//echo "인증요청 결과 성공 DB처리하시기 바랍니다.<br>";
|
||||
|
||||
// 인증내역기록 인증 성공 즉시 로그를 남기는것으로 수정 2021-09-13
|
||||
@insert_cert_history($member['mb_id'], 'lg', 'hp');
|
||||
|
||||
$cert_no = $xpay->Response('LGD_TID', 0); // LG 인증처리번호
|
||||
$comm_id = $xpay->Response('LGD_FINANCECODE', 0); // 이동통신사 코드
|
||||
$phone_no = $xpay->Response('LGD_MOBILENUM', 0); // 전화번호
|
||||
@ -124,12 +127,17 @@ if ($xpay->TX()) {
|
||||
alert_close("정상적인 인증이 아닙니다. 올바른 방법으로 이용해 주세요.");
|
||||
|
||||
$phone_no = hyphen_hp_number($phone_no);
|
||||
$mb_dupinfo = $di;
|
||||
$mb_dupinfo = md5($ci.$ci);
|
||||
|
||||
// 명의 변경 체크
|
||||
if (!empty($member['mb_certify']) && !empty($member['mb_dupinfo']) && strlen($member['mb_dupinfo']) != 64) { // 이미 인증된 계정중에 dupinfo가 di(64 length)가 아닐때
|
||||
if($member['mb_dupinfo'] != $mb_dupinfo) alert_close("해당 계정은 이미 다른명의로 본인인증 되어있는 계정입니다.");
|
||||
}
|
||||
|
||||
if($mb_dupinfo) {
|
||||
$sql = " select mb_id from {$g5['member_table']} where mb_id <> '{$member['mb_id']}' and mb_dupinfo = '{$mb_dupinfo}' ";
|
||||
$row = sql_fetch($sql);
|
||||
if ($row['mb_id']) {
|
||||
if (isset($row['mb_id']) && $row['mb_id']) {
|
||||
alert_close("입력하신 본인확인 정보로 가입된 내역이 존재합니다.\\n회원아이디 : ".$row['mb_id']);
|
||||
}
|
||||
}
|
||||
@ -137,7 +145,7 @@ if ($xpay->TX()) {
|
||||
// hash 데이터
|
||||
$cert_type = 'hp';
|
||||
$md5_cert_no = md5($cert_no);
|
||||
$hash_data = md5($user_name.$cert_type.$birth_day.$md5_cert_no);
|
||||
$hash_data = md5($user_name.$cert_type.$birth_day.$phone_no.$md5_cert_no);
|
||||
|
||||
// 성인인증결과
|
||||
$adult_day = date("Ymd", strtotime("-19 years", G5_SERVER_TIME));
|
||||
@ -151,9 +159,6 @@ if ($xpay->TX()) {
|
||||
set_session("ss_cert_sex", $mb_sex);
|
||||
set_session('ss_cert_dupinfo', $mb_dupinfo);
|
||||
|
||||
// 인증내역기록
|
||||
@insert_cert_history($member['mb_id'], 'lg', 'hp');
|
||||
|
||||
} else {
|
||||
//인증요청 결과 실패 DB처리
|
||||
//echo "인증요청 결과 실패 DB처리하시기 바랍니다.<br>";
|
||||
@ -218,6 +223,11 @@ jQuery(function($) {
|
||||
}
|
||||
|
||||
alert("본인의 휴대폰번호로 확인 되었습니다.");
|
||||
|
||||
if($opener.$("form[name=fcertrefreshform]") != undefined){
|
||||
$opener.$("form[name=fcertrefreshform]").submit();
|
||||
}
|
||||
|
||||
window.close();
|
||||
});
|
||||
</script>
|
||||
|
||||
@ -1,2 +1,3 @@
|
||||
<?php
|
||||
define('G5_CERT_IN_PROG', true);
|
||||
include_once('../../common.php');
|
||||
222
plugin/lgxpay/find_AuthOnlyRes.php
Normal file
222
plugin/lgxpay/find_AuthOnlyRes.php
Normal file
@ -0,0 +1,222 @@
|
||||
<?php
|
||||
include_once('./_common.php');
|
||||
|
||||
$_POST = array_map_deep('conv_unescape_nl', $_POST);
|
||||
|
||||
/*
|
||||
* [본인확인 처리 페이지]
|
||||
*
|
||||
* LG유플러스으로 부터 내려받은 LGD_AUTHONLYKEY(인증Key)를 가지고 최종 인증요청.(파라미터 전달시 POST를 사용하세요)
|
||||
*/
|
||||
|
||||
/*
|
||||
*************************************************
|
||||
* 1.최종인증 요청 - BEGIN
|
||||
*************************************************
|
||||
*/
|
||||
|
||||
//LG유플러스 결제 서비스 선택(test:테스트, service:서비스)
|
||||
if($config['cf_cert_use'] == 2)
|
||||
$CST_PLATFORM = 'service';
|
||||
else
|
||||
$CST_PLATFORM = 'test';
|
||||
$CST_MID = 'si_'.$config['cf_lg_mid']; //상점아이디(LG유플러스으로 부터 발급받으신 상점아이디를 입력하세요)
|
||||
//테스트 아이디는 't'를 반드시 제외하고 입력하세요.
|
||||
$LGD_MID = (('test' == $CST_PLATFORM) ? 't' : '').$CST_MID; //상점아이디(자동생성)
|
||||
$LGD_AUTHONLYKEY = $_POST['LGD_AUTHONLYKEY']; //LG유플러스으로부터 부여받은 인증키
|
||||
$LGD_PAYTYPE = $_POST['LGD_PAYTYPE']; //인증요청타입 (신용카드:ASC001, 휴대폰:ASC002, 계좌:ASC004)
|
||||
|
||||
require_once(G5_LGXPAY_PATH.'/lgdacom/XPayClient.php');
|
||||
|
||||
// mall.conf 설정 추가를 위한 XPayClient 확장
|
||||
class XPay extends XPayClient
|
||||
{
|
||||
public function set_config_value($key, $val)
|
||||
{
|
||||
$this->config[$key] = $val;
|
||||
}
|
||||
}
|
||||
|
||||
$configPath = G5_LGXPAY_PATH.'/lgdacom'; //LG유플러스에서 제공한 환경파일("/conf/lgdacom.conf,/conf/mall.conf") 위치 지정.
|
||||
|
||||
$xpay = new XPay($configPath, $CST_PLATFORM);
|
||||
|
||||
// Mert Key 설정
|
||||
$xpay->set_config_value('t'.$LGD_MID, $config['cf_lg_mert_key']);
|
||||
$xpay->set_config_value($LGD_MID, $config['cf_lg_mert_key']);
|
||||
|
||||
$xpay->Init_TX($LGD_MID);
|
||||
$xpay->Set("LGD_TXNAME", "AuthOnlyByKey");
|
||||
$xpay->Set("LGD_AUTHONLYKEY", $LGD_AUTHONLYKEY);
|
||||
$xpay->Set("LGD_PAYTYPE", $LGD_PAYTYPE);
|
||||
|
||||
$g5['title'] = '휴대폰인증 결과';
|
||||
include_once(G5_PATH.'/head.sub.php');
|
||||
|
||||
/*
|
||||
*************************************************
|
||||
* 1.최종인증 요청(수정하지 마세요) - END
|
||||
*************************************************
|
||||
*/
|
||||
|
||||
/*
|
||||
* 2. 최종인증 요청 결과처리
|
||||
*
|
||||
* 최종 인증요청 결과 리턴 파라미터는 연동메뉴얼을 참고하시기 바랍니다.
|
||||
*/
|
||||
if ($xpay->TX()) {
|
||||
//1)인증결과 화면처리(성공,실패 결과 처리를 하시기 바랍니다.)
|
||||
|
||||
/*
|
||||
echo "인증요청이 완료되었습니다. <br>";
|
||||
echo "TX Response_code = " . $xpay->Response_Code() . "<br>";
|
||||
echo "TX Response_msg = " . $xpay->Response_Msg() . "<p>";
|
||||
|
||||
$keys = $xpay->Response_Names();
|
||||
foreach($keys as $name) {
|
||||
echo $name . " = " . $xpay->Response($name, 0) . "<br>";
|
||||
}
|
||||
|
||||
echo "</p>";
|
||||
*/
|
||||
|
||||
if( "0000" == $xpay->Response_Code() ) {
|
||||
//인증요청 결과 성공 DB처리
|
||||
//echo "인증요청 결과 성공 DB처리하시기 바랍니다.<br>";
|
||||
// 인증내역기록 인증 성공하면 로그를 남기는것으로 수정 2021-09-13
|
||||
@insert_cert_history($member['mb_id'], 'lg', 'hp');
|
||||
|
||||
$cert_no = $xpay->Response('LGD_TID', 0); // LG 인증처리번호
|
||||
$comm_id = $xpay->Response('LGD_FINANCECODE', 0); // 이동통신사 코드
|
||||
$phone_no = $xpay->Response('LGD_MOBILENUM', 0); // 전화번호
|
||||
$user_name = $xpay->Response('LGD_MOBILE_SUBAUTH_NAME', 0); // 이름
|
||||
$birth_day = $xpay->Response('LGD_MOBILE_SUBAUTH_BIRTH', 0); // 생년월일
|
||||
$sex_code = $xpay->Response('LGD_MOBILE_SUBAUTH_SEX', 0); // 성별코드
|
||||
$ci = $xpay->Response('LGD_AUTHSUB_CI', 0); // CI
|
||||
$di = $xpay->Response('LGD_AUTHSUB_DI', 0); // DI 중복가입 확인값
|
||||
|
||||
// 내/외국인
|
||||
if($sex_code > 4)
|
||||
$local_code = 2; // 외국인
|
||||
else
|
||||
$local_code = 1; // 내국인
|
||||
|
||||
// 남/여구분
|
||||
if($sex_code % 2 == 0)
|
||||
$mb_sex = 'F';
|
||||
else
|
||||
$mb_sex = 'M';
|
||||
|
||||
// 생년월일
|
||||
if($sex_code < 5) {
|
||||
if($sex_code <= 2)
|
||||
$birth_prefix = '19';
|
||||
else
|
||||
$birth_prefix = '20';
|
||||
} else {
|
||||
if($sex_code <= 6)
|
||||
$birth_prefix = '19';
|
||||
else
|
||||
$birth_prefix = '20';
|
||||
}
|
||||
$birth_day = $birth_prefix.$birth_day;
|
||||
|
||||
// 정상인증인지 체크
|
||||
if(!$phone_no)
|
||||
alert_close("정상적인 인증이 아닙니다. 올바른 방법으로 이용해 주세요.");
|
||||
|
||||
$phone_no = hyphen_hp_number($phone_no);
|
||||
$mb_dupinfo = $di;
|
||||
$md5_ci = md5($ci.$ci);
|
||||
|
||||
$row = sql_fetch("select mb_id from {$g5['member_table']} where mb_id <> '{$member['mb_id']}' and mb_dupinfo = '{$md5_ci}'"); // ci데이터로 찾음
|
||||
if (empty($row['mb_id'])) { // ci로 등록된 계정이 없다면
|
||||
$row = sql_fetch("select mb_id from {$g5['member_table']} where mb_id <> '{$member['mb_id']}' and mb_dupinfo = '{$mb_dupinfo}'"); // di데이터로 찾음
|
||||
if(empty($row['mb_id'])) {
|
||||
alert_close("인증하신 정보로 가입된 회원정보가 없습니다.");
|
||||
exit;
|
||||
}
|
||||
}else{
|
||||
$mb_dupinfo = $md5_ci;
|
||||
}
|
||||
|
||||
$md5_cert_no = md5($cert_no);
|
||||
$hash_data = md5($user_name.$cert_type.$birth_day.$phone_no.$md5_cert_no);
|
||||
|
||||
// 성인인증결과
|
||||
$adult_day = date("Ymd", strtotime("-19 years", G5_SERVER_TIME));
|
||||
$adult = ((int)$birth_day <= (int)$adult_day) ? 1 : 0;
|
||||
|
||||
set_session("ss_cert_type", $cert_type);
|
||||
set_session("ss_cert_no", $md5_cert_no);
|
||||
set_session("ss_cert_hash", $hash_data);
|
||||
set_session("ss_cert_adult", $adult);
|
||||
set_session("ss_cert_birth", $birth_day);
|
||||
set_session("ss_cert_sex", $mb_sex); // 이니시스 간편인증은 성별정보 리턴 없음
|
||||
set_session('ss_cert_dupinfo', $mb_dupinfo);
|
||||
set_session('ss_cert_mb_id', $row['mb_id']);
|
||||
} else {
|
||||
//인증요청 결과 실패 DB처리
|
||||
//echo "인증요청 결과 실패 DB처리하시기 바랍니다.<br>";
|
||||
|
||||
if( G5_IS_MOBILE ){
|
||||
echo '<script>'.PHP_EOL;
|
||||
echo 'window.parent.$("#cert_info").css("display", "");'.PHP_EOL;
|
||||
echo 'window.parent.$("#lgu_cert" ).css("display", "none");'.PHP_EOL;
|
||||
echo 'alert("인증요청이 취소 또는 실패하였습니다.\\n\\n코드 : '.$xpay->Response_Code().' '.$xpay->Response_Msg().'")';
|
||||
echo '</script>'.PHP_EOL;
|
||||
} else {
|
||||
alert_close('인증요청이 취소 또는 실패하였습니다.\\n\\n코드 : '.$xpay->Response_Code().' '.$xpay->Response_Msg());
|
||||
}
|
||||
exit;
|
||||
}
|
||||
} else {
|
||||
//2)API 요청실패 화면처리
|
||||
/*
|
||||
echo "인증요청이 실패하였습니다. <br>";
|
||||
echo "TX Response_code = " . $xpay->Response_Code() . "<br>";
|
||||
echo "TX Response_msg = " . $xpay->Response_Msg() . "<p>";
|
||||
|
||||
//인증요청 결과 실패 DB처리
|
||||
echo "인증요청 결과 실패 DB처리하시기 바랍니다.<br>";
|
||||
*/
|
||||
|
||||
if( G5_IS_MOBILE ){
|
||||
echo '<script>'.PHP_EOL;
|
||||
echo 'window.parent.$("#cert_info").css("display", "");'.PHP_EOL;
|
||||
echo 'window.parent.$("#lgu_cert" ).css("display", "none");'.PHP_EOL;
|
||||
echo 'alert("인증요청이 실패하였습니다.\\n\\n코드 : '.$xpay->Response_Code().' '.$xpay->Response_Msg().'")';
|
||||
echo '</script>'.PHP_EOL;
|
||||
} else {
|
||||
alert_close('인증요청이 실패하였습니다.\\n\\n코드 : '.$xpay->Response_Code().' '.$xpay->Response_Msg());
|
||||
}
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
<form name="mbFindForm" method="POST">
|
||||
<input type="hidden" name="mb_id" value="<?php echo $row["mb_id"]; ?>">
|
||||
</form>
|
||||
<script>
|
||||
jQuery(function($) {
|
||||
|
||||
var $opener = window.opener;
|
||||
var is_mobile = false;
|
||||
$opener.name="parentPage";
|
||||
|
||||
if (typeof g5_is_mobile != "undefined" && g5_is_mobile ) {
|
||||
$opener = window.parent;
|
||||
is_mobile = true;
|
||||
} else {
|
||||
$opener = window.opener;
|
||||
}
|
||||
|
||||
document.mbFindForm.target = "parentPage";
|
||||
document.mbFindForm.action = "<?php echo G5_BBS_URL.'/password_reset.php'?>";
|
||||
document.mbFindForm.submit();
|
||||
|
||||
alert("본인인증이 완료되었습니다.");
|
||||
window.close();
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
include_once(G5_PATH.'/tail.sub.php');
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,3 +1,3 @@
|
||||
url = https://xpayclient.lgdacom.net/xpay/Gateway.do
|
||||
test_url = https://xpayclient.lgdacom.net:7443/xpay/Gateway.do
|
||||
test_url = https://pretestclient.uplus.co.kr:9443/xpay/Gateway.do
|
||||
aux_url = http://xpayclient.lgdacom.net:7080/xpay/Gateway.do
|
||||
|
||||
@ -4,8 +4,8 @@ server_id = 01
|
||||
;timeout API <20><>û timeout <20>ð<EFBFBD> (<28><><EFBFBD><EFBFBD>:<3A><>)
|
||||
timeout = 60
|
||||
|
||||
;log_level 0: FATAL; 1: ERROR; 2: WARNING; 3: INFO; 4: DEBUG
|
||||
log_level = 4
|
||||
;log_level 3: INFO; 4: DEBUG
|
||||
log_level = 3
|
||||
|
||||
;verify_cert 1: <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>; 0: <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
verify_cert = 1
|
||||
@ -24,11 +24,14 @@ auto_rollback = 1
|
||||
|
||||
|
||||
;log_dir log directory full path (<28>α<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ġ<EFBFBD><C4A1> log <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ݵ<EFBFBD><DDB5><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>αװ<CEB1> <20><><EFBFBD><EFBFBD>)
|
||||
log_dir = c:\lgdacom\log
|
||||
log_dir = C:\lgdacom\log
|
||||
|
||||
; 512 (TLS1.1) , 2048 (TLS1.2) , 2560 (TLS1.0) java / php <20><><EFBFBD><EFBFBD>
|
||||
default_secure_protocols=2048
|
||||
|
||||
;>>>>>>>>>>>>>>>>>>>> <20>ݵ<EFBFBD><DDB5><EFBFBD> <20>Է<EFBFBD><D4B7><EFBFBD> <20>ּ<EFBFBD><D6BC><EFBFBD> <<<<<<<<<<<<<<<<<<<<
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD> ID<49><44> LG<EFBFBD>ڷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>߱<DFB1><DEB9><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̵<EFBFBD><CCB5><EFBFBD> <20>Է<EFBFBD><D4B7>ϼ<EFBFBD><CFBC><EFBFBD>. (<28>߱<DFB1><DEB9><EFBFBD> <20><><EFBFBD>̵<EFBFBD> <20>տ<EFBFBD> "t" <20><> <20><><EFBFBD>̽ø<CCBD> <20><EFBFBD>Ʈ<EFBFBD><C6AE><EFBFBD>̵<EFBFBD> <20>Դϴ<D4B4>.)
|
||||
;<3B><><EFBFBD><EFBFBD> ID<49><44> LG U+<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>߱<DFB1><DEB9><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̵<EFBFBD><CCB5><EFBFBD> <20>Է<EFBFBD><D4B7>ϼ<EFBFBD><CFBC><EFBFBD>. (<28>߱<DFB1><DEB9><EFBFBD> <20><><EFBFBD>̵<EFBFBD> <20>տ<EFBFBD> "t" <20><> <20><><EFBFBD>̽ø<CCBD> <20><EFBFBD>Ʈ<EFBFBD><C6AE><EFBFBD>̵<EFBFBD> <20>Դϴ<D4B4>.)
|
||||
;MertKey<65><79> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> -> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> -> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> --> <20>ý<EFBFBD><C3BD>ۿ<EFBFBD><DBBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> Ȯ<><C8AE><EFBFBD>ϽǼ<CFBD> <20>ֽ<EFBFBD><D6BD>ϴ<EFBFBD>.
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD> ID = MertKey (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><EFBFBD>Ʈ, 2<><32><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD>̵<EFBFBD><CCB5><EFBFBD> <20><><EFBFBD><EFBFBD> <20>Է<EFBFBD><D4B7><EFBFBD><EFBFBD>ּ<EFBFBD><D6BC><EFBFBD>. <20>Է½<D4B7> <20>ּ<EFBFBD>ǥ<EFBFBD><C7A5>(;)<29><> <20><><EFBFBD><EFBFBD><EFBFBD>ø<EFBFBD> <20>ȵ˴ϴ<CBB4>.)
|
||||
|
||||
@ -1,2 +1,3 @@
|
||||
<?php
|
||||
define('G5_CERT_IN_PROG', true);
|
||||
include_once('../../common.php');
|
||||
173
plugin/okname/find_hpcert2.php
Normal file
173
plugin/okname/find_hpcert2.php
Normal file
@ -0,0 +1,173 @@
|
||||
<?php
|
||||
include_once('./_common.php');
|
||||
|
||||
$check_arrays = array('exe', 'keypath', 'memId', 'endPointURL', 'endPointUrl', 'logPath');
|
||||
|
||||
foreach($check_arrays as $key){
|
||||
if( isset($_REQUEST[$key]) && $_REQUEST[$key] ){
|
||||
die('bad request');
|
||||
}
|
||||
|
||||
$$key = '';
|
||||
}
|
||||
|
||||
// KISA 취약점 내용(KVE-2018-0291) hpcert1.php의 $cmd 함수에 대한 인자 값은 hpcert_config.php 파일에서 설정되나, 이를 다른 페이지에서 포함한 뒤 호출할 시 임의 값 설정 가능
|
||||
// 이에 include_once 를 require 로 수정함
|
||||
require('./hpcert.config.php');
|
||||
/**************************************************************************
|
||||
파일명 : safe_hs_cert3.php
|
||||
|
||||
생년월일 본인 확인서비스 결과 화면(return url)
|
||||
**************************************************************************/
|
||||
|
||||
/* 공통 리턴 항목 */
|
||||
//$idcfMbrComCd = $_REQUEST['idcf_mbr_com_cd']; // 고객사코드
|
||||
$idcfMbrComCd = $memId;
|
||||
$hsCertSvcTxSeqno = isset($_REQUEST['hs_cert_svc_tx_seqno']) ? $_REQUEST['hs_cert_svc_tx_seqno'] : ''; // 거래번호
|
||||
$rqstSiteNm = isset($_REQUEST['rqst_site_nm']) ? $_REQUEST['rqst_site_nm'] : ''; // 접속도메인
|
||||
$hsCertRqstCausCd = isset($_REQUEST['hs_cert_rqst_caus_cd']) ? $_REQUEST['hs_cert_rqst_caus_cd'] : ''; // 인증요청사유코드 2byte (00:회원가입, 01:성인인증, 02:회원정보수정, 03:비밀번호찾기, 04:상품구매, 99:기타)
|
||||
|
||||
$resultCd = isset($_REQUEST['result_cd']) ? $_REQUEST['result_cd'] : ''; // 결과코드
|
||||
$resultMsg = isset($_REQUEST['result_msg']) ? $_REQUEST['result_msg'] : ''; // 결과메세지
|
||||
$certDtTm = isset($_REQUEST['cert_dt_tm']) ? $_REQUEST['cert_dt_tm'] : ''; // 인증일시
|
||||
|
||||
if($resultCd != 'B000') {
|
||||
alert_close('휴대폰 본인확인 중 오류가 발생했습니다. 오류코드 : '.$resultCd.'\\n\\n문의는 코리아크레딧뷰로 고객센터 02-708-1000 로 해주십시오.');
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
* 모듈 호출 ; 생년월일 본인 확인서비스 결과 데이터를 복호화한다.
|
||||
**************************************************************************/
|
||||
$encInfo = isset($_REQUEST['encInfo']) ? $_REQUEST['encInfo'] : '';
|
||||
if(preg_match('~[^0-9a-zA-Z+/=]~', $encInfo, $match)) {echo "입력 값 확인이 필요합니다"; exit;}
|
||||
|
||||
//KCB서버 공개키
|
||||
$WEBPUBKEY = isset($_REQUEST['WEBPUBKEY']) ? trim($_REQUEST['WEBPUBKEY']) : '';
|
||||
if(preg_match('~[^0-9a-zA-Z+/=]~', $WEBPUBKEY, $match)) {echo "입력 값 확인이 필요합니다"; exit;}
|
||||
|
||||
//KCB서버 서명값
|
||||
$WEBSIGNATURE = isset($_REQUEST['WEBSIGNATURE']) ? trim($_REQUEST['WEBSIGNATURE']) : '';
|
||||
if(preg_match('~[^0-9a-zA-Z+/=]~', $WEBSIGNATURE, $match)) {echo "입력 값 확인이 필요합니다"; exit;}
|
||||
|
||||
// ########################################################################
|
||||
// # 암호화키 파일 설정 (절대경로) - 파일은 주어진 파일명으로 자동 생성 됨
|
||||
// ########################################################################
|
||||
$keypath = G5_OKNAME_PATH.'/key/safecert_'.$idcfMbrComCd.'.key';
|
||||
|
||||
$cpubkey = $WEBPUBKEY; //server publickey
|
||||
$csig = $WEBSIGNATURE; //server signature
|
||||
|
||||
// ########################################################################
|
||||
// # 로그 경로 지정 및 권한 부여 (절대경로)
|
||||
// # 옵션값에 'L'을 추가하는 경우에만 로그가 생성됨.
|
||||
// ########################################################################
|
||||
$option = 'SU';
|
||||
|
||||
// 명령어
|
||||
$cmd = "$exe $keypath $idcfMbrComCd $endPointUrl $WEBPUBKEY $WEBSIGNATURE $encInfo $logPath $option";
|
||||
|
||||
// 실행
|
||||
exec($cmd, $out, $ret);
|
||||
|
||||
// 인증내역기록
|
||||
@insert_cert_history($member['mb_id'], 'kcb', 'hp');
|
||||
|
||||
if($ret == 0) {
|
||||
// 결과라인에서 값을 추출
|
||||
foreach($out as $a => $b) {
|
||||
if($a < 17) {
|
||||
$field[$a] = $b;
|
||||
}
|
||||
}
|
||||
$resultCd = $field[0];
|
||||
}
|
||||
else {
|
||||
if($ret <=200)
|
||||
$resultCd=sprintf("B%03d", $ret);
|
||||
else
|
||||
$resultCd=sprintf("S%03d", $ret);
|
||||
}
|
||||
|
||||
/*
|
||||
echo "처리결과코드 :$resultCd <br/>";
|
||||
echo "처리결과메시지 :$field[1] <br/>";
|
||||
echo "거래일련번호 :$field[2] <br/>";
|
||||
echo "인증일시 :$field[3] <br/>";
|
||||
echo "DI :$field[4] <br/>";
|
||||
echo "CI :$field[5] <br/>";
|
||||
echo "성명 :$field[7] <br/>";
|
||||
echo "생년월일 :$field[8] <br/>";
|
||||
echo "성별 :$field[9] <br/>";
|
||||
echo "내외국인구분 :$field[10] <br/>";
|
||||
echo "통신사코드 :$field[11] <br/>";
|
||||
echo "휴대폰번호 :$field[12] <br/>";
|
||||
echo "리턴메시지 :$field[16] <br/>";
|
||||
*/
|
||||
|
||||
// 인증결과처리
|
||||
$mb_name = $field[7];
|
||||
$req_num = $field[12];
|
||||
$mb_birth = $field[8];
|
||||
$mb_dupinfo = $field[4];
|
||||
$ci = $field[5];
|
||||
|
||||
$phone_no = hyphen_hp_number($req_num);
|
||||
$md5_ci = md5($ci.$ci);
|
||||
|
||||
$row = sql_fetch("select mb_id from {$g5['member_table']} where mb_id <> '{$member['mb_id']}' and mb_dupinfo = '{$md5_ci}'"); // ci데이터로 찾음
|
||||
if (empty($row['mb_id'])) { // ci로 등록된 계정이 없다면
|
||||
$row = sql_fetch("select mb_id from {$g5['member_table']} where mb_id <> '{$member['mb_id']}' and mb_dupinfo = '{$mb_dupinfo}'"); // di데이터로 찾음
|
||||
if(empty($row['mb_id'])) {
|
||||
alert_close("인증하신 정보로 가입된 회원정보가 없습니다.");
|
||||
exit;
|
||||
}
|
||||
}else{
|
||||
$mb_dupinfo = $md5_ci;
|
||||
}
|
||||
|
||||
$md5_cert_no = md5($cert_no);
|
||||
$hash_data = md5($user_name.$cert_type.$birth_day.$phone_no.$md5_cert_no);
|
||||
|
||||
// 성인인증결과
|
||||
$adult_day = date("Ymd", strtotime("-19 years", G5_SERVER_TIME));
|
||||
$adult = ((int)$birth_day <= (int)$adult_day) ? 1 : 0;
|
||||
|
||||
set_session("ss_cert_type", $cert_type);
|
||||
set_session("ss_cert_no", $md5_cert_no);
|
||||
set_session("ss_cert_hash", $hash_data);
|
||||
set_session("ss_cert_adult", $adult);
|
||||
set_session("ss_cert_birth", $birth_day);
|
||||
set_session('ss_cert_sex', ($field[9] == 1 ? 'M' : 'F'));
|
||||
set_session('ss_cert_dupinfo', $mb_dupinfo);
|
||||
set_session('ss_cert_mb_id', $row['mb_id']);
|
||||
|
||||
$g5['title'] = 'KCB 휴대폰 본인확인';
|
||||
include_once(G5_PATH.'/head.sub.php');
|
||||
?>
|
||||
<form name="mbFindForm" method="POST">
|
||||
<input type="hidden" name="mb_id" value="<?php echo $row["mb_id"]; ?>">
|
||||
</form>
|
||||
<script>
|
||||
jQuery(function($) {
|
||||
|
||||
var $opener = window.opener;
|
||||
var is_mobile = false;
|
||||
$opener.name="parentPage";
|
||||
|
||||
if (typeof g5_is_mobile != "undefined" && g5_is_mobile ) {
|
||||
$opener = window.parent;
|
||||
is_mobile = true;
|
||||
} else {
|
||||
$opener = window.opener;
|
||||
}
|
||||
|
||||
document.mbFindForm.target = "parentPage";
|
||||
document.mbFindForm.action = "<?php echo G5_BBS_URL.'/password_reset.php'?>";
|
||||
document.mbFindForm.submit();
|
||||
|
||||
alert("본인인증이 완료되었습니다.");
|
||||
window.close();
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
include_once(G5_PATH.'/tail.sub.php');
|
||||
148
plugin/okname/find_ipin2.php
Normal file
148
plugin/okname/find_ipin2.php
Normal file
@ -0,0 +1,148 @@
|
||||
<?php
|
||||
include_once('./_common.php');
|
||||
|
||||
$check_arrays = array('exe', 'keypath', 'memid', 'EndPointURL', 'cpubkey', 'csig', 'encdata', 'logpath', 'option');
|
||||
|
||||
foreach($check_arrays as $key){
|
||||
if( isset($_REQUEST[$key]) && $_REQUEST[$key] ){
|
||||
die('bad request');
|
||||
}
|
||||
|
||||
$$key = '';
|
||||
}
|
||||
|
||||
require('./ipin.config.php');
|
||||
|
||||
//아이핀팝업에서 조회한 PERSONALINFO이다.
|
||||
@$encPsnlInfo = isset($_REQUEST["encPsnlInfo"]) ? $_REQUEST["encPsnlInfo"] : '';
|
||||
if(preg_match('~[^0-9a-zA-Z+/=]~', $encPsnlInfo, $match)) {echo "입력 값 확인이 필요합니다"; exit;}
|
||||
|
||||
//KCB서버 공개키
|
||||
@$WEBPUBKEY = isset($_REQUEST["WEBPUBKEY"]) ? trim($_REQUEST["WEBPUBKEY"]) : '';
|
||||
if(preg_match('~[^0-9a-zA-Z+/=]~', $WEBPUBKEY, $match)) {echo "입력 값 확인이 필요합니다"; exit;}
|
||||
|
||||
//KCB서버 서명값
|
||||
@$WEBSIGNATURE = isset($_REQUEST["WEBSIGNATURE"]) ? trim($_REQUEST["WEBSIGNATURE"]) : '';
|
||||
if(preg_match('~[^0-9a-zA-Z+/=]~', $WEBSIGNATURE, $match)) {echo "입력 값 확인이 필요합니다"; exit;}
|
||||
|
||||
//아이핀 서버와 통신을 위한 키파일 생성
|
||||
// 파라미터 정의
|
||||
$cpubkey = $WEBPUBKEY; //server publickey
|
||||
$csig = $WEBSIGNATURE; //server signature
|
||||
$encdata = $encPsnlInfo; //PERSONALINFO
|
||||
$option = "SU";
|
||||
|
||||
// 명령어
|
||||
$cmd = "$exe $keypath $memid $EndPointURL $cpubkey $csig $encdata $logpath $option";
|
||||
|
||||
// 실행
|
||||
exec($cmd, $out, $ret);
|
||||
|
||||
// 인증내역기록
|
||||
@insert_cert_history($member['mb_id'], 'kcb', 'ipin');
|
||||
|
||||
if($ret != 0) {
|
||||
if($ret <=200)
|
||||
$resultCd=sprintf("B%03d", $ret);
|
||||
else
|
||||
$resultCd=sprintf("S%03d", $ret);
|
||||
|
||||
alert_close('아이핀 본인확인 중 오류가 발생했습니다. 오류코드 : '.$resultCd.'\\n\\n문의는 코리아크레딧뷰로 고객센터 02-708-1000 로 해주십시오.');
|
||||
}
|
||||
|
||||
// 결과라인에서 값을 추출
|
||||
foreach($out as $a => $b) {
|
||||
if($a < 13) {
|
||||
$field[$a] = $b;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
$field_name_IPIN_DEC = array(
|
||||
"dupInfo ", // 0
|
||||
"coinfo1 ", // 1
|
||||
"coinfo2 ", // 2
|
||||
"ciupdate ", // 3
|
||||
"virtualNo ", // 4
|
||||
"cpCode ", // 5
|
||||
"realName ", // 6
|
||||
"cpRequestNumber", // 7
|
||||
"age ", // 8
|
||||
"sex ", // 9
|
||||
"nationalInfo ", // 10
|
||||
"birthDate ", // 11
|
||||
"authInfo ", // 12
|
||||
);
|
||||
*/
|
||||
|
||||
$mb_name = $field[6];
|
||||
$req_num = $field[7];
|
||||
$mb_birth = $field[11];
|
||||
$mb_dupinfo = $field[0];
|
||||
if(!empty($field[1])) { // 아이핀은 리턴받는 ci 데이터가 두가지인걸로 보아 개인별로 받는 곳이 다를 수도 있을것 같아서 추가함 2021-09-13 hjkim7153
|
||||
$ci = $field[1];
|
||||
}else if(!empty($field[2])) {
|
||||
$ci = $field[2];
|
||||
}else{
|
||||
alert_close('아이핀 본인확인 중 오류가 발생했습니다. (ci 정보 없음) 오류코드 : '.$resultCd.'\\n\\n문의는 코리아크레딧뷰로 고객센터 02-708-1000 로 해주십시오.');
|
||||
}
|
||||
$md5_ci = md5($ci.$ci);
|
||||
|
||||
$row = sql_fetch("select mb_id from {$g5['member_table']} where mb_id <> '{$member['mb_id']}' and mb_dupinfo = '{$md5_ci}'"); // ci데이터로 찾음
|
||||
if (empty($row['mb_id'])) { // ci로 등록된 계정이 없다면
|
||||
$row = sql_fetch("select mb_id from {$g5['member_table']} where mb_id <> '{$member['mb_id']}' and mb_dupinfo = '{$mb_dupinfo}'"); // di데이터로 찾음
|
||||
if(empty($row['mb_id'])) {
|
||||
alert_close("인증하신 정보로 가입된 회원정보가 없습니다.");
|
||||
exit;
|
||||
}
|
||||
}else{
|
||||
$mb_dupinfo = $md5_ci;
|
||||
}
|
||||
|
||||
$md5_cert_no = md5($cert_no);
|
||||
$hash_data = md5($user_name.$cert_type.$birth_day.$phone_no.$md5_cert_no);
|
||||
|
||||
// 성인인증결과
|
||||
$adult_day = date("Ymd", strtotime("-19 years", G5_SERVER_TIME));
|
||||
$adult = ((int)$birth_day <= (int)$adult_day) ? 1 : 0;
|
||||
|
||||
set_session("ss_cert_type", $cert_type);
|
||||
set_session("ss_cert_no", $md5_cert_no);
|
||||
set_session("ss_cert_hash", $hash_data);
|
||||
set_session("ss_cert_adult", $adult);
|
||||
set_session("ss_cert_birth", $birth_day);
|
||||
set_session('ss_cert_sex', ($field[9] == 1 ? 'M' : 'F'));
|
||||
set_session('ss_cert_dupinfo', $mb_dupinfo);
|
||||
set_session('ss_cert_mb_id', $row['mb_id']);
|
||||
|
||||
$g5['title'] = 'KCB 아이핀 본인확인';
|
||||
include_once(G5_PATH.'/head.sub.php');
|
||||
?>
|
||||
|
||||
<form name="mbFindForm" method="POST">
|
||||
<input type="hidden" name="mb_id" value="<?php echo $row["mb_id"]; ?>">
|
||||
</form>
|
||||
<script>
|
||||
jQuery(function($) {
|
||||
|
||||
var $opener = window.opener;
|
||||
var is_mobile = false;
|
||||
$opener.name="parentPage";
|
||||
|
||||
if (typeof g5_is_mobile != "undefined" && g5_is_mobile ) {
|
||||
$opener = window.parent;
|
||||
is_mobile = true;
|
||||
} else {
|
||||
$opener = window.opener;
|
||||
}
|
||||
|
||||
document.mbFindForm.target = "parentPage";
|
||||
document.mbFindForm.action = "<?php echo G5_BBS_URL.'/password_reset.php'?>";
|
||||
document.mbFindForm.submit();
|
||||
|
||||
alert("본인인증이 완료되었습니다.");
|
||||
window.close();
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
include_once(G5_PATH.'/tail.sub.php');
|
||||
@ -80,4 +80,5 @@ if($config['cf_cert_use'] == 2) {
|
||||
// ########################################################################
|
||||
// # 리턴 URL 설정
|
||||
// ########################################################################
|
||||
$returnUrl = escapeshellarg(G5_OKNAME_URL.'/hpcert2.php'); // 본인인증 완료후 리턴될 URL (도메인 포함 full path);
|
||||
if(!empty($resultPage))
|
||||
$returnUrl = escapeshellarg(G5_OKNAME_URL.$resultPage); // 본인인증 완료후 리턴될 URL (도메인 포함 full path);
|
||||
@ -14,6 +14,16 @@ foreach($check_arrays as $key){
|
||||
// 금일 인증시도 회수 체크
|
||||
certify_count_check($member['mb_id'], 'hp');
|
||||
|
||||
switch($_GET['pageType']){
|
||||
case "register":
|
||||
$resultPage = "/hpcert2.php";
|
||||
break;
|
||||
case "find":
|
||||
$resultPage = "/find_hpcert2.php";
|
||||
break;
|
||||
default:
|
||||
alert_close('잘못된 접근입니다.');
|
||||
}
|
||||
// KISA 취약점 내용(KVE-2018-0291) hpcert1.php의 $cmd 함수에 대한 인자 값은 hpcert_config.php 파일에서 설정되나, 이를 다른 페이지에서 포함한 뒤 호출할 시 임의 값 설정 가능
|
||||
// 이에 include_once 를 require 로 수정함
|
||||
require('./hpcert.config.php');
|
||||
|
||||
@ -108,20 +108,27 @@ echo "리턴메시지 :$field[16] <br/>";
|
||||
$mb_name = $field[7];
|
||||
$req_num = $field[12];
|
||||
$mb_birth = $field[8];
|
||||
$mb_dupinfo = $field[4];
|
||||
$di = $field[4];
|
||||
$ci = $field[5];
|
||||
$mb_dupinfo = md5($ci.$ci); // 간편인증 추가 후 ci로 변경
|
||||
$phone_no = hyphen_hp_number($req_num);
|
||||
|
||||
// 명의 변경 체크
|
||||
if (!empty($member['mb_certify']) && !empty($member['mb_dupinfo']) && strlen($member['mb_dupinfo']) != 64) { // 이미 인증된 계정중에 dupinfo가 di(64 length)가 아닐때
|
||||
if($member['mb_dupinfo'] != $mb_dupinfo) alert_close("해당 계정은 이미 다른명의로 본인인증 되어있는 계정입니다.");
|
||||
}
|
||||
|
||||
// 중복정보 체크
|
||||
$sql = " select mb_id from {$g5['member_table']} where mb_id <> '{$member['mb_id']}' and mb_dupinfo = '{$mb_dupinfo}' ";
|
||||
$row = sql_fetch($sql);
|
||||
if ($row['mb_id']) {
|
||||
if (!empty($row['mb_id'])) {
|
||||
alert_close("입력하신 본인확인 정보로 가입된 내역이 존재합니다.\\n회원아이디 : ".$row['mb_id']);
|
||||
}
|
||||
|
||||
// hash 데이터
|
||||
$cert_type = 'hp';
|
||||
$md5_cert_no = md5($req_num);
|
||||
$hash_data = md5($mb_name.$cert_type.$mb_birth.$md5_cert_no);
|
||||
$hash_data = md5($mb_name.$cert_type.$mb_birth.$phone_no.$md5_cert_no);
|
||||
|
||||
// 성인인증결과
|
||||
$adult_day = date("Ymd", strtotime("-19 years", G5_SERVER_TIME));
|
||||
@ -149,6 +156,11 @@ $(function() {
|
||||
$opener.$("input[name=cert_no]").val("<?php echo $md5_cert_no; ?>");
|
||||
|
||||
alert("본인의 휴대폰번호로 확인 되었습니다.");
|
||||
|
||||
if($opener.$("form[name=fcertrefreshform]") != undefined){
|
||||
$opener.$("form[name=fcertrefreshform]").submit();
|
||||
}
|
||||
|
||||
window.close();
|
||||
});
|
||||
</script>
|
||||
|
||||
2
plugin/okname/index.php
Normal file
2
plugin/okname/index.php
Normal file
@ -0,0 +1,2 @@
|
||||
git 에서 빈 디렉토리는 push 되지 않으므로 일부러 생성한 파일입니다.
|
||||
이 디렉토리에 다른 파일이 하나라도 있다면 나중에 삭제하세요.
|
||||
@ -36,7 +36,8 @@ if($config['cf_cert_use'] == 2) {
|
||||
}
|
||||
|
||||
$idpCode = 'V';
|
||||
$returnUrl = G5_OKNAME_URL.'/ipin2.php'; // 아이핀 인증을 마치고 돌아올 페이지 주소
|
||||
if(!empty($resultPage))
|
||||
$returnUrl = G5_OKNAME_URL.$resultPage; // 아이핀 인증을 마치고 돌아올 페이지 주소
|
||||
$keypath = G5_OKNAME_PATH.'/key/okname.key'; // 키파일이 생성될 위치. 웹서버에 해당파일을 생성할 권한 필요.
|
||||
$memid = $cpCode; // 회원사코드
|
||||
$reserved1 = '0'; //reserved1
|
||||
|
||||
@ -14,6 +14,16 @@ foreach($check_arrays as $key){
|
||||
// 금일 인증시도 회수 체크
|
||||
certify_count_check($member['mb_id'], 'ipin');
|
||||
|
||||
switch($_GET['pageType']){
|
||||
case "register":
|
||||
$resultPage = "/ipin2.php";
|
||||
break;
|
||||
case "find":
|
||||
$resultPage = "/find_ipin2.php";
|
||||
break;
|
||||
default:
|
||||
alert_close('잘못된 접근입니다.');
|
||||
}
|
||||
// KISA 취약점 내용(KVE-2018-0291) hpcert1.php의 $cmd 함수에 대한 인자 값은 hpcert_config.php 파일에서 설정되나, 이를 다른 페이지에서 포함한 뒤 호출할 시 임의 값 설정 가능
|
||||
// 이에 include_once 를 require 로 수정함
|
||||
require('./ipin.config.php');
|
||||
|
||||
@ -78,12 +78,25 @@ $field_name_IPIN_DEC = array(
|
||||
$mb_name = $field[6];
|
||||
$req_num = $field[7];
|
||||
$mb_birth = $field[11];
|
||||
$mb_dupinfo = $field[0];
|
||||
$di = $field[0];
|
||||
if(!empty($field[1])) { // 아이핀은 리턴받는 ci 데이터가 두가지인걸로 보아 개인별로 받는 곳이 다를 수도 있을것 같아서 추가함 2021-09-13 hjkim7153
|
||||
$ci = $field[1];
|
||||
}else if(!empty($field[2])) {
|
||||
$ci = $field[2];
|
||||
}else{
|
||||
alert_close('아이핀 본인확인 중 오류가 발생했습니다. (ci 정보 없음) 오류코드 : '.$resultCd.'\\n\\n문의는 코리아크레딧뷰로 고객센터 02-708-1000 로 해주십시오.');
|
||||
}
|
||||
$mb_dupinfo = md5($ci.$ci); // 간편인증 추가 후 ci로 변경
|
||||
|
||||
// 명의 변경 체크
|
||||
if (!empty($member['mb_certify']) && !empty($member['mb_dupinfo']) && strlen($member['mb_dupinfo']) != 64) { // 이미 인증된 계정중에 dupinfo가 di(64 length)가 아닐때
|
||||
if($member['mb_dupinfo'] != $mb_dupinfo) alert_close("해당 계정은 이미 다른명의로 본인인증 되어있는 계정입니다.");
|
||||
}
|
||||
|
||||
// 중복정보 체크
|
||||
$sql = " select mb_id from {$g5['member_table']} where mb_id <> '{$member['mb_id']}' and mb_dupinfo = '{$mb_dupinfo}' ";
|
||||
$row = sql_fetch($sql);
|
||||
if ($row['mb_id']) {
|
||||
if (!empty($row['mb_id'])) {
|
||||
alert_close("입력하신 본인확인 정보로 가입된 내역이 존재합니다.\\n회원아이디 : ".$row['mb_id']);
|
||||
}
|
||||
|
||||
@ -115,6 +128,10 @@ $(function() {
|
||||
$opener.$("input[name=mb_name]").val("<?php echo $mb_name; ?>").attr("readonly", true);
|
||||
$opener.$("input[name=cert_no]").val("<?php echo $md5_cert_no; ?>");
|
||||
|
||||
if($opener.$("form[name=fcertrefreshform]") != undefined){
|
||||
$opener.$("form[name=fcertrefreshform]").submit();
|
||||
}
|
||||
|
||||
window.close();
|
||||
});
|
||||
</script>
|
||||
|
||||
@ -13,8 +13,8 @@ $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET);
|
||||
$request_token = $connection->getRequestToken(OAUTH_CALLBACK);
|
||||
|
||||
/* Save temporary credentials to session. */
|
||||
$_SESSION['oauth_token'] = $token = $request_token['oauth_token'];
|
||||
$_SESSION['oauth_token_secret'] = $request_token['oauth_token_secret'];
|
||||
$_SESSION['oauth_token'] = $token = @$request_token['oauth_token'];
|
||||
$_SESSION['oauth_token_secret'] = @$request_token['oauth_token_secret'];
|
||||
|
||||
//print_r2($_SESSION); exit;
|
||||
|
||||
|
||||
@ -77,7 +77,7 @@ class TwitterOAuth {
|
||||
$parameters['oauth_callback'] = $oauth_callback;
|
||||
$request = $this->oAuthRequest($this->requestTokenURL(), 'GET', $parameters);
|
||||
$token = OAuthUtil::parse_parameters($request);
|
||||
$this->token = new OAuthConsumer($token['oauth_token'], $token['oauth_token_secret']);
|
||||
$this->token = new OAuthConsumer(@$token['oauth_token'], @$token['oauth_token_secret']);
|
||||
return $token;
|
||||
}
|
||||
|
||||
|
||||
@ -131,10 +131,10 @@ class Hybrid_Providers_Naver extends Hybrid_Provider_Model_OAuth2
|
||||
if( array_key_exists('birthday',$data) ){
|
||||
$tmp = explode("-",$data['birthday']);
|
||||
if( isset($tmp[0]) ){
|
||||
$this->user->profile->birthDay = $tmp[0];
|
||||
$this->user->profile->birthMonth = $tmp[0];
|
||||
}
|
||||
if( isset($tmp[1]) ){
|
||||
$this->user->profile->birthMonth = $tmp[1];
|
||||
$this->user->profile->birthDay = $tmp[1];
|
||||
}
|
||||
}
|
||||
$this->user->profile->email = (array_key_exists('email',$data))?$data['email']:"";
|
||||
|
||||
@ -1,2 +1,7 @@
|
||||
<?php
|
||||
include_once('../../common.php');
|
||||
include_once('../../common.php');
|
||||
|
||||
// 커뮤니티 사용여부
|
||||
if(defined('G5_COMMUNITY_USE') && G5_COMMUNITY_USE === false) {
|
||||
define('_SHOP_', true);
|
||||
}
|
||||
@ -23,7 +23,7 @@ if( isset( $_REQUEST["redirect_to_idp"] ) ){
|
||||
$get_login_url = G5_BBS_URL."/login.php?url=".$urlencode;
|
||||
|
||||
if( $content ){
|
||||
//팝업으로 뜨웠다면 아래
|
||||
//팝업으로 띄웠다면 아래 코드를 실행
|
||||
?>
|
||||
<script>
|
||||
if( window.opener ){
|
||||
|
||||
@ -25,6 +25,7 @@ $is_exists_social_account = social_before_join_check($url);
|
||||
$user_nick = social_relace_nick($user_profile->displayName);
|
||||
$user_email = isset($user_profile->emailVerified) ? $user_profile->emailVerified : $user_profile->email;
|
||||
$user_id = $user_profile->sid ? preg_replace("/[^0-9a-z_]+/i", "", $user_profile->sid) : get_social_convert_id($user_profile->identifier, $provider_name);
|
||||
$user_phone = $user_profile->phone;
|
||||
|
||||
if(! $user_nick) {
|
||||
$tmp = explode('_', $user_id);
|
||||
|
||||
@ -3,6 +3,10 @@ include_once('./_common.php');
|
||||
include_once(G5_LIB_PATH.'/register.lib.php');
|
||||
include_once(G5_LIB_PATH.'/mailer.lib.php');
|
||||
|
||||
if (!($w == '' || $w == 'u')) {
|
||||
alert('w 값이 제대로 넘어오지 않았습니다.');
|
||||
}
|
||||
|
||||
if( ! $config['cf_social_login_use'] ){
|
||||
alert('소셜 로그인을 사용하지 않습니다.', G5_URL);
|
||||
}
|
||||
@ -27,6 +31,7 @@ $mb_password_re = isset($_POST['mb_password_re']) ? trim($_POST['mb_password_re'
|
||||
$mb_nick = isset($_POST['mb_nick']) ? trim(strip_tags($_POST['mb_nick'])) : '';
|
||||
$mb_email = isset($_POST['mb_email']) ? trim($_POST['mb_email']) : '';
|
||||
$mb_name = isset($_POST['mb_name']) ? clean_xss_tags(trim(strip_tags($_POST['mb_name']))) : '';
|
||||
$mb_hp = isset($_POST['mb_hp']) ? trim($_POST['mb_hp']) : '';
|
||||
$mb_email = get_email_address($mb_email);
|
||||
|
||||
// 이름, 닉네임에 utf-8 이외의 문자가 포함됐다면 오류
|
||||
@ -93,6 +98,57 @@ $mb_mailling = (isset($_POST['mb_mailling']) && $_POST['mb_mailling']) ? 1 : 0;
|
||||
//회원 정보 공개
|
||||
$mb_open = (isset($_POST['mb_open']) && $_POST['mb_open']) ? 1 : 0;
|
||||
|
||||
//===============================================================
|
||||
// 본인확인
|
||||
//---------------------------------------------------------------
|
||||
if($config['cf_cert_use']) {
|
||||
$mb_hp = hyphen_hp_number($mb_hp);
|
||||
if($config['cf_cert_use'] && get_session('ss_cert_type') && get_session('ss_cert_dupinfo')) {
|
||||
// 중복체크
|
||||
$sql = " select mb_id from {$g5['member_table']} where mb_id <> '{$member['mb_id']}' and mb_dupinfo = '".get_session('ss_cert_dupinfo')."' ";
|
||||
$row = sql_fetch($sql);
|
||||
if (!empty($row['mb_id'])) {
|
||||
alert("입력하신 본인확인 정보로 가입된 내역이 존재합니다.");
|
||||
}
|
||||
}
|
||||
|
||||
$sql_certify = '';
|
||||
$md5_cert_no = get_session('ss_cert_no');
|
||||
$cert_type = get_session('ss_cert_type');
|
||||
if ($config['cf_cert_use'] && $cert_type && $md5_cert_no) {
|
||||
// 해시값이 같은 경우에만 본인확인 값을 저장한다.
|
||||
if ($cert_type == 'ipin' && get_session('ss_cert_hash') == md5($mb_name.$cert_type.get_session('ss_cert_birth').$md5_cert_no)) { // 아이핀일때 hash 값 체크 hp미포함
|
||||
$sql_certify .= " , mb_hp = '{$mb_hp}' ";
|
||||
$sql_certify .= " , mb_certify = '{$cert_type}' ";
|
||||
$sql_certify .= " , mb_adult = '".get_session('ss_cert_adult')."' ";
|
||||
$sql_certify .= " , mb_birth = '".get_session('ss_cert_birth')."' ";
|
||||
$sql_certify .= " , mb_sex = '".get_session('ss_cert_sex')."' ";
|
||||
$sql_certify .= " , mb_dupinfo = '".get_session('ss_cert_dupinfo')."' ";
|
||||
if($w == 'u')
|
||||
$sql_certify .= " , mb_name = '{$mb_name}' ";
|
||||
} else if($cert_type != 'ipin' && get_session('ss_cert_hash') == md5($mb_name.$cert_type.get_session('ss_cert_birth').$mb_hp.$md5_cert_no)) { // 간편인증, 휴대폰일때 hash 값 체크 hp포함
|
||||
$sql_certify .= " , mb_hp = '{$mb_hp}' ";
|
||||
$sql_certify .= " , mb_certify = '{$cert_type}' ";
|
||||
$sql_certify .= " , mb_adult = '".get_session('ss_cert_adult')."' ";
|
||||
$sql_certify .= " , mb_birth = '".get_session('ss_cert_birth')."' ";
|
||||
$sql_certify .= " , mb_sex = '".get_session('ss_cert_sex')."' ";
|
||||
$sql_certify .= " , mb_dupinfo = '".get_session('ss_cert_dupinfo')."' ";
|
||||
if($w == 'u')
|
||||
$sql_certify .= " , mb_name = '{$mb_name}' ";
|
||||
}else {
|
||||
alert('본인인증된 정보와 개인정보가 일치하지않습니다. 다시시도 해주세요');
|
||||
}
|
||||
} else {
|
||||
if (get_session("ss_reg_mb_name") != $mb_name || get_session("ss_reg_mb_hp") != $mb_hp) {
|
||||
$sql_certify .= " , mb_hp = '{$mb_hp}' ";
|
||||
$sql_certify .= " , mb_certify = '' ";
|
||||
$sql_certify .= " , mb_adult = 0 ";
|
||||
$sql_certify .= " , mb_birth = '' ";
|
||||
$sql_certify .= " , mb_sex = '' ";
|
||||
}
|
||||
}
|
||||
//===============================================================
|
||||
}
|
||||
// 회원정보 입력
|
||||
$sql = " insert into {$g5['member_table']}
|
||||
set mb_id = '{$mb_id}',
|
||||
@ -110,12 +166,17 @@ $sql = " insert into {$g5['member_table']}
|
||||
mb_mailling = '{$mb_mailling}',
|
||||
mb_sms = '0',
|
||||
mb_open = '{$mb_open}',
|
||||
mb_open_date = '".G5_TIME_YMD."' ";
|
||||
|
||||
mb_open_date = '".G5_TIME_YMD."'
|
||||
{$sql_certify} ";
|
||||
$result = sql_query($sql, false);
|
||||
|
||||
if($result) {
|
||||
|
||||
|
||||
if($cert_type == 'ipin' && get_session('ss_cert_hash') == md5($mb_name.$cert_type.get_session('ss_cert_birth').$md5_cert_no)) { // 아이핀일때 hash 값 체크 hp미포함)
|
||||
insert_member_cert_history($mb_id, $mb_name, $mb_hp, get_session('ss_cert_birth'), get_session('ss_cert_type') ); // 본인인증 후 정보 수정 시 내역 기록
|
||||
}else if($cert_type != 'ipin' && get_session('ss_cert_hash') == md5($mb_name.$cert_type.get_session('ss_cert_birth').$mb_hp.$md5_cert_no)) { // 간편인증, 휴대폰일때 hash 값 체크 hp포함
|
||||
insert_member_cert_history($mb_id, $mb_name, $mb_hp, get_session('ss_cert_birth'), get_session('ss_cert_type') ); // 본인인증 후 정보 수정 시 내역 기록
|
||||
}
|
||||
// 회원가입 포인트 부여
|
||||
insert_point($mb_id, $config['cf_register_point'], '회원가입 축하', '@member', $mb_id, '회원가입');
|
||||
|
||||
@ -184,6 +245,50 @@ if($result) {
|
||||
mailer($config['cf_admin_email_name'], $config['cf_admin_email'], $mb_email, $subject, $content, 1);
|
||||
}
|
||||
|
||||
// 신규회원 쿠폰발생
|
||||
if($w == '' && $default['de_member_reg_coupon_use'] && $default['de_member_reg_coupon_term'] > 0 && $default['de_member_reg_coupon_price'] > 0) {
|
||||
$j = 0;
|
||||
$create_coupon = false;
|
||||
|
||||
do {
|
||||
$cp_id = get_coupon_id();
|
||||
|
||||
$sql3 = " select count(*) as cnt from {$g5['g5_shop_coupon_table']} where cp_id = '$cp_id' ";
|
||||
$row3 = sql_fetch($sql3);
|
||||
|
||||
if(!$row3['cnt']) {
|
||||
$create_coupon = true;
|
||||
break;
|
||||
} else {
|
||||
if($j > 20)
|
||||
break;
|
||||
}
|
||||
} while(1);
|
||||
|
||||
if($create_coupon) {
|
||||
$cp_subject = '신규 회원가입 축하 쿠폰';
|
||||
$cp_method = 2;
|
||||
$cp_target = '';
|
||||
$cp_start = G5_TIME_YMD;
|
||||
$cp_end = date("Y-m-d", (G5_SERVER_TIME + (86400 * ((int)$default['de_member_reg_coupon_term'] - 1))));
|
||||
$cp_type = 0;
|
||||
$cp_price = $default['de_member_reg_coupon_price'];
|
||||
$cp_trunc = 1;
|
||||
$cp_minimum = $default['de_member_reg_coupon_minimum'];
|
||||
$cp_maximum = 0;
|
||||
|
||||
$sql = " INSERT INTO {$g5['g5_shop_coupon_table']}
|
||||
( cp_id, cp_subject, cp_method, cp_target, mb_id, cp_start, cp_end, cp_type, cp_price, cp_trunc, cp_minimum, cp_maximum, cp_datetime )
|
||||
VALUES
|
||||
( '$cp_id', '$cp_subject', '$cp_method', '$cp_target', '$mb_id', '$cp_start', '$cp_end', '$cp_type', '$cp_price', '$cp_trunc', '$cp_minimum', '$cp_maximum', '".G5_TIME_YMDHIS."' ) ";
|
||||
|
||||
$res = sql_query($sql, false);
|
||||
|
||||
if($res)
|
||||
set_session('ss_member_reg_coupon', 1);
|
||||
}
|
||||
}
|
||||
|
||||
// 사용자 코드 실행
|
||||
@include_once ($member_skin_path.'/register_form_update.tail.skin.php');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user