util 클래스 명을 PSR1에 맞게 Util로 재 명명
This commit is contained in:
@@ -10,9 +10,9 @@ require(__DIR__.'/../f_config/SETTING.php');
|
||||
session_start();
|
||||
session_destroy();
|
||||
|
||||
$username = mb_strtolower(util::array_get($_POST['username']), 'utf-8');
|
||||
$password = util::array_get($_POST['password']);
|
||||
$nickname = util::array_get($_POST['nickname']);
|
||||
$username = mb_strtolower(Util::array_get($_POST['username']), 'utf-8');
|
||||
$password = Util::array_get($_POST['password']);
|
||||
$nickname = Util::array_get($_POST['nickname']);
|
||||
|
||||
if(!$username || !$password || !$nickname){
|
||||
Json::die([
|
||||
|
||||
@@ -20,12 +20,12 @@ function dbSQLFail($params){
|
||||
]);
|
||||
}
|
||||
|
||||
$host = util::array_get($_POST['db_host']);
|
||||
$port = util::array_get($_POST['db_port']);
|
||||
$username = util::array_get($_POST['db_id']);
|
||||
$password = util::array_get($_POST['db_pw']);
|
||||
$dbName = util::array_get($_POST['db_name']);
|
||||
$servHost = util::array_get($_POST['serv_host']);
|
||||
$host = Util::array_get($_POST['db_host']);
|
||||
$port = Util::array_get($_POST['db_port']);
|
||||
$username = Util::array_get($_POST['db_id']);
|
||||
$password = Util::array_get($_POST['db_pw']);
|
||||
$dbName = Util::array_get($_POST['db_name']);
|
||||
$servHost = Util::array_get($_POST['serv_host']);
|
||||
|
||||
if(!$host || !$port || !$username || !$password || !$dbName || !$servHost){
|
||||
Json::die([
|
||||
|
||||
@@ -16,9 +16,9 @@ function escapeIPv4($ip){
|
||||
return str_replace('.', '\\.', $ip);
|
||||
}
|
||||
|
||||
$action = util::array_get($_POST['action'], '');
|
||||
$notice = util::array_get($_POST['notice'], '');
|
||||
$server = util::array_get($_POST['server'], '');
|
||||
$action = Util::array_get($_POST['action'], '');
|
||||
$notice = Util::array_get($_POST['notice'], '');
|
||||
$server = Util::array_get($_POST['server'], '');
|
||||
|
||||
$db = getRootDB();
|
||||
$userGrade = $session->userGrade;
|
||||
@@ -43,12 +43,12 @@ function doServerModeSet($server, $action, &$response){
|
||||
$templates = new \League\Plates\Engine('templates');
|
||||
|
||||
//TODO: .htaccess가 서버 오픈에도 사용될 수 있으니 별도의 방법이 필요함
|
||||
$allow_ip = util::get_client_ip(false);
|
||||
if(util::starts_with($allow_ip, '192.168.') ||
|
||||
util::starts_with($allow_ip, '10.'))
|
||||
$allow_ip = Util::get_client_ip(false);
|
||||
if(Util::starts_with($allow_ip, '192.168.') ||
|
||||
Util::starts_with($allow_ip, '10.'))
|
||||
{
|
||||
//172.16~172.31은 코딩하기 귀찮으니까 안할거다
|
||||
$allow_ip = util::get_client_ip(true);
|
||||
$allow_ip = Util::get_client_ip(true);
|
||||
}
|
||||
|
||||
$xforward_allow_ip = escapeIPv4($allow_ip);
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ namespace sammo;
|
||||
require_once('_common.php');
|
||||
|
||||
|
||||
$category = util::array_get($_GET['category'], 0);
|
||||
$category = Util::array_get($_GET['category'], 0);
|
||||
//FIXME: 겨우 category 구분을 위해 php를 써야하는가? JavaScript로 바꾸자
|
||||
$images = IMAGES;
|
||||
?>
|
||||
|
||||
+2
-2
@@ -11,8 +11,8 @@ if($session->isLoggedIn()){
|
||||
$session->logout();
|
||||
}
|
||||
|
||||
$username = mb_strtolower(util::array_get($_POST['username']), 'utf-8');
|
||||
$password = util::array_get($_POST['password']);
|
||||
$username = mb_strtolower(Util::array_get($_POST['username']), 'utf-8');
|
||||
$password = Util::array_get($_POST['password']);
|
||||
|
||||
if(!$username || !$password){
|
||||
Json::die([
|
||||
|
||||
@@ -17,10 +17,10 @@ if(!$session->isLoggedIn()){
|
||||
]);
|
||||
}
|
||||
$userID = $session->userID;
|
||||
$access_token = util::array_get($_SESSION['access_token']);
|
||||
$expires = util::array_get($_SESSION['expires']);
|
||||
$refresh_token = util::array_get($_SESSION['refresh_token']);
|
||||
$refresh_token_expires = util::array_get($_SESSION['refresh_token_expires']);
|
||||
$access_token = Util::array_get($_SESSION['access_token']);
|
||||
$expires = Util::array_get($_SESSION['expires']);
|
||||
$refresh_token = Util::array_get($_SESSION['refresh_token']);
|
||||
$refresh_token_expires = Util::array_get($_SESSION['refresh_token_expires']);
|
||||
|
||||
if(!$access_token || !$expires){
|
||||
Json::die([
|
||||
@@ -55,7 +55,7 @@ if($expires < $nowDate){
|
||||
$access_token = $result['access_token'];
|
||||
$expires = TimeUtil::DatetimeFromNowSecond($nowDate, $result['expires_in']);
|
||||
if(isset($result['refresh_token'])){
|
||||
$refresh_token = util::array_get($result['refresh_token']);
|
||||
$refresh_token = Util::array_get($result['refresh_token']);
|
||||
$refresh_token_expires = TimeUtil::DatetimeFromNowSecond($nowDate, $result['refresh_token_expires_in']);
|
||||
}
|
||||
}
|
||||
@@ -85,7 +85,7 @@ $sendResult = $restAPI->talk_to_me_default([
|
||||
],
|
||||
"button_title"=> "로그인 페이지 열기"
|
||||
]);
|
||||
$sendResult['code'] = util::array_get($sendResult['code'], 0);
|
||||
$sendResult['code'] = Util::array_get($sendResult['code'], 0);
|
||||
if($sendResult['code'] < 0){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
|
||||
@@ -9,14 +9,14 @@ require('lib.join.php');
|
||||
|
||||
session_start();
|
||||
|
||||
$access_token = util::array_get($_SESSION['access_token']);
|
||||
$access_token = Util::array_get($_SESSION['access_token']);
|
||||
if(!$access_token){
|
||||
Json::die('로그인 토큰 에러. 다시 로그인을 수행해주세요.');
|
||||
}
|
||||
|
||||
|
||||
$value = util::array_get($_POST['value']);
|
||||
switch(util::array_get($_POST['type'])){
|
||||
$value = Util::array_get($_POST['value']);
|
||||
switch(Util::array_get($_POST['type'])){
|
||||
case 'nickname':
|
||||
Json::die(checkNicknameDup($value));
|
||||
case 'username':
|
||||
|
||||
@@ -20,10 +20,10 @@ if($canJoin != 'Y'){
|
||||
|
||||
$nowDate = TimeUtil::DatetimeNow();
|
||||
|
||||
$access_token = util::array_get($_SESSION['access_token']);
|
||||
$expires = util::array_get($_SESSION['expires']);
|
||||
$refresh_token = util::array_get($_SESSION['refresh_token']);
|
||||
$refresh_token_expires = util::array_get($_SESSION['refresh_token_expires']);
|
||||
$access_token = Util::array_get($_SESSION['access_token']);
|
||||
$expires = Util::array_get($_SESSION['expires']);
|
||||
$refresh_token = Util::array_get($_SESSION['refresh_token']);
|
||||
$refresh_token_expires = Util::array_get($_SESSION['refresh_token_expires']);
|
||||
if(!$access_token){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
@@ -37,10 +37,10 @@ if($expires < $nowDate && (!$refresh_token || ($refresh_token_expires < $nowDate
|
||||
'reason'=>'로그인 토큰 만료.'.$refresh_token_expires.' 다시 카카오로그인을 수행해주세요.'
|
||||
]);
|
||||
}
|
||||
$secret_agree =util::array_get($_POST['secret_agree']);
|
||||
$username = mb_strtolower(util::array_get($_POST['username']), 'utf-8');
|
||||
$password = util::array_get($_POST['password']);
|
||||
$nickname = util::array_get($_POST['nickname']);
|
||||
$secret_agree =Util::array_get($_POST['secret_agree']);
|
||||
$username = mb_strtolower(Util::array_get($_POST['username']), 'utf-8');
|
||||
$password = Util::array_get($_POST['password']);
|
||||
$nickname = Util::array_get($_POST['nickname']);
|
||||
|
||||
if(!$username || !$password || !$nickname){
|
||||
Json::die([
|
||||
@@ -98,16 +98,16 @@ if($expires < $nowDate){
|
||||
$access_token = $result['access_token'];
|
||||
$expires = TimeUtil::DatetimeFromNowSecond($nowDate, $result['expires_in']);
|
||||
if(isset($result['refresh_token'])){
|
||||
$refresh_token = util::array_get($result['refresh_token']);
|
||||
$refresh_token = Util::array_get($result['refresh_token']);
|
||||
$refresh_token_expires = TimeUtil::DatetimeFromNowSecond($nowDate, $result['refresh_token_expires_in']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$signupResult = $restAPI->signup();
|
||||
$kakaoID = util::array_get($signupResult['id']);
|
||||
$kakaoID = Util::array_get($signupResult['id']);
|
||||
|
||||
if(!$kakaoID && util::array_get($signupResult['msg'])!='already registered'){
|
||||
if(!$kakaoID && Util::array_get($signupResult['msg'])!='already registered'){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'카카오 로그인 과정 중 앱 연결 절차를 실패했습니다'.json_encode($signupResult)
|
||||
@@ -115,7 +115,7 @@ if(!$kakaoID && util::array_get($signupResult['msg'])!='already registered'){
|
||||
}
|
||||
|
||||
$me = $restAPI->meWithEmail();
|
||||
$me['code'] = util::array_get($me['code'], 0);
|
||||
$me['code'] = Util::array_get($me['code'], 0);
|
||||
if ($me['code']< 0) {
|
||||
$restAPI->unlink();
|
||||
Json::die([
|
||||
@@ -124,7 +124,7 @@ if ($me['code']< 0) {
|
||||
]);
|
||||
}
|
||||
|
||||
if(!util::array_get($me['kaccount_email_verified'],false)){
|
||||
if(!Util::array_get($me['kaccount_email_verified'],false)){
|
||||
$restAPI->unlink();
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
|
||||
@@ -24,11 +24,11 @@ if($canLogin != 'Y'){
|
||||
|
||||
$nowDate = TimeUtil::DatetimeNow();
|
||||
|
||||
$access_token = util::array_get($_SESSION['access_token']);
|
||||
$expires = util::array_get($_SESSION['expires']);
|
||||
$refresh_token = util::array_get($_SESSION['refresh_token']);
|
||||
$refresh_token_expires = util::array_get($_SESSION['refresh_token_expires']);
|
||||
$email = util::array_get($_SESSION['kaccount_email']);
|
||||
$access_token = Util::array_get($_SESSION['access_token']);
|
||||
$expires = Util::array_get($_SESSION['expires']);
|
||||
$refresh_token = Util::array_get($_SESSION['refresh_token']);
|
||||
$refresh_token_expires = Util::array_get($_SESSION['refresh_token_expires']);
|
||||
$email = Util::array_get($_SESSION['kaccount_email']);
|
||||
|
||||
|
||||
if(!$access_token || !$expires){
|
||||
@@ -63,7 +63,7 @@ if($expires < $nowDate){
|
||||
$access_token = $result['access_token'];
|
||||
$expires = TimeUtil::DatetimeFromNowSecond($nowDate, $result['expires_in']);
|
||||
if(isset($result['refresh_token'])){
|
||||
$refresh_token = util::array_get($result['refresh_token']);
|
||||
$refresh_token = Util::array_get($result['refresh_token']);
|
||||
$refresh_token_expires = TimeUtil::DatetimeFromNowSecond($nowDate, $result['refresh_token_expires_in']);
|
||||
}
|
||||
}
|
||||
@@ -71,7 +71,7 @@ if($expires < $nowDate){
|
||||
|
||||
if(!$email){
|
||||
$me = $restAPI->meWithEmail();
|
||||
$me['code'] = util::array_get($me['code'], 0);
|
||||
$me['code'] = Util::array_get($me['code'], 0);
|
||||
if ($me['code']< 0) {
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
@@ -79,7 +79,7 @@ if(!$email){
|
||||
]);
|
||||
}
|
||||
|
||||
if(!util::array_get($me['kaccount_email_verified'],false)){
|
||||
if(!Util::array_get($me['kaccount_email_verified'],false)){
|
||||
$restAPI->unlink();
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
|
||||
@@ -8,7 +8,7 @@ require_once(__dir__.'/../d_setting/conf.php');
|
||||
|
||||
session_start();
|
||||
|
||||
$access_token = util::array_get($_SESSION['access_token']);
|
||||
$access_token = Util::array_get($_SESSION['access_token']);
|
||||
if(!$access_token){
|
||||
header('Location:oauth_fail.html');
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ require('_common.php');
|
||||
|
||||
use \kakao\Kakao_REST_API_Helper as Kakao_REST_API_Helper;
|
||||
|
||||
$auth_code = util::array_get($_GET['code']);
|
||||
$auth_code = Util::array_get($_GET['code']);
|
||||
if(!$auth_code){
|
||||
|
||||
header('Location:oauth_fail.html');
|
||||
@@ -25,13 +25,13 @@ $result = $restAPI->create_access_token($auth_code);
|
||||
|
||||
|
||||
|
||||
if(util::array_get($result['expires_in'], -1) > 0){
|
||||
if(Util::array_get($result['expires_in'], -1) > 0){
|
||||
session_start();
|
||||
$restAPI->set_access_token($result['access_token']);
|
||||
$now = TimeUtil::DatetimeNow();
|
||||
$_SESSION['access_token'] = $result['access_token'];
|
||||
$_SESSION['expires'] = TimeUtil::DatetimeFromSecond($now, $result['expires_in']);
|
||||
$_SESSION['refresh_token'] = util::array_get($result['refresh_token']);
|
||||
$_SESSION['refresh_token'] = Util::array_get($result['refresh_token']);
|
||||
$_SESSION['refresh_token_expires'] = TimeUtil::DatetimeFromSecond($now, $result['refresh_token_expires_in']);
|
||||
}
|
||||
else{
|
||||
@@ -45,7 +45,7 @@ $me = $restAPI->meWithEmail();
|
||||
|
||||
$oauth_mode = 'login';
|
||||
|
||||
$me['code'] = util::array_get($me['code'], 0);
|
||||
$me['code'] = Util::array_get($me['code'], 0);
|
||||
if($me['code']< 0){
|
||||
switch($me['msg']){
|
||||
case 'NotRegisteredUserException':
|
||||
|
||||
@@ -50,8 +50,8 @@ class Session {
|
||||
|
||||
//첫 등장
|
||||
|
||||
if(!util::array_get($_SESSION['ip'])) {
|
||||
$_SESSION['ip'] = util::get_client_ip(true);
|
||||
if(!Util::array_get($_SESSION['ip'])) {
|
||||
$_SESSION['ip'] = Util::get_client_ip(true);
|
||||
$_SESSION['time'] = time();
|
||||
}
|
||||
}
|
||||
@@ -90,13 +90,13 @@ class Session {
|
||||
}
|
||||
|
||||
private function get(string $name){
|
||||
return util::array_get($_SESSION[$name]);
|
||||
return Util::array_get($_SESSION[$name]);
|
||||
}
|
||||
|
||||
public function login(int $userID, string $userName, int $grade) {
|
||||
$this->set('userID', $userID);
|
||||
$this->set('userName', $userName);
|
||||
$this->set('ip', util::get_client_ip(true));
|
||||
$this->set('ip', Util::get_client_ip(true));
|
||||
$this->set('time', time());
|
||||
$this->set('userGrade', $grade);
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
class util extends \utilphp\util{
|
||||
class Util extends \utilphp\util{
|
||||
};
|
||||
@@ -28,7 +28,7 @@ function relayJson($filepath, $noCache = true, $die = true){
|
||||
|
||||
$jsonPost = parseJsonPost();
|
||||
|
||||
$reqSequence = toInt(util::array_get($jsonPost['sequence'], 0), true);
|
||||
$reqSequence = toInt(Util::array_get($jsonPost['sequence'], 0), true);
|
||||
|
||||
if($reqSequence === null){
|
||||
$reqSequence = 0;
|
||||
|
||||
+13
-13
@@ -8,14 +8,14 @@ include "func.php";
|
||||
|
||||
//로그인 검사
|
||||
|
||||
$isgen = util::array_get($_POST['isgen'], '');
|
||||
$tech1 = util::array_get($_POST['tech1'], 0);
|
||||
$tech2 =util::array_get($_POST['tech2'], 0);
|
||||
$dex10 = util::array_get($_POST['dex10'], 0);
|
||||
$dex110 = util::array_get($_POST['dex110'], 0);
|
||||
$dex120 = util::array_get($_POST['dex120'], 0);
|
||||
$dex130 = util::array_get($_POST['dex130'], 0);
|
||||
$dex140 = util::array_get($_POST['dex140'], 0);
|
||||
$isgen = Util::array_get($_POST['isgen'], '');
|
||||
$tech1 = Util::array_get($_POST['tech1'], 0);
|
||||
$tech2 =Util::array_get($_POST['tech2'], 0);
|
||||
$dex10 = Util::array_get($_POST['dex10'], 0);
|
||||
$dex110 = Util::array_get($_POST['dex110'], 0);
|
||||
$dex120 = Util::array_get($_POST['dex120'], 0);
|
||||
$dex130 = Util::array_get($_POST['dex130'], 0);
|
||||
$dex140 = Util::array_get($_POST['dex140'], 0);
|
||||
|
||||
$dx10 = array_fill(0, 20, '');
|
||||
$dx110 = array_fill(0, 20, '');
|
||||
@@ -23,11 +23,11 @@ $dx120 = array_fill(0, 20, '');
|
||||
$dx130 = array_fill(0, 20, '');
|
||||
$dx140 = array_fill(0, 20, '');
|
||||
|
||||
$dex20 = util::array_get($_POST['dex20'], 0);
|
||||
$dex210 = util::array_get($_POST['dex210'], 0);
|
||||
$dex220 = util::array_get($_POST['dex220'], 0);
|
||||
$dex230 = util::array_get($_POST['dex230'], 0);
|
||||
$dex240 = util::array_get($_POST['dex240'], 0);
|
||||
$dex20 = Util::array_get($_POST['dex20'], 0);
|
||||
$dex210 = Util::array_get($_POST['dex210'], 0);
|
||||
$dex220 = Util::array_get($_POST['dex220'], 0);
|
||||
$dex230 = Util::array_get($_POST['dex230'], 0);
|
||||
$dex240 = Util::array_get($_POST['dex240'], 0);
|
||||
|
||||
$dx20 = array_fill(0, 20, '');
|
||||
$dx210 = array_fill(0, 20, '');
|
||||
|
||||
+4
-4
@@ -54,7 +54,7 @@ function getGeneralID($forceExit=false, $countLogin=true){
|
||||
}
|
||||
|
||||
$idKey = getServPrefix().'p_no';
|
||||
$generalID = util::array_get($_SESSION[$idKey], null);
|
||||
$generalID = Util::array_get($_SESSION[$idKey], null);
|
||||
|
||||
if($generalID){
|
||||
return $generalID;
|
||||
@@ -75,7 +75,7 @@ function getGeneralID($forceExit=false, $countLogin=true){
|
||||
$query=$db->query("update general set logcnt=logcnt+1 ,ip = %s_ip,lastconnect=%s_lastConnect,conmsg=%s_conmsg where owner= %s_userID",[
|
||||
'ip' => getenv("REMOTE_ADDR"),
|
||||
'lastConnect' => date('Y-m-d H:i:s'),
|
||||
'conmsg' => util::array_get($_SESSION['conmsg'], ''),
|
||||
'conmsg' => Util::array_get($_SESSION['conmsg'], ''),
|
||||
'userID' => $userID
|
||||
]);
|
||||
$_SESSION[$idKey] = $generalID;
|
||||
@@ -102,7 +102,7 @@ function getGeneralName($forceExit=false)
|
||||
}
|
||||
|
||||
$nameKey = getServPrefix().'p_name';
|
||||
$generalName = util::array_get($_SESSION[$nameKey], null);
|
||||
$generalName = Util::array_get($_SESSION[$nameKey], null);
|
||||
|
||||
if($generalName){
|
||||
return $generalName;
|
||||
@@ -1797,7 +1797,7 @@ function increaseRefresh($type="", $cnt=1) {
|
||||
|
||||
getDB()->query('UPDATE game set refresh=refresh+%i where `no`=1', $cnt);
|
||||
|
||||
if(!util::array_get($_SESSION['userID'], null)) {
|
||||
if(!Util::array_get($_SESSION['userID'], null)) {
|
||||
getDB()->query('UPDATE general set `lastrefresh`=%s_date, `con`=`con`+%i_cnt, `connect`=`connect`+%i_cnt, refcnt=refcnt+%i_cnt, refresh=refresh+%i_cnt where `no`=%i_no',[
|
||||
'date'=>$date,
|
||||
'cnt'=>$cnt,
|
||||
|
||||
@@ -116,13 +116,13 @@ function sendRawMessage($msgType, $isSender, $mailbox, $src, $dest, $msg, $date,
|
||||
$srcNation = getNationStaticInfo($src['nation_id']);
|
||||
$destNation = getNationStaticInfo($dest['nation_id']);
|
||||
|
||||
$src['nation'] = util::array_get($srcNation['name'], '재야');
|
||||
$src['color'] = util::array_get($srcNation['color'], '#ffffff');
|
||||
$src['nation'] = Util::array_get($srcNation['name'], '재야');
|
||||
$src['color'] = Util::array_get($srcNation['color'], '#ffffff');
|
||||
|
||||
$dest['nation'] = util::array_get($destNation['name'], '재야');
|
||||
$dest['color'] = util::array_get($destNation['color'], '#ffffff');
|
||||
$dest['nation'] = Util::array_get($destNation['name'], '재야');
|
||||
$dest['color'] = Util::array_get($destNation['color'], '#ffffff');
|
||||
|
||||
if(!$isSender && $mailBox < 9000 && util::array_get($msgOption['alert'], false)){
|
||||
if(!$isSender && $mailBox < 9000 && Util::array_get($msgOption['alert'], false)){
|
||||
//TODO:newmsg보단 lastmsg로 datetime을 넣는게 더 나아보임
|
||||
getDB()->update('general', array(
|
||||
'newmsg' => true
|
||||
@@ -207,7 +207,7 @@ function sendScoutMsg($src, $dest, $date) {
|
||||
}
|
||||
|
||||
$nation = getNationStaticInfo($src['nation_id']);
|
||||
$nationName = util::array_get($nation['name'], '재야');
|
||||
$nationName = Util::array_get($nation['name'], '재야');
|
||||
|
||||
if(!$dest || !$dest['id']){
|
||||
return false;
|
||||
@@ -260,7 +260,7 @@ function getMailboxList(){
|
||||
$mailbox = $nationID + 9000;
|
||||
$nation = $nation['name'];
|
||||
$color = ('#'.$nation['color']).replace('##','#');//xxx: #기호 없는 이전 코드 대비용
|
||||
$generals = util::array_get($generalNations[$nationID], []);
|
||||
$generals = Util::array_get($generalNations[$nationID], []);
|
||||
|
||||
return [
|
||||
"nationID"=>$nationID,
|
||||
|
||||
@@ -44,10 +44,10 @@ function process_22($connect, &$general) {
|
||||
|
||||
sendScoutMsg([
|
||||
'id' => $general['no'],
|
||||
'nation_id' => util::array_get($general['nation'], 0)
|
||||
'nation_id' => Util::array_get($general['nation'], 0)
|
||||
],[
|
||||
'id' => $you['no'],
|
||||
'nation_id' => util::array_get($you['nation'], 0)
|
||||
'nation_id' => Util::array_get($you['nation'], 0)
|
||||
],$date);
|
||||
|
||||
$general['intel2']++;
|
||||
|
||||
@@ -10,7 +10,7 @@ session_write_close(); // 이제 세션 안 쓴다
|
||||
|
||||
$jsonPost = parseJsonPost();
|
||||
|
||||
$reqSequence = toInt(util::array_get($jsonPost['sequence'], 0));
|
||||
$reqSequence = toInt(Util::array_get($jsonPost['sequence'], 0));
|
||||
|
||||
|
||||
$nationID = getDB()->queryFirstField(
|
||||
|
||||
@@ -12,7 +12,7 @@ if($session->userGrade < 5){
|
||||
]);
|
||||
}
|
||||
|
||||
$scenarioIdx = toInt(util::array_get($_GET['scenarioIdx']));
|
||||
$scenarioIdx = toInt(Util::array_get($_GET['scenarioIdx']));
|
||||
|
||||
if($scenarioIdx === null){
|
||||
Json::die([
|
||||
|
||||
@@ -19,8 +19,8 @@ session_write_close(); // 이제 세션 안 쓴다
|
||||
|
||||
$jsonPost = parseJsonPost();
|
||||
|
||||
$msgID = toInt(util::array_get($jsonPost['msgID'], null), false);
|
||||
$msgResponse = util::array_get($jsonPost['response'], null);
|
||||
$msgID = toInt(Util::array_get($jsonPost['msgID'], null), false);
|
||||
$msgResponse = Util::array_get($jsonPost['response'], null);
|
||||
|
||||
if ($msgID === null || !is_bool($msgResponse)) {
|
||||
Json::die([
|
||||
@@ -60,8 +60,8 @@ if ($validUntil < $date) {
|
||||
]);
|
||||
}
|
||||
|
||||
$msgOption = json_decode(util::array_get($messageInfo['option'], '{}'));
|
||||
$msgAction = util::array_get($msgOption['action'], null);
|
||||
$msgOption = json_decode(Util::array_get($messageInfo['option'], '{}'));
|
||||
$msgAction = Util::array_get($msgOption['action'], null);
|
||||
$messageInfo['option'] = $msgOption;
|
||||
|
||||
$msgSrc = json_decode($messageInfo['src']);
|
||||
|
||||
+1
-1
@@ -120,7 +120,7 @@ if($destMailbox == 9999) {
|
||||
|
||||
// 개인 메세지
|
||||
} elseif($destMailbox > 0) {
|
||||
$last_msg = new DateTime(util::array_get($_SESSION['last_msg'], '0000-00-00'));
|
||||
$last_msg = new DateTime(Util::array_get($_SESSION['last_msg'], '0000-00-00'));
|
||||
|
||||
$msg_interval = $datetime->getTimestamp() - $last_msg->getTimestamp();
|
||||
//NOTE: 여기서 유저 레벨을 구별할 코드가 필요할까?
|
||||
|
||||
+4
-4
@@ -8,12 +8,12 @@ include "func.php";
|
||||
|
||||
$name = $_POST['name'];
|
||||
$name = StringUtil::NoSpecialCharacter($name);
|
||||
$pic = util::array_get($_POST['pic'],'');
|
||||
$pic = Util::array_get($_POST['pic'],'');
|
||||
$character = $_POST['character'];
|
||||
|
||||
$leader = util::array_get($_POST['leader'], 50);
|
||||
$power = util::array_get($_POST['power'], 50);
|
||||
$intel = util::array_get($_POST['intel'], 50);
|
||||
$leader = Util::array_get($_POST['leader'], 50);
|
||||
$power = Util::array_get($_POST['power'], 50);
|
||||
$intel = Util::array_get($_POST['intel'], 50);
|
||||
|
||||
$mylog = [];
|
||||
|
||||
|
||||
+2
-2
@@ -101,7 +101,7 @@ session_cache_limiter('nocache, must_revalidate');//NOTE: 캐시가 가능하도
|
||||
session_start();
|
||||
|
||||
//첫 등장
|
||||
if(!util::array_get($_SESSION['p_ip'], null)) {
|
||||
if(!Util::array_get($_SESSION['p_ip'], null)) {
|
||||
$_SESSION['p_ip'] = getenv("REMOTE_ADDR");
|
||||
$_SESSION['p_time'] = time();
|
||||
}
|
||||
@@ -278,7 +278,7 @@ function dictToArray($dict, $keys){
|
||||
$result = [];
|
||||
|
||||
foreach($keys as $key){
|
||||
$result[] = util::array_get($dict[$key], null);
|
||||
$result[] = Util::array_get($dict[$key], null);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -12,10 +12,10 @@ if(Session::getUserGrade(true) < 5){
|
||||
if(file_exists("d_setting/conf.php")) error("이미 conf.php가 생성되어 있습니다.<br><br>재설치하려면 해당 파일을 지우세요");
|
||||
|
||||
|
||||
$hostname = util::array_get($_POST['hostname'], '');
|
||||
$user_id = util::array_get($_POST['user_id'], '');
|
||||
$password = util::array_get($_POST['password'], '');
|
||||
$dbname = util::array_get($_POST['dbname'], '');
|
||||
$hostname = Util::array_get($_POST['hostname'], '');
|
||||
$user_id = Util::array_get($_POST['user_id'], '');
|
||||
$password = Util::array_get($_POST['password'], '');
|
||||
$dbname = Util::array_get($_POST['dbname'], '');
|
||||
|
||||
// 호스트네임, 아이디, DB네임, 비밀번호의 공백여부 검사
|
||||
if(isBlank($hostname)) Error("HostName을 입력하세요","");
|
||||
|
||||
@@ -4,13 +4,13 @@ include "func.php";
|
||||
|
||||
|
||||
|
||||
$turnterm = util::array_get($_POST['turnterm'],'0');
|
||||
$sync = util::array_get($_POST['sync'],'0');
|
||||
$scenario = util::array_get($_POST['scenario'],'0');
|
||||
$fiction = util::array_get($_POST['fiction'],'0');
|
||||
$extend = util::array_get($_POST['extend'],'0');
|
||||
$npcmode = util::array_get($_POST['npcmode'],'0');
|
||||
$img = util::array_get($_POST['img'],'0');
|
||||
$turnterm = Util::array_get($_POST['turnterm'],'0');
|
||||
$sync = Util::array_get($_POST['sync'],'0');
|
||||
$scenario = Util::array_get($_POST['scenario'],'0');
|
||||
$fiction = Util::array_get($_POST['fiction'],'0');
|
||||
$extend = Util::array_get($_POST['extend'],'0');
|
||||
$npcmode = Util::array_get($_POST['npcmode'],'0');
|
||||
$img = Util::array_get($_POST['img'],'0');
|
||||
|
||||
if(Session::getUserGrade(true) < 5){
|
||||
die('관리자 아님');
|
||||
|
||||
Reference in New Issue
Block a user