$_POST, $_GET 남은 부분 제거. 연감 지도 받아오는 부분 재 작성
This commit is contained in:
+3
-1
@@ -4,7 +4,8 @@ namespace sammo;
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
$btn = Util::getReq('btn');
|
||||
$yearmonth = $_POST['yearmonth'];
|
||||
$yearmonth = Util::getReq('yearmonth');
|
||||
|
||||
//로그인 검사
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
@@ -38,6 +39,7 @@ $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "
|
||||
$history = MYDB_fetch_array($result);
|
||||
$e = ($history['year']*12) + $history['month'];
|
||||
|
||||
//FIXME: $yearmonth가 올바르지 않을 경우에 처리가 필요.
|
||||
if (!$yearmonth) {
|
||||
$year = $admin['year'];
|
||||
$month = $admin['month'] - 1;
|
||||
|
||||
@@ -12,7 +12,7 @@ if($session->userGrade < 5){
|
||||
}
|
||||
|
||||
|
||||
$scenarioIdx = Util::toInt(Util::array_get($_GET['scenarioIdx']));
|
||||
$scenarioIdx = Util::getReq('scenarioIdx', 'int');
|
||||
|
||||
if ($scenarioIdx !== null) {
|
||||
//TODO: preview 지도 출력
|
||||
|
||||
+21
-16
@@ -1,37 +1,42 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
$year = $_GET['year'];
|
||||
$month = $_GET['month'];
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
|
||||
$year = Util::getReq('year', 'int');
|
||||
$month = Util::getReq('month', 'int');
|
||||
|
||||
$url = '/a_history.php';
|
||||
|
||||
if(!strpos($_SERVER['HTTP_REFERER'], $url)) {
|
||||
exit(1);
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'Invalid Referer'
|
||||
]);
|
||||
}
|
||||
|
||||
if(!$year || !$month) {
|
||||
exit(1);
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'year, month가 지정되지 않았습니다'
|
||||
]);
|
||||
}
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
|
||||
//로그인 검사
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select map from history where year='$year' and month='$month'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$history = MYDB_fetch_array($result);
|
||||
$map = $db->queryFirstField('SELECT map FROM history WHERE year=%i AND month=%i', $year, $month);
|
||||
|
||||
if(!$history['map']) {
|
||||
exit(1);
|
||||
if(!$map){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'해당하는 연월의 지도가 없습니다'
|
||||
]);
|
||||
}
|
||||
|
||||
$map = $history['map'];
|
||||
$map = str_replace('<_quot_>', "'", $map);
|
||||
$map = str_replace('<_dquot_>', '"', $map);
|
||||
|
||||
echo $map;
|
||||
Json::die(Json::decode($map));
|
||||
@@ -8,7 +8,7 @@ $userID = Session::getUserID();
|
||||
|
||||
// 외부 파라미터
|
||||
// $_POST['pw'] : PW
|
||||
$pw = $_POST['pw'];
|
||||
$pw = Util::getReq('pw');
|
||||
|
||||
if(!$pw){
|
||||
Json::die([
|
||||
|
||||
@@ -13,9 +13,9 @@ if($session->userGrade < 6){
|
||||
}
|
||||
|
||||
// 외부 파라미터
|
||||
// $_POST['action'] : 처리종류
|
||||
// $_POST['user_id'] : 유저 이름
|
||||
// $_POST['param'] : 추가 파라미터
|
||||
// action : 처리종류
|
||||
// user_id : 유저 이름
|
||||
// param : 추가 파라미터
|
||||
|
||||
$action = Util::getReq('action');
|
||||
$userID = Util::getReq('user_id');
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ namespace sammo;
|
||||
require(__dir__.'/../vendor/autoload.php');
|
||||
|
||||
WebUtil::setHeaderNoCache();
|
||||
$category = Util::array_get($_GET['category'], 0);
|
||||
$category = Util::getReq('category', 0);
|
||||
//FIXME: 겨우 category 구분을 위해 php를 써야하는가? JavaScript로 바꾸자
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
|
||||
@@ -7,7 +7,7 @@ use \kakao\Kakao_REST_API_Helper as Kakao_REST_API_Helper;
|
||||
|
||||
WebUtil::setHeaderNoCache();
|
||||
|
||||
$auth_code = Util::array_get($_GET['code']);
|
||||
$auth_code = Util::getReq('code');
|
||||
if(!$auth_code){
|
||||
|
||||
header('Location:oauth_fail.html');
|
||||
|
||||
Reference in New Issue
Block a user