내 아이디 관련 정보 수정 이력 열람 기능 탑재

◆ 안내사항
- 현재는 회원 정보 수정(관리자 x)에서 비밀번호를 수정하는 경우만 적용토록 설정
- 소스 수정을 통해 기타 정보 수정 시에도 로그 기록 명시 가능 - '내 아이디 관련 정보 수정 이력 열람하기' 페이지의 CSS 에 대한 안내
- 당해 페이지에서 테이블 영역의 CSS는 'Nuli' 를 참조했음을 알려드립니다. - 라이센스: MIT
- 기술지원: 개인적인 기술지원 無
- '내 아이디 관련 정보 수정 이력 열람하기' 에서 데이터가 있을 경우만 노출
- 참조: 로그인 영역 등에서 'member_Permute_log.php' 로 이동토록 설정하여 유저가 관련 페이지에 접속할 수 있도록 안내 필요
◆ 작업파일
- /bbs/member_Permute_log.php = 내 아이디 관련 정보 수정 이력 열람하기(신규 생성)
- /bbs/register_form_update.php = DB 입력 부분 추가
◆ 소스파일
- 파일 폴더: /bbs/
- 파일명: member_Permute_log.php
[code]<?php
include_once('./_common.php');
$g5['title'] = "내 아이디 관련 정보 수정 이력 열람하기";
include_once('./_head.php');
if(!$member['mb_id']){
$link = G5_URL;
exit("<script>alert('로그인이 필요합니다.'); location.href = '$link';</script>");
}
?>
<style>
/* cf: https://nuli.navercorp.com/sharing/ui/patternTable/3 */
.tbl_type,.tbl_type th,.tbl_type td{border:0; font-family:'나눔고딕'; position:relative; top:5px; }
.tbl_type{width:100%;border-bottom:2px solid #dcdcdc;font-size:11px;text-align:center}
.tbl_type caption{display:none}
.tbl_type th{padding:7px 0 4px;background-color: #415ee0;color: #fff;font-family:'돋움',dotum;font-size:12px;font-weight:bold;}
.tbl_type tr {height:40px; background:#fff; }
.tbl_type td{padding:6px 0 4px;border-top:1px solid #e5e5e5;color:#4c4c4c}
</style>
<!-- header notice !-->
<div style='padding:10px; background:#fff; bodrer:1px solid #d6d6d6; text-align:center; font-weight:bold; color:red;'>[Notice] 본 정보 이력 中 비밀번호 변경과 관련하여 설명드리면, 당해 변경에 대해서는 기록만 서버에 저장되고, 직접적인 비밀번호는 저장되지 않습니다.</div>
<!-- header notice !-->
<table cellspacing="0" border="1" summary="내 아이디 관련 정보 수정 이력 열람하기" class="tbl_type">
<caption>내 아이디 관련 정보 수정 이력 열람하기</caption>
<colgroup>
<col width="5%"><col><col width="18%" span="6">
</colgroup>
<thead>
<tr>
<th scope="col">No</th>
<th scope="col">회원아이디</th>
<th scope="col">유형</th>
<th scope="col">변경 시도 IP</th>
<th scope="col">변경 일자</th>
</tr>
</thead>
<tbody>
<?php
$mb_id2 = $member['mb_id'];
$query = sql_query("select mb_id, type, ip, date from member_Permute_log where mb_id = '$mb_id2' order by date desc ");
for($i=1; $i<=$row=sql_fetch_array($query); $i++){
if($row){
?>
<tr>
<td><?=$i;?></td>
<td><?=$row['mb_id'];?></td>
<td><?=$row['type'];?></td>
<td><?=$row['ip'];?></td>
<td><?=$row['date'];?></td>
</tr>
<?php } ?>
<?php } ?>
</tbody>
</table>
<!-- footer notice !-->
<div style='position:relative; top:30px; padding:10px; background:#fff; bodrer:1px solid #d6d6d6; text-align:center; font-weight:bold; color:green;'>변경된 기록에 대해 서버 상에 기록이 있다면 별도 메세지 없이 출력되지 않도록 설계됐습니다.</div>
<!-- footer notice !-->
<?php
include_once('./_tail.php');
?>[/code]
- 파일 폴더: /bbs/
- 파일명: register_form_update.php
[code]
$sql_password = "";
if ($mb_password)
$sql_password = " , mb_password = '".get_encrypt_string($mb_password)."' ";
[/code]
※ 적용위치 '$sql_password' 하단
[code]
// 비밀번호 변경 이력 추가하기 //
if($mb_password):
// table name: member_Permute_log
/*
idx = null
mb_id = 로그인 회원 아이디
type = 유형(비밀번호 등)
ip = 로그인 회원 IP
date = 시간(yyyy-mm-dd H:i:s)
*/
$mb_password_log_mb_id = $member['mb_id'];
$mb_password_log_ip = $_SERVER['REMOTE_ADDR'];
$mb_password_log_date = date("Y-m-d H:i:s");
$mb_password_log_sql = sql_query(" insert into member_Permute_log
set idx = NULL,
mb_id = '$mb_password_log_mb_id',
type = '비밀번호 변경',
ip = '$mb_password_log_ip',
date = '$mb_password_log_date' ");
endif;
// 비밀번호 변경 이력 추가하기 끝 //
[/code]
◆ Mysql DB(INDEX: mb_id)
[code]
CREATE TABLE IF NOT EXISTS `member_permute_log` (
`idx` int(255) NOT NULL AUTO_INCREMENT,
`mb_id` varchar(255) NOT NULL,
`type` varchar(255) NOT NULL,
`ip` varchar(255) NOT NULL,
`date` varchar(255) NOT NULL,
PRIMARY KEY (`idx`),
KEY `mb_id` (`mb_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
[/code]
댓글 4개
닉네임 변경이력도 추가하려면 어떻게 해야 할까요?
아래 소스에서 현재는 패스워드를 기준으로 하게 돼 있는데 이를 닉네임으로 변경하면 되고, 리스트 출력 페이지에서는 따로 패스워드 등 출력을 구분하지 않기에 DB에 넣어만 주시면 정상적으로 나올 것입니다.
[code] // 비밀번호 변경 이력 추가하기 //
if($mb_password):
// table name: member_Permute_log
/*
idx = null
mb_id = 로그인 회원 아이디
type = 유형(비밀번호 등)
ip = 로그인 회원 IP
date = 시간(yyyy-mm-dd H:i:s)
*/
$mb_password_log_mb_id = $member['mb_id'];
$mb_password_log_ip = $_SERVER['REMOTE_ADDR'];
$mb_password_log_date = date("Y-m-d H:i:s");
$mb_password_log_sql = sql_query(" insert into member_Permute_log
set idx = NULL,
mb_id = '$mb_password_log_mb_id',
type = '비밀번호 변경',
ip = '$mb_password_log_ip',
date = '$mb_password_log_date' ");
endif;
// 비밀번호 변경 이력 추가하기 끝 //[/code]
게시판 목록
그누보드5 팁자료실
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 공지 | 3년 전 | 4406 | ||
| 2634 | 6개월 전 | 609 | ||
| 2633 | 6개월 전 | 600 | ||
| 2632 |
|
6개월 전 | 508 | |
| 2631 | 6개월 전 | 570 | ||
| 2630 |
세르반데스
|
6개월 전 | 538 | |
| 2629 | 6개월 전 | 728 | ||
| 2628 | 6개월 전 | 412 | ||
| 2627 | 7개월 전 | 418 | ||
| 2626 |
이슈DEV
|
7개월 전 | 639 | |
| 2625 |
welcome
|
7개월 전 | 646 | |
| 2624 |
이슈DEV
|
7개월 전 | 449 | |
| 2623 | 7개월 전 | 407 | ||
| 2622 | 7개월 전 | 496 | ||
| 2621 | 7개월 전 | 353 | ||
| 2620 |
|
7개월 전 | 370 | |
| 2619 | 7개월 전 | 479 | ||
| 2618 | 7개월 전 | 466 | ||
| 2617 | 7개월 전 | 556 | ||
| 2616 | 7개월 전 | 679 | ||
| 2615 | 8개월 전 | 583 | ||
| 2614 | 8개월 전 | 411 | ||
| 2613 |
바닐라코드
|
8개월 전 | 731 | |
| 2612 | 8개월 전 | 594 | ||
| 2611 | 8개월 전 | 731 | ||
| 2610 | 8개월 전 | 969 | ||
| 2609 | 8개월 전 | 508 | ||
| 2608 | 8개월 전 | 654 | ||
| 2607 | 8개월 전 | 631 | ||
| 2606 | 8개월 전 | 577 | ||
| 2605 | 8개월 전 | 602 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기