diff --git a/f_install/sql/common_schema.sql b/f_install/sql/common_schema.sql index 06722bcd..552f1046 100644 --- a/f_install/sql/common_schema.sql +++ b/f_install/sql/common_schema.sql @@ -48,7 +48,7 @@ CREATE TABLE `member_log` ( `id` BIGINT(20) NOT NULL AUTO_INCREMENT, `member_no` INT(11) NOT NULL, `date` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - `action_type` ENUM('reg','try_login','login','logout','oauth','change_pw','make_general','access_server') NOT NULL, + `action_type` ENUM('reg','try_login','login','logout','oauth','change_pw','make_general','access_server','delete') NOT NULL, `action` TEXT NULL DEFAULT NULL COMMENT 'JSON', PRIMARY KEY (`id`), INDEX `action` (`member_no`, `action_type`, `date`), diff --git a/i_entrance/Action.js b/i_entrance/Action.js index 67ae1c52..aa98a304 100644 --- a/i_entrance/Action.js +++ b/i_entrance/Action.js @@ -43,7 +43,6 @@ var serverLoginTemplate = "\ "; function Entrance_Import() { - ImportAction("../i_entrance/manage/Action.js"); } function Entrance_Init() { @@ -108,7 +107,7 @@ function Entrance_drawServerList(serverInfos){ TemplateEngine(serverTextInfo, game) ); - if(result.me){ + if(result.me && result.me.length > 1){ var me = result.me; me.serverPath = serverPath; $serverHtml.append( diff --git a/i_entrance/j_delete_me.php b/i_entrance/j_delete_me.php new file mode 100644 index 00000000..d900acc0 --- /dev/null +++ b/i_entrance/j_delete_me.php @@ -0,0 +1,73 @@ +isLoggedIn()) { + returnJson([ + 'result'=>false, + 'reason'=>'로그인되지 않았습니다.' + ]); +} + +// 외부 파라미터 +// $_POST['pw'] : PW +$pw = $_POST['pw']; + +if(!$pw){ + returnJson([ + 'result'=>false, + 'reason'=>'패스워드를 입력해주세요.' + ]); +} + +//TODO: 탈퇴 처리하되 한달간 유지. +$db = getRootDB(); + +$userInfo = $db->queryFirstRow('SELECT oauth_id, oauth_type, email, delete_after FROM MEMBER '. + 'WHERE `no`=%i and pw=sha2(concat(salt, %s, salt), 512)', + $SESSION->NoMember(), $pw); + +if(!$userInfo){ + returnJson([ + 'result'=>false, + 'reason'=>'현재 비밀번호가 일치하지 않습니다.' + ]); +} + +if($userInfo['delete_after']){ + returnJson([ + 'result'=>false, + 'reason'=>'이미 탈퇴 처리되어있습니다.' + ]); +} + +$db->update('member',[ + 'delete_after'=>_Time::DatetimeFromNowMinute(60*24*30) +], 'no=%i', $SESSION->NoMember()); + +if(!$db->affectedRows()){ + returnJson([ + 'result'=>false, + 'reason'=>'알 수 없는 이유로 탈퇴에 실패했습니다.' + ]); +} + + + +$db->insert('member_log', [ + 'member_no'=>$SESSION->NoMember(), + 'action_type'=>'delete' +]); + +$SESSION->logout(); +unset($_SESSION['access_token']); +setcookie("hello", "", time()-3600); + +returnJson([ + 'result'=>true, + 'reason'=>'success' +]); diff --git a/i_entrance/j_icon_delete.php b/i_entrance/j_icon_delete.php index 933fe14f..a9b517aa 100644 --- a/i_entrance/j_icon_delete.php +++ b/i_entrance/j_icon_delete.php @@ -43,14 +43,6 @@ if($dt == $rf) { 'IMGSVR'=>0, ], 'NO=%i', $SESSION->NoMember()); - //TODO: 각 세부 서버가 '열린 경우' 이미지를 갱신하도록 처리 - //Token을 받아 처리하는 형식이면 가능할듯. - /* - for($i=0; $i < ; $i++) { - Update('general', "PICTURE='default.jpg', IMGSVR=0", "NPC=0 AND USER_ID='{$member['ID']}'"); - } - */ - $servers = []; foreach(getServerConfigList() as $key=>$server){ diff --git a/i_entrance/manage/Action.js b/i_entrance/manage/Action.js deleted file mode 100644 index e69de29b..00000000 diff --git a/i_entrance/manage/Frame.php b/i_entrance/manage/Frame.php deleted file mode 100644 index 5bd407bd..00000000 --- a/i_entrance/manage/Frame.php +++ /dev/null @@ -1,54 +0,0 @@ - - -
jpg,png,gif 파일 64 x 64 크기만 가능합니다. -서버최적화를 위해 신규에서 기존으로 약 월1회 저장됩니다. -브라우저의 임시파일을 삭제하셔야 제대로 나옵니다. -새로 캐릭터를 생성할때부터 적용됩니다. -탈퇴신청시 1개월간 정보가 보존되며, -1개월간 재가입이 불가능합니다.-