login_process를 일단 변경
func_string의 Fill 계열 함수 마저 static으로 변경 전메, 갠메 파일 열기 실패시 에러 반환 main.php 파일에 jQuery + js 파일 열수 있도록
This commit is contained in:
@@ -3454,6 +3454,9 @@ function MsgFile($skin, $bg, $nation=0, $level=0) {
|
||||
case 3: $bgcolor = "336600"; $count = 20; $fl = "_nation_msg{$nation}.txt"; break;
|
||||
}
|
||||
|
||||
if(!file_exists("logs/{$fl}")){
|
||||
return;
|
||||
}
|
||||
$fp = @fopen("logs/{$fl}", "r");
|
||||
@fseek($fp, -$count*300, SEEK_END);
|
||||
$file = @fread($fp, $count*300);
|
||||
|
||||
+1
-1
@@ -237,7 +237,7 @@ class _String {
|
||||
return $string;
|
||||
}
|
||||
|
||||
function Fill($str, $maxsize, $ch) {
|
||||
public static function Fill($str, $maxsize, $ch) {
|
||||
$size = strlen($str);
|
||||
|
||||
$count = ($maxsize - $size) / 2;
|
||||
|
||||
+41
-38
@@ -25,45 +25,48 @@ $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
if(!$member) {
|
||||
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_name'] = $me['name'];
|
||||
$_SESSION['p_nation'] = $me['nation'];
|
||||
$_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 user_id='{$_SESSION['p_id']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
//echo "<script>window.top.location.replace('./');</script>";
|
||||
echo './';//TODO:debug all and replace
|
||||
|
||||
$date = date('Y_m_d H:i:s');
|
||||
$date2 = substr($date, 0, 10);
|
||||
$fp = fopen("logs/_{$date2}_login.txt", "a");
|
||||
$msg = _String::Fill2($date,20," ").tab2($id,13," ")._String::Fill2($me['name'],13," ")._String::Fill2($_SESSION['p_ip'],16," ");
|
||||
fwrite($fp, $msg."\r\n");
|
||||
fclose($fp);
|
||||
//MessageBox("아이디나 암호가 올바르지 않습니다!!!");
|
||||
//TODO:login_process를 rest 형태로 처리
|
||||
header ("Location: index.php");
|
||||
exit(0);
|
||||
}
|
||||
if(!$me) {
|
||||
//MessageBox("캐릭터가 없습니다!!!");
|
||||
//TODO:login_process를 rest 형태로 처리
|
||||
header ("Location: index.php");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
||||
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_name'] = $me['name'];
|
||||
$_SESSION['p_nation'] = $me['nation'];
|
||||
$_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 user_id='{$_SESSION['p_id']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$date = date('Y_m_d H:i:s');
|
||||
$date2 = substr($date, 0, 10);
|
||||
$fp = fopen("logs/_{$date2}_login.txt", "a");
|
||||
$msg = _String::Fill2($date,20," ").tab2($id,13," ")._String::Fill2($me['name'],13," ")._String::Fill2($_SESSION['p_ip'],16," ");
|
||||
fwrite($fp, $msg."\r\n");
|
||||
fclose($fp);
|
||||
|
||||
header ("Location: index.php");
|
||||
|
||||
function DeleteSession() {
|
||||
$session_path = "data/session"; // 세션이저장된 디렉토리
|
||||
|
||||
@@ -57,6 +57,7 @@ $scenario = getScenario($connect);
|
||||
<title>메인</title>
|
||||
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
|
||||
<link rel=stylesheet href=stylesheet.php?<?=$me['skin'];?> type=text/css>
|
||||
<script src="../e_lib/jquery-3.2.1.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
if (document.all) {
|
||||
|
||||
Reference in New Issue
Block a user