테스트 사이트 - 개발 중인 베타 버전입니다

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

· 6년 전 · 4629 · 4

1982703122_1568991240.397.png

 

◆ 안내사항

  • 현재는 회원 정보 수정(관리자 x)에서 비밀번호를 수정하는 경우만 적용토록 설정
    - 소스 수정을 통해 기타 정보 수정 시에도 로그 기록 명시 가능
  • '내 아이디 관련 정보 수정 이력 열람하기' 페이지의 CSS 에 대한 안내
    - 당해 페이지에서 테이블 영역의 CSS는 'Nuli' 를 참조했음을 알려드립니다.
  • 라이센스: MIT
  • 기술지원: 개인적인 기술지원 無
  • '내 아이디 관련 정보 수정 이력 열람하기' 에서 데이터가 있을 경우만 노출
  • 참조: 로그인 영역 등에서 'member_Permute_log.php' 로 이동토록 설정하여 유저가 관련 페이지에 접속할 수 있도록 안내 필요

 

◆ 작업파일

  1. /bbs/member_Permute_log.php = 내 아이디 관련 정보 수정 이력 열람하기(신규 생성)
  2. /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개

오 이거 적용한번해봐야겠네요 감사합니다.
6년 전
감사합니다
닉네임 변경이력도 추가하려면 어떻게 해야 할까요?
6년 전
/bbs/register_form_update.php 파일을 수정하시면 됩니다.
아래 소스에서 현재는 패스워드를 기준으로 하게 돼 있는데 이를 닉네임으로 변경하면 되고, 리스트 출력 페이지에서는 따로 패스워드 등 출력을 구분하지 않기에 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]
6년 전
제가 초보라서 닉네임 적용소스 부탁드려도 될까요?

게시글 목록

번호 제목
24318
24317
24315
24309
24294
24293
24277
24262
24260
24253
24251
24236
24233
24228
24226
24221
24214
24203
24201
24199
24196
24195
24194
24192
24191
24187
24185
24183
24172
24168