diff --git a/_common.php b/_common.php index 0d95a8ad..6d97a2ce 100644 --- a/_common.php +++ b/_common.php @@ -1,4 +1,6 @@ diff --git a/f_install/j_create_admin.php b/f_install/j_create_admin.php index 8aabb1b9..5bfd7832 100644 --- a/f_install/j_create_admin.php +++ b/f_install/j_create_admin.php @@ -1,10 +1,12 @@ false, 'reason'=>'입력값이 설정되지 않았습니다.' ]); } if(strlen($password)!=128){ - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'올바르지 않은 비밀번호 해시 포맷입니다.' ]); } if(!$SETTING->isExists()){ - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'DB 설정이 완료되지 않았습니다.' ]); @@ -42,7 +44,7 @@ $rootDB->query('LOCK TABLES member WRITE, member_log WRITE'); $memberCnt = $rootDB->queryFirstField('SELECT count(`NO`) from member'); if($memberCnt > 0){ - returnJson([ + Json::die([ 'result'=>'false', 'reason'=>'이미 계정이 생성되어 있습니다' ]); @@ -76,7 +78,7 @@ $rootDB->insert('member_log', [ ], JSON_UNESCAPED_UNICODE) ]); -returnJson([ +Json::die([ 'result'=>true, 'reason'=>'success' ]); \ No newline at end of file diff --git a/f_install/j_install_status.php b/f_install/j_install_status.php index fb60f7c4..93b8f66c 100644 --- a/f_install/j_install_status.php +++ b/f_install/j_install_status.php @@ -1,24 +1,26 @@ 'conn_fail' ]); } function dbSQLFail($params){ - returnJson([ + Json::die([ 'step'=>'sql_fail' ]); } if(!$SETTING->isExists()){ - returnJson([ + Json::die([ 'step'=>'config' ]); } @@ -32,13 +34,13 @@ $rootDB->error_handler = 'dbSQLFail'; $memberCnt = $rootDB->queryFirstField('SELECT count(`NO`) from MEMBER'); if($memberCnt === 0){ - returnJson([ + Json::die([ 'step'=>'admin', 'globalSalt'=>getGlobalSalt() ]); } -returnJson([ +Json::die([ 'step'=>'done' ]); \ No newline at end of file diff --git a/f_install/j_setup_db.php b/f_install/j_setup_db.php index 41c639ee..3d7e0e00 100644 --- a/f_install/j_setup_db.php +++ b/f_install/j_setup_db.php @@ -1,20 +1,21 @@ false, 'reason'=>'DB 접속에 실패했습니다.' ]); } function dbSQLFail($params){ - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'SQL을 제대로 실행하지 못했습니다. DB상태를 확인해 주세요.' ]); @@ -28,28 +29,28 @@ $dbName = util::array_get($_POST['db_name']); $servHost = util::array_get($_POST['serv_host']); if(!$host || !$port || !$username || !$password || !$dbName || !$servHost){ - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'입력 값이 올바르지 않습니다' ]); } if(!filter_var($servHost, FILTER_VALIDATE_URL)){ - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'접속 경로가 올바르지 않습니다.' ]); } if(file_exists(ROOT.'/d_setting/conf.php') && is_dir(ROOT.'/d_setting/conf.php')){ - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'d_setting/conf.php 가 디렉토리입니다' ]); } if($SETTING->isExists()){ - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'이미 conf.php 파일이 있습니다' ]); @@ -57,42 +58,42 @@ if($SETTING->isExists()){ //파일 권한 검사 if(file_exists(ROOT.'/d_pic') && !is_dir(ROOT.'/d_pic')){ - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'d_pic 이 디렉토리가 아닙니다' ]); } if(file_exists(ROOT.'/d_log') && !is_dir(ROOT.'/d_log')){ - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'d_log 가 디렉토리가 아닙니다' ]); } if(!file_exists(ROOT.'/d_setting')){ - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'d_setting 이 존재하지 않습니다' ]); } if(!is_writable(ROOT.'/d_pic')){ - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'d_pic 디렉토리의 쓰기 권한이 없습니다' ]); } if(!is_writable(ROOT.'/d_log')){ - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'d_log 디렉토리의 쓰기 권한이 없습니다' ]); } if(!is_writable(ROOT.'/d_setting')){ - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'d_setting 디렉토리의 쓰기 권한이 없습니다.' ]); @@ -155,13 +156,13 @@ $result = generateFileUsingSimpleTemplate( ); if($result !== true){ - returnJson([ + Json::die([ 'result'=>false, 'reason'=>$result ]); } -returnJson([ +Json::die([ 'result'=>true, 'reason'=>'success' ]); \ No newline at end of file diff --git a/f_retrival/_common.php b/f_retrival/_common.php index f3837d1b..0ae420c4 100644 --- a/f_retrival/_common.php +++ b/f_retrival/_common.php @@ -1,4 +1,6 @@ isLoggedIn()) { - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'로그인되지 않았습니다.' ]); @@ -38,7 +40,7 @@ if(!$db->affectedRows()){ ]) ]); - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'현재 비밀번호가 일치하지 않습니다.' ]); @@ -53,7 +55,7 @@ $db->insert('member_log', [ ]) ]); -returnJson([ +Json::die([ 'result'=>true, 'reason'=>'success' ]); \ No newline at end of file diff --git a/i_entrance/j_delete_me.php b/i_entrance/j_delete_me.php index d900acc0..d5912a9f 100644 --- a/i_entrance/j_delete_me.php +++ b/i_entrance/j_delete_me.php @@ -1,4 +1,6 @@ isLoggedIn()) { - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'로그인되지 않았습니다.' ]); @@ -18,7 +20,7 @@ if(!$SESSION->isLoggedIn()) { $pw = $_POST['pw']; if(!$pw){ - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'패스워드를 입력해주세요.' ]); @@ -32,14 +34,14 @@ $userInfo = $db->queryFirstRow('SELECT oauth_id, oauth_type, email, delete_after $SESSION->NoMember(), $pw); if(!$userInfo){ - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'현재 비밀번호가 일치하지 않습니다.' ]); } if($userInfo['delete_after']){ - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'이미 탈퇴 처리되어있습니다.' ]); @@ -50,7 +52,7 @@ $db->update('member',[ ], 'no=%i', $SESSION->NoMember()); if(!$db->affectedRows()){ - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'알 수 없는 이유로 탈퇴에 실패했습니다.' ]); @@ -67,7 +69,7 @@ $SESSION->logout(); unset($_SESSION['access_token']); setcookie("hello", "", time()-3600); -returnJson([ +Json::die([ 'result'=>true, 'reason'=>'success' ]); diff --git a/i_entrance/j_get_user_info.php b/i_entrance/j_get_user_info.php index f626854e..6a18f68e 100644 --- a/i_entrance/j_get_user_info.php +++ b/i_entrance/j_get_user_info.php @@ -1,4 +1,6 @@ isLoggedIn()) { - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'로그인되지 않았습니다.' ]); @@ -43,7 +45,7 @@ if($member['grade'] == 6) { $grade = '블럭회원'; } -returnJson([ +Json::die([ 'result'=>true, 'reason'=>'success', 'id'=>$member['id'], diff --git a/i_entrance/j_icon_change.php b/i_entrance/j_icon_change.php index 61560a42..4103f716 100644 --- a/i_entrance/j_icon_change.php +++ b/i_entrance/j_icon_change.php @@ -1,4 +1,6 @@ isLoggedIn()) { - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'로그인되지 않았습니다.' ]); @@ -105,4 +107,4 @@ if(!is_uploaded_file($image['tmp_name'])) { } -returnJson($response); \ No newline at end of file +Json::die($response); \ No newline at end of file diff --git a/i_entrance/j_icon_delete.php b/i_entrance/j_icon_delete.php index a9b517aa..a1eac890 100644 --- a/i_entrance/j_icon_delete.php +++ b/i_entrance/j_icon_delete.php @@ -1,4 +1,6 @@ isLoggedIn()) { - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'로그인되지 않았습니다.' ]); @@ -57,4 +59,4 @@ if($dt == $rf) { $response['result'] = true; } -returnJson($response); \ No newline at end of file +Json::die($response); \ No newline at end of file diff --git a/i_entrance/j_logout.php b/i_entrance/j_logout.php index be26577e..ae931fd9 100644 --- a/i_entrance/j_logout.php +++ b/i_entrance/j_logout.php @@ -1,4 +1,6 @@ true ]); \ No newline at end of file diff --git a/i_entrance/j_server_change_status.php b/i_entrance/j_server_change_status.php index 09b3c811..6e44bf04 100644 --- a/i_entrance/j_server_change_status.php +++ b/i_entrance/j_server_change_status.php @@ -1,9 +1,11 @@ getGrade(); session_write_close(); if($userGrade < 6) { - returnJson([ + Json::die([ 'result'=>'FAIL', 'msg'=>'운영자 권한이 없습니다.' ]); diff --git a/i_entrance/j_server_get_admin_status.php b/i_entrance/j_server_get_admin_status.php index 2d9dd807..4953c283 100644 --- a/i_entrance/j_server_get_admin_status.php +++ b/i_entrance/j_server_get_admin_status.php @@ -1,4 +1,6 @@ diff --git a/i_entrance/member/Get.php b/i_entrance/member/Get.php index 7eefce1a..084fc0f1 100644 --- a/i_entrance/member/Get.php +++ b/i_entrance/member/Get.php @@ -1,9 +1,11 @@ getGrade(); if($userGrade < 6) { - returnJson([ + Json::die([ 'result'=>'FAIL', 'msg'=>'운영자 권한이 없습니다.' ]); @@ -74,6 +76,6 @@ $response['state'] = "가입: {$system['REG']}, 로그인: {$system['LOGIN']}"; $response['result'] = 'SUCCESS'; -returnJson($response); +Json::die($response); diff --git a/i_entrance/member/Post.php b/i_entrance/member/Post.php index 3d529922..b4a72f30 100644 --- a/i_entrance/member/Post.php +++ b/i_entrance/member/Post.php @@ -1,4 +1,6 @@ diff --git a/i_popup/_common.php b/i_popup/_common.php index c95ed0e0..65a25333 100644 --- a/i_popup/_common.php +++ b/i_popup/_common.php @@ -1,4 +1,6 @@ isLoggedIn()){ header ('Location:i_entrance/entrance.php'); diff --git a/install.php b/install.php index 470f4af5..3b5b5c1f 100644 --- a/install.php +++ b/install.php @@ -1,4 +1,6 @@ isLoggedIn()){ @@ -16,7 +16,7 @@ $username = mb_strtolower(util::array_get($_POST['username']), 'utf-8'); $password = util::array_get($_POST['password']); if(!$username || !$password){ - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'올바르지 않은 입력입니다.' ]); @@ -24,7 +24,7 @@ if(!$username || !$password){ $canLogin = getRootDB()->queryFirstField('SELECT `LOGIN` FROM `SYSTEM` WHERE `NO` = 1'); if($canLogin != 'Y'){ - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'현재는 로그인이 금지되어있습니다!' ]); @@ -39,7 +39,7 @@ $userInfo = getRootDB()->queryFirstRow( ]); if(!$userInfo){ - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'아이디나 비밀번호가 올바르지 않습니다.' ]); @@ -49,13 +49,13 @@ $nowDate = _Time::DatetimeNow(); if($userInfo['delete_after']){ if($userInfo['delete_after'] < $nowDate){ getRootDB()->delete('member', 'no=%i', $userInfo['no']); - returnJson([ + Json::die([ 'result'=>false, 'reason'=>"기간 만기로 삭제되었습니다. 재 가입을 시도해주세요." ]); } else{ - returnJson([ + Json::die([ 'result'=>false, 'reason'=>"삭제 요청된 계정입니다.[{$userInfo['delete_after']}]" ]); @@ -64,7 +64,7 @@ if($userInfo['delete_after']){ } $SESSION->login($userInfo['no'], $userInfo['id'], $userInfo['grade']); -returnJson([ +Json::die([ 'result'=>true, 'reason'=>'로그인 되었습니다.' ]); \ No newline at end of file diff --git a/oauth_kakao/_common.php b/oauth_kakao/_common.php index c95ed0e0..65a25333 100644 --- a/oauth_kakao/_common.php +++ b/oauth_kakao/_common.php @@ -1,4 +1,6 @@ diff --git a/oauth_kakao/j_change_pw.php b/oauth_kakao/j_change_pw.php index 7d915601..e6b99a41 100644 --- a/oauth_kakao/j_change_pw.php +++ b/oauth_kakao/j_change_pw.php @@ -1,4 +1,5 @@ isLoggedIn()){ - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'로그인이 되어있지 않습니다' ]); @@ -23,7 +24,7 @@ $refresh_token = util::array_get($_SESSION['refresh_token']); $refresh_token_expires = util::array_get($_SESSION['refresh_token_expires']); if(!$access_token || !$expires){ - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'카카오로그인이 이루어지지 않았습니다.' ]); @@ -34,7 +35,7 @@ if(!$access_token || !$expires){ $restAPI = new Kakao_REST_API_Helper($access_token); if($expires < $nowDate && (!$refresh_token || ($refresh_token_expires < $nowDate))){ - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'로그인 토큰 만료.'.$refresh_token_expires.' 다시 카카오로그인을 수행해주세요.' ]); @@ -46,7 +47,7 @@ if($expires < $nowDate){ $result = $restAPI->refresh_access_token($refresh_token); if(!isset($refresh_token)){ - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'카카오 로그인 과정 중 추가 갱신 절차를 실패했습니다' ]); @@ -65,7 +66,7 @@ getRootDB()->query("lock tables member write, member_log write"); $isUser = getRootDB()->queryFirstRow( 'SELECT count(`no`) from member where no=%i',$userID); if(!$isUser){ - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'회원이 아닙니다. 관리자에게 문의해주세요.' ]); @@ -87,7 +88,7 @@ $sendResult = $restAPI->talk_to_me_default([ ]); $sendResult['code'] = util::array_get($sendResult['code'], 0); if($sendResult['code'] < 0){ - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'카카오톡 메시지를 보내지 못했습니다.' ]); @@ -112,7 +113,7 @@ getRootDB()->insert('member_log', [ getRootDB()->query("unlock tables"); -returnJson([ +Json::die([ 'result'=>true, 'reason'=>'success' ]); \ No newline at end of file diff --git a/oauth_kakao/j_check_dup.php b/oauth_kakao/j_check_dup.php index 67a26fdf..d0c40458 100644 --- a/oauth_kakao/j_check_dup.php +++ b/oauth_kakao/j_check_dup.php @@ -1,24 +1,26 @@ queryFirstField('SELECT REG FROM `SYSTEM` WHERE `NO` = 1'); if($canJoin != 'Y'){ - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'현재는 가입이 금지되어있습니다!' ]); @@ -23,14 +25,14 @@ $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){ - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'로그인 토큰 에러. 다시 카카오로그인을 수행해주세요.' ]); } if($expires < $nowDate && (!$refresh_token || ($refresh_token_expires < $nowDate))){ unset($_SESSION['access_token']); - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'로그인 토큰 만료.'.$refresh_token_expires.' 다시 카카오로그인을 수행해주세요.' ]); @@ -41,21 +43,21 @@ $password = util::array_get($_POST['password']); $nickname = util::array_get($_POST['nickname']); if(!$username || !$password || !$nickname){ - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'입력값이 설정되지 않았습니다.' ]); } if(strlen($password)!=128){ - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'올바르지 않은 비밀번호 해시 포맷입니다.' ]); } if(!$secret_agree){ - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'약관에 동의해야 가입하실 수 있습니다.' ]); @@ -63,7 +65,7 @@ if(!$secret_agree){ $usernameChk = checkUsernameDup($username); if($usernameChk !== true){ - returnJson([ + Json::die([ 'result'=>false, 'reason'=>$usernameChk ]); @@ -71,7 +73,7 @@ if($usernameChk !== true){ $nicknameChk = checkNicknameDup($nickname); if($nicknameChk !== true){ - returnJson([ + Json::die([ 'result'=>false, 'reason'=>$nicknameChk ]); @@ -87,7 +89,7 @@ if($expires < $nowDate){ $result = $restAPI->refresh_access_token($refresh_token); if(!isset($refresh_token)){ unset($_SESSION['access_token']); - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'카카오 로그인 과정 중 추가 갱신 절차를 실패했습니다' ]); @@ -106,7 +108,7 @@ $signupResult = $restAPI->signup(); $kakaoID = util::array_get($signupResult['id']); if(!$kakaoID && util::array_get($signupResult['msg'])!='already registered'){ - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'카카오 로그인 과정 중 앱 연결 절차를 실패했습니다'.json_encode($signupResult) ]); @@ -116,7 +118,7 @@ $me = $restAPI->meWithEmail(); $me['code'] = util::array_get($me['code'], 0); if ($me['code']< 0) { $restAPI->unlink(); - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'카카오로그인이 정상적으로 수행되지 않았습니다.' ]); @@ -124,7 +126,7 @@ if ($me['code']< 0) { if(!util::array_get($me['kaccount_email_verified'],false)){ $restAPI->unlink(); - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'카카오 계정 이메일이 아직 인증되지 않았습니다' ]); @@ -135,7 +137,7 @@ $_SESSION['kaccount_email'] = $email; $emailChk = checkEmailDup($email); if($emailChk !== true){ $restAPI->unlink(); - returnJson([ + Json::die([ 'result'=>false, 'reason'=>$emailChk ]); @@ -165,7 +167,7 @@ getRootDB()->insert('member_log', [ ], JSON_UNESCAPED_UNICODE) ]); -returnJson([ +Json::die([ 'result'=>true, 'reason'=>'success' ]); diff --git a/oauth_kakao/j_login_oauth.php b/oauth_kakao/j_login_oauth.php index cc9f8fed..0cc7513e 100644 --- a/oauth_kakao/j_login_oauth.php +++ b/oauth_kakao/j_login_oauth.php @@ -1,10 +1,12 @@ isLoggedIn()){ @@ -13,7 +15,7 @@ if($SESSION->isLoggedIn()){ $canLogin = getRootDB()->queryFirstField('SELECT `LOGIN` FROM `SYSTEM` WHERE `NO` = 1'); if($canLogin != 'Y'){ - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'현재는 로그인이 금지되어있습니다!', 'noRetry'=>true @@ -30,7 +32,7 @@ $email = util::array_get($_SESSION['kaccount_email']); if(!$access_token || !$expires){ - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'카카오로그인이 이루어지지 않았습니다.' ]); @@ -40,7 +42,7 @@ if(!$access_token || !$expires){ $restAPI = new Kakao_REST_API_Helper($access_token); if($expires < $nowDate && (!$refresh_token || ($refresh_token_expires < $nowDate))){ - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'로그인 토큰 만료.'.$refresh_token_expires.' 다시 카카오로그인을 수행해주세요.' ]); @@ -52,7 +54,7 @@ if($expires < $nowDate){ $result = $restAPI->refresh_access_token($refresh_token); if(!isset($refresh_token)){ - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'카카오 로그인 과정 중 추가 갱신 절차를 실패했습니다' ]); @@ -71,7 +73,7 @@ if(!$email){ $me = $restAPI->meWithEmail(); $me['code'] = util::array_get($me['code'], 0); if ($me['code']< 0) { - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'카카오로그인이 정상적으로 수행되지 않았습니다.' ]); @@ -79,7 +81,7 @@ if(!$email){ if(!util::array_get($me['kaccount_email_verified'],false)){ $restAPI->unlink(); - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'카카오 계정 이메일이 아직 인증되지 않았습니다' ]); @@ -96,7 +98,7 @@ $userInfo = getRootDB()->queryFirstRow( if(!$userInfo){ $restAPI->unlink(); unset($_SESSION['access_token']); - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'카카오로그인에 해당하는 계정이 없습니다. 재 가입을 시도해주세요.' ]); @@ -107,7 +109,7 @@ if($userInfo['delete_after']){ $restAPI->unlink(); unset($_SESSION['access_token']); getRootDB()->delete('member', 'no=%i', $userInfo['no']); - returnJson([ + Json::die([ 'result'=>false, 'reason'=>"기간 만기로 삭제되었습니다. 재 가입을 시도해주세요." ]); @@ -115,7 +117,7 @@ if($userInfo['delete_after']){ else{ $restAPI->unlink(); unset($_SESSION['access_token']); - returnJson([ + Json::die([ 'result'=>false, 'reason'=>"삭제 요청된 계정입니다.[{$userInfo['delete_after']}]" ]); @@ -124,7 +126,7 @@ if($userInfo['delete_after']){ } $SESSION->login($userInfo['no'], $userInfo['id'], $userInfo['grade']); -returnJson([ +Json::die([ 'result'=>true, 'reason'=>'로그인 되었습니다.' ]); \ No newline at end of file diff --git a/oauth_kakao/join.php b/oauth_kakao/join.php index 6f19f60c..b5cdd41e 100644 --- a/oauth_kakao/join.php +++ b/oauth_kakao/join.php @@ -1,9 +1,11 @@ diff --git a/twe/event_1.php b/twe/event_1.php index e6a06687..e31228bf 100644 --- a/twe/event_1.php +++ b/twe/event_1.php @@ -1,4 +1,6 @@ = 22) { $str = "{$str}"; } diff --git a/twe/func_template.php b/twe/func_template.php index 227cc967..1d41b815 100644 --- a/twe/func_template.php +++ b/twe/func_template.php @@ -1,4 +1,6 @@ false, 'reason'=>'로그인되지 않았습니다.' ]); } if(!$generalID){ - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'장수를 생성하지 않았습니다.' ]); @@ -26,7 +26,7 @@ $db = getDB(); $image = $rootDB->queryFirstRow('SELECT picture, imgsvr FROM `MEMBER` WHERE no = %i', $userID); if(!$image){ - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'회원 기록 정보가 없습니다' ]); @@ -37,7 +37,7 @@ $db->update('general', [ 'imgsvr'=>$image['imgsvr'] ], 'owner = %i and npc = 0', $userID); -returnJson([ +Json::die([ 'result'=>true, 'reason'=>'success' ]); \ No newline at end of file diff --git a/twe/j_basic_info.php b/twe/j_basic_info.php index f1035589..157c5a96 100644 --- a/twe/j_basic_info.php +++ b/twe/j_basic_info.php @@ -12,16 +12,16 @@ $generalID = getGeneralID(); session_write_close(); if(!$generalID){ - returnJson($result); + Json::die($result); } $generalInfo = getDB()->queryFirstRow('SELECT `nation`, `level` from `general` where `id`=%i', $generalID); if(!$generalInfo){ - returnJson($result); + Json::die($result); } $result['generalID'] = $generalID; $result['myNationID'] = $generalInfo['nation']; $result['isChief'] = ($generalInfo['level'] == 12); -returnJson($result); \ No newline at end of file +Json::die($result); \ No newline at end of file diff --git a/twe/j_build_conf.php b/twe/j_build_conf.php index ca7d8d15..0d50b0a4 100644 --- a/twe/j_build_conf.php +++ b/twe/j_build_conf.php @@ -1,7 +1,7 @@ false, 'reason'=>'이미 설정 파일이 존재합니다.' ]); diff --git a/twe/j_get_new_msg.php b/twe/j_get_new_msg.php index 641a6164..e3d6eac6 100644 --- a/twe/j_get_new_msg.php +++ b/twe/j_get_new_msg.php @@ -2,7 +2,7 @@ include('lib.php'); include('func.php'); -use utilphp\util as util; + $generalID = getGeneralID(); @@ -20,13 +20,13 @@ $nationID = getDB()->queryFirstField( if($nationID === null){ - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'소속 국가가 없습니다' ]); } -returnJson([ +Json::die([ 'result'=>true, 'private'=>getMessage('private', $nationID, 10, $reqSequence), 'public'=>getMessage('public', $nationID, 20, $reqSequence), diff --git a/twe/j_get_scenario_map.php b/twe/j_get_scenario_map.php index 3f8ba558..0acc9356 100644 --- a/twe/j_get_scenario_map.php +++ b/twe/j_get_scenario_map.php @@ -4,10 +4,10 @@ require(__DIR__.'/../f_func/func.php'); require(__DIR__.'/../f_config/SESSION.php'); require('func_install.php'); -use utilphp\util as util; + if($SESSION->getGrade() < 5){ - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'충분한 권한을 가지고 있지 않습니다.' ]); @@ -16,7 +16,7 @@ if($SESSION->getGrade() < 5){ $scenarioIdx = toInt(util::array_get($_GET['scenarioIdx'])); if($scenarioIdx === null){ - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'올바르지 않은 scenarioIdx' ]); diff --git a/twe/j_map.php b/twe/j_map.php index 8d0e4b89..ef162291 100644 --- a/twe/j_map.php +++ b/twe/j_map.php @@ -1,8 +1,10 @@ 12){ - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'잘못된 개월 값' ]); @@ -38,8 +40,8 @@ else{ $result = getWorldMap($post); if($post['year'] && $post['month'] && $result['result']){ //연감 자료는 캐싱 가능 - returnJson($result, false); + Json::die($result, false); } else{ - returnJson($result); + Json::die($result); } diff --git a/twe/j_msg_contact_list.php b/twe/j_msg_contact_list.php index 991cced0..3f17e8c1 100644 --- a/twe/j_msg_contact_list.php +++ b/twe/j_msg_contact_list.php @@ -2,16 +2,16 @@ include('lib.php'); include('func.php'); -use utilphp\util as util; + if(!getGeneralID()){ - returnJson([ + Json::die([ "nation"=>[] ]); } //NOTE: 모든 국가, 모든 장수에 대해서 같은 결과라면 캐싱 가능하지 않을까? -returnJson([ +Json::die([ "nation"=>getMailboxList() ]); \ No newline at end of file diff --git a/twe/j_msg_decide_opt.php b/twe/j_msg_decide_opt.php index 554a908d..c6e61b25 100644 --- a/twe/j_msg_decide_opt.php +++ b/twe/j_msg_decide_opt.php @@ -4,12 +4,12 @@ include 'func.php'; //{msgID: 1206, response: true} -use utilphp\util as util; + $generalID = getGeneralID(); if (!$generalID) { - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'로그인하지 않음' ]); @@ -23,7 +23,7 @@ $msgID = toInt(util::array_get($jsonPost['msgID'], null), false); $msgResponse = util::array_get($jsonPost['response'], null); if ($msgID === null || !is_bool($msgResponse)) { - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'올바르지 않은 인자' ]); @@ -32,7 +32,7 @@ if ($msgID === null || !is_bool($msgResponse)) { $general = getDB()->queryFirstRow('select `no`, `name`, `nation`, `nations`, `level`, `npc`, `gold`, `rice`, `troop` from `general` where `no` = %i', $generalID); if(!$general){ - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'존재하지 않는 장수' ]); @@ -41,7 +41,7 @@ if(!$general){ $result = getSingleMessage($msgID, $general); if (!$result[0]) { - returnJson([ + Json::die([ 'result'=>false, 'reason'=>$result[1] ]); @@ -54,7 +54,7 @@ $msgType = $messageInfo['type']; $validUntil = $messageInfo['valid_until']; $date = date('Y-m-d H:i:s'); if ($validUntil < $date) { - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'만료된 메시지' ]); @@ -70,7 +70,7 @@ $msgDest = json_decode($messageInfo['dest']); $messageInfo['dest'] = $msgDest; if (!$msgAction) { - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'응답 대상 메시지 아님' ]); @@ -78,7 +78,7 @@ if (!$msgAction) { if ($msgType == 'diplomacy' && $msgSrc['nation_id'] != $msgDest['nation_id']) { //여기로 올일이 있나? - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'(버그) 외교 대상 동일' ]); @@ -86,14 +86,14 @@ if ($msgType == 'diplomacy' && $msgSrc['nation_id'] != $msgDest['nation_id']) { if($msgType == 'diplomacy'){ if($general['level'] < 6){ - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'외교 권한 없음' ]); } if($general['nation'] != $msgDest['nation_id']){ - returnJson([ + Json::die([ 'result'=>false, 'reason'=>'올바르지 않은 소속 국가' ]); @@ -110,7 +110,7 @@ case 'ally': break; //TODO:기타 등등 case '': - returnJson([]); + Json::die([]); break; default: //구현이 정상적으로 된 경우 이쪽으로 오지 않음 @@ -118,7 +118,7 @@ default: } -returnJson([ +Json::die([ 'result' => $result[0], 'reason' => $result[1] ]); \ No newline at end of file diff --git a/twe/j_msgsubmit.php b/twe/j_msgsubmit.php index 8e21f741..beb252a1 100644 --- a/twe/j_msgsubmit.php +++ b/twe/j_msgsubmit.php @@ -1,8 +1,10 @@ false, 'reason' => '올바르지 않은 호출입니다.', 'newSeq' => false @@ -31,7 +33,7 @@ $date = $datetime->format('Y-m-d H:i:s'); //로그인 검사 if(!isSigned()){ - returnJson([ + Json::die([ 'result' => false, 'reason' => '로그인되지 않았습니다.', 'newSeq' => false @@ -45,7 +47,7 @@ $connect = dbConn(); increaseRefresh('서신전달', 1); if(getBlockLevel() == 1 || getBlockLevel() == 3) { - returnJson([ + Json::die([ 'result' => false, 'reason' => '차단되었습니다.', 'newSeq' => false @@ -58,7 +60,7 @@ $me = $db->queryFirstRow('select `no`,`name`,`nation`,`level`,`con`,`picture`,`i if(!$me){ resetSessionGeneralValues(); - returnJson([ + Json::die([ 'result' => false, 'reason' => '로그인되지 않았습니다.', 'newSeq' => false @@ -67,7 +69,7 @@ if(!$me){ $con = checkLimit($me['con'], $conlimit); if($con >= 2) { - returnJson([ + Json::die([ 'result' => false, 'reason' => '접속 제한입니다.', 'newSeq' => false @@ -79,7 +81,7 @@ $msg = mb_substr($msg, 0, 99, 'UTF-8'); $msg = trim($msg); if($msg == ''){ - returnJson([ + Json::die([ 'result' => true, 'reason' => 'SUCCESS', 'newSeq' => false @@ -123,7 +125,7 @@ if($destMailbox == 9999) { $msg_interval = $datetime->getTimestamp() - $last_msg->getTimestamp(); //NOTE: 여기서 유저 레벨을 구별할 코드가 필요할까? if($msg_interval < 2){ - returnJson([ + Json::die([ 'result' => false, 'reason' => '개인메세지는 2초당 1건만 보낼 수 있습니다!', 'newSeq' => false @@ -133,7 +135,7 @@ if($destMailbox == 9999) { $destUser = $db->queryFirstRow('select `no`,`name`,`nation` from `general` where `no` = %s',$destMailbox); if($destUser == null || empty($destUser)){ - returnJson([ + Json::die([ 'result' => false, 'reason' => '존재하지 않는 유저입니다.', 'newSeq' => false @@ -151,14 +153,14 @@ if($destMailbox == 9999) { sendMessage('private', $src, $dest, $msg, $date); } else{ - returnJson([ + Json::die([ 'result' => false, 'reason' => '알 수 없는 에러', 'newSeq' => false ]); } -returnJson([ +Json::die([ 'result' => true, 'reason' => 'SUCCESS', 'newSeq' => true diff --git a/twe/j_server_basic_info.php b/twe/j_server_basic_info.php index df5b6f40..d8a69599 100644 --- a/twe/j_server_basic_info.php +++ b/twe/j_server_basic_info.php @@ -3,7 +3,7 @@ include "lib.php"; include "func.php"; if(!getUserID()){ - returnJson([ + Json::die([ 'game'=>'x', 'me'=>'no' ]); @@ -88,7 +88,7 @@ if($generalID){ } //TODO: 이를 표현하는 방법은 '이전 버전'의 serverListPost.php를 참고할 것. -returnJson([ +Json::die([ 'game'=>$game, 'me'=>$me?$me:null ]); \ No newline at end of file diff --git a/twe/j_turn.php b/twe/j_turn.php index 8ddfb695..48e4e6d3 100644 --- a/twe/j_turn.php +++ b/twe/j_turn.php @@ -2,7 +2,7 @@ include "lib.php"; include "func.php"; -use utilphp\util as util; + if(!isSigned()){ diff --git a/twe/join.php b/twe/join.php index 7366d6e2..055802f5 100644 --- a/twe/join.php +++ b/twe/join.php @@ -1,4 +1,6 @@ array($baseDir . '/src'), 'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'), 'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-message/src'), 'Monolog\\' => array($vendorDir . '/monolog/monolog/src/Monolog'), diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 2dacdbbf..d825715a 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -13,6 +13,10 @@ class ComposerStaticInit67b09c83b85c3bc0027caefe5bba171a ); public static $prefixLengthsPsr4 = array ( + 's' => + array ( + 'sammo\\' => 6, + ), 'P' => array ( 'Psr\\Log\\' => 8, @@ -36,6 +40,10 @@ class ComposerStaticInit67b09c83b85c3bc0027caefe5bba171a ); public static $prefixDirsPsr4 = array ( + 'sammo\\' => + array ( + 0 => __DIR__ . '/../..' . '/src', + ), 'Psr\\Log\\' => array ( 0 => __DIR__ . '/..' . '/psr/log/Psr/Log',