From c73a3bcf95412997dc0a0bfc671f731c743bb651 Mon Sep 17 00:00:00 2001 From: hide_d Date: Mon, 15 Jan 2018 01:27:05 +0900 Subject: [PATCH] =?UTF-8?q?che=5Fclose=20=EA=B3=84=EC=97=B4=20=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EC=88=98=EC=A0=95=20=EC=99=84=EB=A3=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/settings.json | 4 ++-- che/.htaccess | 4 ++++ deploy_che.sh | 4 ++-- deploy_devel_kwe.sh | 2 +- deploy_devel_pwe.sh | 2 +- deploy_devel_twe.sh | 2 +- i_entrance/adminAction.js | 2 +- i_entrance/adminPost.php | 13 ++----------- process_all.sh | 10 +++++----- 9 files changed, 19 insertions(+), 24 deletions(-) create mode 100644 che/.htaccess diff --git a/.vscode/settings.json b/.vscode/settings.json index f157954f..803da7d5 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -7,11 +7,11 @@ "**/.DS_Store": true, "**/logs/*.txt": true, "**/session/sess*":true, - //"**/che_close": true, + "**/che": true, }, "search.exclude": { - "**/che_close": true, + "**/che": true, "e_lib/*":true, }, diff --git a/che/.htaccess b/che/.htaccess new file mode 100644 index 00000000..d4841646 --- /dev/null +++ b/che/.htaccess @@ -0,0 +1,4 @@ +Deny from all +SetEnvIf X-Forwarded-For ^192\.168\.0\.1 env_allow_1 +Allow from env=env_allow_1 +Allow from 192.168.0.1 diff --git a/deploy_che.sh b/deploy_che.sh index eab97319..a1cce4b3 100644 --- a/deploy_che.sh +++ b/deploy_che.sh @@ -1,8 +1,8 @@ #!/bin/bash SAM=che -SRC=~/svn/trunk/sam/che_close/ -TAR=~/www/sam/${SAM}_close/ +SRC=~/svn/trunk/sam/che/ +TAR=~/www/sam/${SAM}/ ALT=~/www/sam/${SAM}/ if [ -e $TAR ] diff --git a/deploy_devel_kwe.sh b/deploy_devel_kwe.sh index e9c6999c..03038129 100644 --- a/deploy_devel_kwe.sh +++ b/deploy_devel_kwe.sh @@ -2,7 +2,7 @@ SAM=kwe SRC=~/svn/branches/che_devel/ -TAR=~/www/sam/${SAM}_close/ +TAR=~/www/sam/${SAM}/ ALT=~/www/sam/${SAM}/ if [ -e $TAR ] diff --git a/deploy_devel_pwe.sh b/deploy_devel_pwe.sh index ccb4ac1b..2b814410 100644 --- a/deploy_devel_pwe.sh +++ b/deploy_devel_pwe.sh @@ -2,7 +2,7 @@ SAM=pwe SRC=~/svn/branches/che_devel/ -TAR=~/www/sam/${SAM}_close/ +TAR=~/www/sam/${SAM}/ ALT=~/www/sam/${SAM}/ if [ -e $TAR ] diff --git a/deploy_devel_twe.sh b/deploy_devel_twe.sh index 5166aa08..45394929 100644 --- a/deploy_devel_twe.sh +++ b/deploy_devel_twe.sh @@ -2,7 +2,7 @@ SAM=twe SRC=~/svn/branches/che_devel/ -TAR=~/www/sam/${SAM}_close/ +TAR=~/www/sam/${SAM}/ ALT=~/www/sam/${SAM}/ if [ -e $TAR ] diff --git a/i_entrance/adminAction.js b/i_entrance/adminAction.js index 254de0f3..75db42f8 100644 --- a/i_entrance/adminAction.js +++ b/i_entrance/adminAction.js @@ -80,7 +80,7 @@ function Entrance_AdminNPCCreate(serverDir) { } function Entrance_AdminClosedLogin(serverDir) { - ReplaceFrame(serverDir+'_close'+W+'npc_login'+PHP); + ReplaceFrame(serverDir+W+'npc_login'+PHP); } function Entrance_AdminOpen119(serverDir) { diff --git a/i_entrance/adminPost.php b/i_entrance/adminPost.php index f7b16859..f88a1e04 100644 --- a/i_entrance/adminPost.php +++ b/i_entrance/adminPost.php @@ -25,9 +25,8 @@ $select = util::array_get($_POST['select'], ''); $rs = $DB->Select('GRADE', 'MEMBER', "NO='{$SESSION->NoMember()}'"); $member = $DB->Get($rs); -function doServerModeSet($server, $select, &$reason){ +function doServerModeSet($server, $select, &$response){ global $_serverDirs; - $reason = ''; $serverDir = $_serverDirs[$server]; $serverPath = ROOT.W.$serverDir; $realServerPath = realpath(dirname(__FILE__)).W.$serverPath; @@ -50,20 +49,16 @@ function doServerModeSet($server, $select, &$reason){ $htaccess = $templates->render('block_htaccess', ['allow_ip' => $allow_ip, 'xforward_allow_ip' => $xforward_allow_ip]); file_put_contents($realServerPath.'/.htaccess', $htaccess); - - $response['result'] = 'SUCCESS'; } elseif($select == 1) {//리셋 if(file_exists($realServerPath.W.D_SETTING.W.SET.PHP)){ @unlink($realServerPath.W.D_SETTING.W.SET.PHP); } $response['installURL'] = $serverPath.W."install.php"; - $response['result'] = 'SUCCESS'; } elseif($select == 2) {//오픈 if(file_exists($realServerPath.'.htaccess')){ @unlink($realServerPath.'.htaccess'); } - $response['result'] = 'SUCCESS'; } return true; } @@ -83,13 +78,9 @@ function doAdminPost($member, $action, $notice, $server, $select){ } if($action == 1) { - $reason = ''; - if(doServerModeSet($server, $select, $reason)){ + if(doServerModeSet($server, $select, $response)){ $response['result'] = 'SUCCESS'; } - else{ - $response['msg'] = $reason; - } return $response; } diff --git a/process_all.sh b/process_all.sh index 4893190e..3ed57ee9 100644 --- a/process_all.sh +++ b/process_all.sh @@ -12,7 +12,7 @@ HOUR=`expr ${HOUR} + 0` -TAR=/home/jwh1807/www/sam/che_close/ +TAR=/home/jwh1807/www/sam/che/ if [ -e $TAR ] then TIME=`date -d "0 hours" "+%H:%M:%S.%N"` @@ -27,7 +27,7 @@ fi if [ $HOUR -ge 9 -a $HOUR -lt 21 ] then - TAR=/home/jwh1807/www/sam/kwe_close/ + TAR=/home/jwh1807/www/sam/kwe/ if [ -e $TAR ] then TIME=`date -d "0 hours" "+%H:%M:%S.%N"` @@ -38,7 +38,7 @@ then echo [$TIME] kwe finish. fi - TAR=/home/jwh1807/www/sam/pwe_close/ + TAR=/home/jwh1807/www/sam/pwe/ if [ -e $TAR ] then TIME=`date -d "0 hours" "+%H:%M:%S.%N"` @@ -49,7 +49,7 @@ then echo [$TIME] pwe finish. fi - TAR=/home/jwh1807/www/sam/twe_close/ + TAR=/home/jwh1807/www/sam/twe/ if [ -e $TAR ] then TIME=`date -d "0 hours" "+%H:%M:%S.%N"` @@ -60,7 +60,7 @@ then echo [$TIME] twe finish. fi - TAR=/home/jwh1807/www/sam/hwe_close/ + TAR=/home/jwh1807/www/sam/hwe/ if [ -e $TAR ] then TIME=`date -d "0 hours" "+%H:%M:%S.%N"`