본인인증 내역 : 본인 인증시 회원별 히스토리 기록 테이블 추가, 기능 추가

This commit is contained in:
projectSylas
2021-10-07 05:44:00 +00:00
parent cbd9fc4a86
commit fc01d803f3
7 changed files with 125 additions and 3 deletions

View File

@ -173,6 +173,28 @@ if(!isset($mb['mb_email_certify2'])) {
sql_query(" ALTER TABLE {$g5['member_table']} ADD `mb_email_certify2` varchar(255) NOT NULL DEFAULT '' AFTER `mb_email_certify` ", false);
}
// 본인인증 내역 테이블 정보가 dbconfig에 없으면 소셜 테이블 정의
if( !isset($g5['member_cert_history']) ){
$g5['member_cert_history_table'] = G5_TABLE_PREFIX.'member_cert_history';
}
// 멤버 본인인증 정보 변경 내역 테이블 없을 경우 생성
if(isset($g5['member_cert_history_table']) && !sql_query(" DESC {$g5['member_cert_history_table']} ", false)) {
sql_query(" CREATE TABLE IF NOT EXISTS `{$g5['member_cert_history_table']}` (
`ch_id` int(11) NOT NULL auto_increment,
`mb_id` varchar(20) NOT NULL DEFAULT '',
`ch_name` varchar(255) NOT NULL DEFAULT '',
`ch_hp` varchar(255) NOT NULL DEFAULT '',
`ch_birth` varchar(255) NOT NULL DEFAULT '',
`ch_type` varchar(20) NOT NULL DEFAULT '',
`ch_datetime` datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY (`ch_id`),
KEY `mb_id` (`mb_id`)
) ", true);
}
$sql = "select * from {$g5['member_cert_history_table']} where mb_id = '{$mb_id}' order by ch_id asc";
$mb_cert_history = sql_query($sql);
if ($mb['mb_intercept_date']) $g5['title'] = "차단된 ";
else $g5['title'] .= "";
$g5['title'] .= '회원 '.$html_title;
@ -346,6 +368,34 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
<th scope="row"><label for="mb_memo">메모</label></th>
<td colspan="3"><textarea name="mb_memo" id="mb_memo"><?php echo $mb['mb_memo'] ?></textarea></td>
</tr>
<?php
$cnt = 0;
while ($row = sql_fetch_array($mb_cert_history)) {
$cnt++;
switch($row['ch_type']){
case 'sa':
$cert_type = '통합인증';
break;
case 'hp':
$cert_type = '휴대폰';
break;
case 'ipin':
$cert_type = '아이핀';
break;
}
?>
<tr>
<th scope="row"><?php if($cnt == 1) { ?><label for="mb_cert_history">본인인증 내역</label><?php } ?></th>
<td><?php echo $row['mb_id']; ?></td>
<td><?php echo $row['ch_name']; ?></td>
<td><?php echo $row['ch_hp']; ?></td>
<td><?php echo $row['ch_birth']; ?></td>
<td><?php echo $cert_type; ?></td>
<td><?php echo $row['ch_datetime']; ?></td>
</tr>
<?php } ?>
<?php if ($w == 'u') { ?>
<tr>

View File

@ -62,7 +62,13 @@ if ($config['cf_cert_use'] && $cert_type && $md5_cert_no) {
}
$sql = "update {$g5['member_table']} set {$sql_certify} where mb_id = '{$mb_id}'";
sql_query($sql);
$result = sql_query($sql, false);
if($result){
if(get_session('ss_cert_hash') == md5($mb_name.$cert_type.get_session('ss_cert_birth').$md5_cert_no)) {
insert_member_cert_history($mb_id, $mb_name, $mb_hp, get_session('ss_cert_birth'), get_session('ss_cert_type') ); // 본인인증 후 정보 수정 시 내역 기록
}
}
//===============================================================

View File

@ -304,6 +304,10 @@ if ($w == '') {
set_session('ss_mb_reg', $mb_id);
if(get_session('ss_cert_hash') == md5($mb_name.$cert_type.get_session('ss_cert_birth').$md5_cert_no)) {
insert_member_cert_history($mb_id, $mb_name, $mb_hp, get_session('ss_cert_birth'), get_session('ss_cert_type') ); // 본인인증 후 정보 인서트시 내역 기록
}
} else if ($w == 'u') {
if (!trim(get_session('ss_mb_id')))
alert('로그인 되어 있지 않습니다.');
@ -361,6 +365,10 @@ if ($w == '') {
{$sql_certify}
where mb_id = '$mb_id' ";
sql_query($sql);
if(get_session('ss_cert_hash') == md5($mb_name.$cert_type.get_session('ss_cert_birth').$md5_cert_no)) {
insert_member_cert_history($mb_id, $mb_name, $mb_hp, get_session('ss_cert_birth'), get_session('ss_cert_type') ); // 본인인증 후 정보 수정 시 내역 기록
}
}

View File

@ -365,6 +365,25 @@ CREATE TABLE IF NOT EXISTS `g5_cert_history` (
-- --------------------------------------------------------
--
-- Table structure for table `g5_cert_history`
--
DROP TABLE IF EXISTS `g5_member_cert_history`;
CREATE TABLE IF NOT EXISTS `g5_member_cert_history` (
`ch_id` int(11) NOT NULL auto_increment,
`mb_id` varchar(20) NOT NULL DEFAULT '',
`ch_name` varchar(255) NOT NULL DEFAULT '',
`ch_hp` varchar(255) NOT NULL DEFAULT '',
`ch_birth` varchar(255) NOT NULL DEFAULT '',
`ch_type` varchar(20) NOT NULL DEFAULT '',
`ch_datetime` datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY (`ch_id`),
KEY `mb_id` (`mb_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `g5_group`
--

View File

@ -592,6 +592,7 @@ fwrite($f, "\$g5['faq_master_table'] = G5_TABLE_PREFIX.'faq_master'; // 자주
fwrite($f, "\$g5['new_win_table'] = G5_TABLE_PREFIX.'new_win'; // 새창 테이블\n");
fwrite($f, "\$g5['menu_table'] = G5_TABLE_PREFIX.'menu'; // 메뉴관리 테이블\n");
fwrite($f, "\$g5['social_profile_table'] = G5_TABLE_PREFIX.'member_social_profiles'; // 소셜 로그인 테이블\n");
fwrite($f, "\$g5['member_cert_history_table'] = G5_TABLE_PREFIX.'member_cert_history'; // 본인인증 변경내역 테이블\n");
if($g5_shop_install) {
fwrite($f, "\n");

View File

@ -2764,6 +2764,41 @@ function insert_cert_history($mb_id, $company, $method)
sql_query($sql);
}
// 본인확인 변경내역 기록
function insert_member_cert_history($mb_id, $name, $hp, $birth, $type)
{
global $g5;
// 본인인증 내역 테이블 정보가 dbconfig에 없으면 소셜 테이블 정의
if( !isset($g5['member_cert_history']) ){
$g5['member_cert_history_table'] = G5_TABLE_PREFIX.'member_cert_history';
}
// 멤버 본인인증 정보 변경 내역 테이블 없을 경우 생성
if(isset($g5['member_cert_history_table']) && !sql_query(" DESC {$g5['member_cert_history_table']} ", false)) {
sql_query(" CREATE TABLE IF NOT EXISTS `{$g5['member_cert_history_table']}` (
`ch_id` int(11) NOT NULL auto_increment,
`mb_id` varchar(20) NOT NULL DEFAULT '',
`ch_name` varchar(255) NOT NULL DEFAULT '',
`ch_hp` varchar(255) NOT NULL DEFAULT '',
`ch_birth` varchar(255) NOT NULL DEFAULT '',
`ch_type` varchar(20) NOT NULL DEFAULT '',
`ch_datetime` datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY (`ch_id`),
KEY `mb_id` (`mb_id`)
) ", true);
}
$sql = " insert into {$g5['member_cert_history_table']}
set mb_id = '{$mb_id}',
ch_name = '{$name}',
ch_hp = '{$hp}',
ch_birth = '{$birth}',
ch_type = '{$type}',
ch_datetime = '".G5_TIME_YMD." ".G5_TIME_HIS."'";
sql_query($sql);
}
// 인증시도회수 체크
function certify_count_check($mb_id, $type)
{

View File

@ -101,7 +101,7 @@ $mb_open = (isset($_POST['mb_open']) && $_POST['mb_open']) ? 1 : 0;
//===============================================================
// 본인확인
//---------------------------------------------------------------
if($config['cf_cert_use'] && $config['cf_cert_req']){
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')) {
// 중복체크
@ -166,7 +166,10 @@ $sql = " insert into {$g5['member_table']}
$result = sql_query($sql, false);
if($result) {
if(get_session('ss_cert_hash') == md5($mb_name.$cert_type.get_session('ss_cert_birth').$md5_cert_no)) {
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, '회원가입');