npc_login 우회 기능 삭제

This commit is contained in:
2018-02-17 23:47:38 +09:00
parent 6610662f74
commit 47bdb068d5
2 changed files with 0 additions and 123 deletions
-46
View File
@@ -1,46 +0,0 @@
<?php
include "lib.php";
include "func.php";
//NOTE:관리자의 경우 NPC로그인을 user_id는 유지하되 no값만 바꾸는 식으로 가능하지 않을까?
$connect=dbConn();
?>
<html>
<head>
<title>NPC로그인</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<link rel=stylesheet href=css/common.css type=text/css>
<?php require('analytics.php'); ?>
</head>
<body>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
<tr><td align=center id=bg1>삼국지 모의전투 PHP (유기체서버)</td></tr>
<tr>
<td align=center>
<form name=form1 action=npc_login_process.php method=post>
<table cellpadding=0 cellspacing=0 width=600 height=100>
<tr>
<td width=49% align=right>ID</td>
<td width=2%></td>
<td width=49%><input style=color:white;background-color:black; type=text name=id maxlength=12 size=12></td>
</tr>
<tr>
<td align=right>비밀번호</td>
<td></td>
<td><input style=color:white;background-color:black; type=password name=pw maxlength=12 size=12></td>
</tr>
<tr>
<td align=right><input type=submit value=로그인></td>
<td></td>
<td>-</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</body>
</html>
-77
View File
@@ -1,77 +0,0 @@
<?php
include "lib.php";
include "func.php";
$connect = dbConn();
//TODO: 폐기
$id = $_POST['id'];
$pw = $_POST['pw'];
$pw = md5($pw.$pw);
//회원 테이블에서 정보확인
$query="select no from general where user_id='$id'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me2 = MYDB_fetch_array($result);
//회원 테이블에서 정보확인
$query="select no,name,nation,block,killturn from general where user_id='$id' and password='$pw'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
if(!$me2) {
MessageBox("캐릭터가 없습니다!!!");
//echo "<script>location.replace('index.php');</script>";
echo 'index.php';//TODO:debug all and replace
} elseif(!$me) {
MessageBox("아이디나 암호가 올바르지 않습니다!!!");
//echo "<script>location.replace('index.php');</script>";
echo 'index.php';//TODO:debug all and replace
} else {
switch($me['block']) {
case 1:
MessageBox("비매너 발언으로 인해, 발언권이 제한됩니다."); break;
case 2:
MessageBox("현재 블럭된 계정입니다. 턴 실행이 제한됩니다.");
MessageBox("절대 1계정만 사용하십시오! {$me['killturn']}시간 후 재등록 가능합니다."); break;
case 3:
MessageBox("현재 블럭된 계정입니다. 발언권과 턴 실행이 제한됩니다.");
MessageBox("절대 1계정만 사용하십시오! {$me['killturn']}시간 후 재등록 가능합니다."); break;
}
$_SESSION['p_id'] = $id;
$_SESSION['p_ip'] = getenv("REMOTE_ADDR");
$_SESSION['p_time'] = time();
$date = date('Y-m-d H:i:s');
$query="update general set logcnt=logcnt+1,ip='{$_SESSION['p_ip']}',lastconnect='$date',conmsg='$conmsg' where owner='{$_SESSION['noMember']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//echo "<script>window.top.location.replace('./');</script>";
echo './';//TODO:debug all and replace
$date2 = substr($date, 0, 10);
$fp = fopen("logs/_{$date2}-login.txt", "a");
$msg = _String::Fill2($date,20," ")._String::Fill2($id,13," ")._String::Fill2($me['name'],13," ")._String::Fill2($_SESSION['p_ip'],16," ");
fwrite($fp, $msg."\n");
fclose($fp);
}
function DeleteSession() {
$session_path = "data/session"; // 세션이저장된 디렉토리
if(!$dir=@opendir($session_path)) echo "디렉토리를 열지못했습니다.";
while($file=@readdir($dir)) {
if(!strstr($file,'sess_')) continue;
if(strpos($file,'sess_')!=0) continue;
if (!$atime=@fileatime("$session_path/$file")) continue;
if (time() > $atime + 86400) { // 10대시 지난시간을 초로 계산해서 적어주시면 됩니다.
// $return = (@unlink("$session_path/$file"));
@unlink("$session_path/$file");
}
}
closedir($dir);
}
MYDB_close($connect);