내부 전역 변수값 처리를 위해 함수 정리

conf.php에 getServPrefix 추가. 이후 같은 db에서 다른 서버를 운용할때 사용 가능할 것으로 예상.

$_SESSION 값을 직접 받아서 처리하지 않도록 하기위한 용도로 getUserID(), getGeneralID(), getGeneralName() 을 설정

$_SESSION['p_id']를 p_no로 착각하여 구현한 부분 수정

int|null 변환을 위한 toInt 함수 추가

func_string.php에서 null이 입력될 경우 일부 처리

각 서버에 계정이 생성되었는지 확인하는 isSigned()함수 추가
This commit is contained in:
2018-02-03 03:36:34 +09:00
parent 0bd51726c3
commit e536e2d4ca
15 changed files with 215 additions and 154 deletions
+6 -30
View File
@@ -1,37 +1,13 @@
<?php
//NOTE: 전역 로그아웃 외에 게임 로그아웃이 의미가 있나?
include "lib.php";
include "func.php";
$connect=dbConn();
unset($_SESSION['p_id']);
unset($_SESSION['p_ip']);
unset($_SESSION[getServPrefix().'p_no']);
unset($_SESSION[getServPrefix().'p_name']);
$query = "select no,user_id,password,name from general where user_id='{$_SESSION['p_id']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$_SESSION['p_id'] = "";
$_SESSION['p_name'] = "";
$_SESSION['p_nation'] = 0;
$id = $me['user_id'];
$pw = $me['password'];
$conmsg = $me['conmsg'];
//Ǻ
session_destroy();
//echo "<script>location.replace('start.php');</script>";
//echo 'start.php';//TODO:debug all and replace
header('Location:start.php');
/*
<html>
a
<form name=form1 action=../login.php method=post>
<input type=hidden name=id value='<?=$id;?>'>
<input type=hidden name=pw value='<?=$pw;?>'>
<input type=hidden name=conmsg value='<?=$conmsg;?>'>
</form>
<script>form1.submit();</script>
</html>
*/
header('Location:start.php');