From e581ffc40b8a1505d8e51ba816793b86e8e8960c Mon Sep 17 00:00:00 2001 From: zero Date: Thu, 18 Sep 2008 12:32:38 +0000 Subject: [PATCH] =?UTF-8?q?172900064=20FTP=20class=20=EC=B6=94=EA=B0=80=20?= =?UTF-8?q?=EB=B0=8F=20=EC=84=A4=EC=B9=98=EC=8B=9C=EC=97=90=20FTP=EC=A0=95?= =?UTF-8?q?=EB=B3=B4=EB=A5=BC=20=EC=9E=85=EB=A0=A5/=EC=A0=80=EC=9E=A5?= =?UTF-8?q?=ED=95=98=EB=8A=94=20=EB=A3=A8=ED=8B=B4=20=EC=B6=94=EA=B0=80.?= =?UTF-8?q?=20=EB=94=94=EB=A0=89=ED=86=A0=EB=A6=AC=20=EC=83=9D=EC=84=B1?= =?UTF-8?q?=EC=8B=9C=20safe=5Fmode=EC=9D=BC=20=EA=B2=BD=EC=9A=B0=20ftp?= =?UTF-8?q?=EB=A1=9C=20=EB=94=94=EB=A0=89=ED=86=A0=EB=A6=AC=EB=A5=BC=20?= =?UTF-8?q?=EB=A7=8C=EB=93=A4=EB=8F=84=EB=A1=9D=20=EC=B2=98=EB=A6=AC.=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80=20=ED=85=8C=EC=8A=A4=ED=8A=B8=20=ED=95=84?= =?UTF-8?q?=EC=9A=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://xe-core.googlecode.com/svn/sandbox@4520 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- classes/context/Context.class.php | 36 ++ classes/file/FileHandler.class.php | 25 +- classes/module/ModuleHandler.class.php | 93 ++-- common/js/xml_js_filter.js | 2 +- common/lang/en.lang.php | 22 + common/lang/es.lang.php | 22 + common/lang/fr.lang.php | 22 + common/lang/ge.lang.php | 22 + common/lang/jp.lang.php | 22 + common/lang/ko.lang.php | 21 + common/lang/ru.lang.php | 22 + common/lang/zh-CN.lang.php | 22 + libs/ftp.class.php | 522 ++++++++++++++++++ modules/install/conf/module.xml | 2 + modules/install/install.controller.php | 75 +++ modules/install/install.view.php | 7 +- modules/install/tpl/css/install.css | 1 + modules/install/tpl/ftp.html | 38 ++ modules/install/tpl/js/install_admin.js | 26 + .../member/openid_lib/class_HTTPRetriever.php | 2 +- .../tccommentnotify.controller.php | 2 +- 21 files changed, 955 insertions(+), 51 deletions(-) create mode 100644 libs/ftp.class.php create mode 100644 modules/install/tpl/ftp.html diff --git a/classes/context/Context.class.php b/classes/context/Context.class.php index 541f3febb..4bb6edfba 100644 --- a/classes/context/Context.class.php +++ b/classes/context/Context.class.php @@ -22,6 +22,7 @@ var $context = NULL; ///< @brief request parameter 및 각종 환경 변수등을 정리하여 담을 변수 var $db_info = NULL; ///< @brief DB 정보 + var $ftp_info = NULL; ///< @brief FTP 정보 var $ssl_actions = array(); ///< @brief ssl로 전송해야 할 action등록 (common/js/xml_handler.js에서 ajax통신시 활용) var $js_files = array(); ///< @brief display시에 사용하게 되는 js files의 목록 @@ -260,6 +261,34 @@ return $this->db_info; } + /** + * @biref FTP 정보가 등록되었는지 확인 + **/ + function isFTPRegisted() { + $ftp_config_file = Context::getFTPConfigFile(); + if(file_exists($ftp_config_file)) return true; + return false; + } + + /** + * @brief FTP 정보가 담긴 object를 return + **/ + function getFTPInfo() { + $oContext = &Context::getInstance(); + return $oContext->_getFTPInfo(); + } + + /** + * @brief FTP 정보가 담긴 object를 return + **/ + function _getFTPInfo() { + if(!$this->isFTPRegisted()) return null; + + $ftp_config_file = $this->getFTPConfigFile(); + @include($ftp_config_file); + return $ftp_info; + } + /** * @brief 사이트 title adding **/ @@ -958,6 +987,13 @@ return _XE_PATH_."files/config/db.config.php"; } + /** + * @brief ftp설정내용이 저장되어 있는 config file의 path를 return + **/ + function getFTPConfigFile() { + return _XE_PATH_."files/config/ftp.config.php"; + } + /** * @brief 설치가 되어 있는지에 대한 체크 * diff --git a/classes/file/FileHandler.class.php b/classes/file/FileHandler.class.php index 10f4617a3..69d41c548 100644 --- a/classes/file/FileHandler.class.php +++ b/classes/file/FileHandler.class.php @@ -121,6 +121,22 @@ * 주어진 경로를 단계별로 접근하여 recursive하게 디렉토리 생성 **/ function makeDir($path_string) { + static $oFtp = null; + + // safe_mode 일 경우 ftp 정보를 이용해서 디렉토리 생성 + if(ini_get('safe_mode') && $oFtp == null) { + if(!Context::isFTPRegisted()) return; + + require_once(_XE_PATH_.'libs/ftp.class.php'); + $ftp_info = Context::getFTPInfo(); + $oFtp = new ftp(); + if(!$oFtp->ftp_connect('localhost')) return; + if(!$oFtp->ftp_login($ftp_info->ftp_user, $ftp_info->ftp_password)) { + $oFtp->ftp_quit(); + return; + } + } + $path_string = str_replace(_XE_PATH_,'',$path_string); $path_list = explode('/', $path_string); @@ -129,8 +145,13 @@ if(!$path_list[$i]) continue; $path .= $path_list[$i].'/'; if(!is_dir($path)) { - @mkdir($path, 0755); - @chmod($path, 0755); + if(ini_get('safe_mode')) { + $oFtp->ftp_mkdir($path); + $oFtp->ftp_site("CHMOD 777 ".$path); + } else { + @mkdir($path, 0755); + @chmod($path, 0755); + } } } diff --git a/classes/module/ModuleHandler.class.php b/classes/module/ModuleHandler.class.php index 95100420a..014cd3f47 100644 --- a/classes/module/ModuleHandler.class.php +++ b/classes/module/ModuleHandler.class.php @@ -181,61 +181,64 @@ $this->error = 'msg_module_is_not_exists'; } - // 에러가 발생하였을시 처리 - if($this->error) { - // message 모듈 객체를 생성해서 컨텐츠 생성 - $oMessageView = &getView('message'); - $oMessageView->setError(-1); - $oMessageView->setMessage($this->error); - $oMessageView->dispMessage(); + // XMLRPC call 이 아니면 message view 객체 이용하도록 + if(Context::getRequestMethod() != 'XMLRPC') { + // 에러가 발생하였을시 처리 + if($this->error) { + // message 모듈 객체를 생성해서 컨텐츠 생성 + $oMessageView = &getView('message'); + $oMessageView->setError(-1); + $oMessageView->setMessage($this->error); + $oMessageView->dispMessage(); - // 정상적으로 호출된 객체가 있을 경우 해당 객체의 template를 변경 - if($oModule) { - $oModule->setTemplatePath($oMessageView->getTemplatePath()); - $oModule->setTemplateFile($oMessageView->getTemplateFile()); + // 정상적으로 호출된 객체가 있을 경우 해당 객체의 template를 변경 + if($oModule) { + $oModule->setTemplatePath($oMessageView->getTemplatePath()); + $oModule->setTemplateFile($oMessageView->getTemplateFile()); - // 그렇지 않으면 message 객체를 호출된 객체로 지정 - } else { - $oModule = $oMessageView; + // 그렇지 않으면 message 객체를 호출된 객체로 지정 + } else { + $oModule = $oMessageView; + } } - } - // 해당 모듈에 layout_srl이 있는지 확인 - if($oModule->module_info->layout_srl && !$oModule->getLayoutFile()) { + // 해당 모듈에 layout_srl이 있는지 확인 + if($oModule->module_info->layout_srl && !$oModule->getLayoutFile()) { - // layout_srl이 있으면 해당 레이아웃 정보를 가져와 layout_path/ layout_file 위치 변경 - $oLayoutModel = &getModel('layout'); - $layout_info = $oLayoutModel->getLayout($oModule->module_info->layout_srl); + // layout_srl이 있으면 해당 레이아웃 정보를 가져와 layout_path/ layout_file 위치 변경 + $oLayoutModel = &getModel('layout'); + $layout_info = $oLayoutModel->getLayout($oModule->module_info->layout_srl); - if($layout_info) { + if($layout_info) { - // 레이아웃 정보중 extra_vars의 이름과 값을 $layout_info에 입력 - if($layout_info->extra_var_count) { - foreach($layout_info->extra_var as $var_id => $val) { - $layout_info->{$var_id} = $val->value; + // 레이아웃 정보중 extra_vars의 이름과 값을 $layout_info에 입력 + if($layout_info->extra_var_count) { + foreach($layout_info->extra_var as $var_id => $val) { + $layout_info->{$var_id} = $val->value; + } } - } - - // 레이아웃 정보중 menu를 Context::set - if($layout_info->menu_count) { - foreach($layout_info->menu as $menu_id => $menu) { - if(file_exists($menu->php_file)) @include($menu->php_file); - Context::set($menu_id, $menu); + + // 레이아웃 정보중 menu를 Context::set + if($layout_info->menu_count) { + foreach($layout_info->menu as $menu_id => $menu) { + if(file_exists($menu->php_file)) @include($menu->php_file); + Context::set($menu_id, $menu); + } } + + // 레이아웃 정보중 header_script가 있으면 헤더 추가 + if($layout_info->header_script) Context::addHtmlHeader($layout_info->header_script); + + // 레이아웃 정보를 Context::set + Context::set('layout_info', $layout_info); + + $oModule->setLayoutPath($layout_info->path); + $oModule->setLayoutFile('layout'); + + // 레이아웃이 수정되었을 경우 수정본을 지정 + $edited_layout = sprintf('./files/cache/layout/%d.html', $layout_info->layout_srl); + if(file_exists($edited_layout)) $oModule->setEditedLayoutFile($edited_layout); } - - // 레이아웃 정보중 header_script가 있으면 헤더 추가 - if($layout_info->header_script) Context::addHtmlHeader($layout_info->header_script); - - // 레이아웃 정보를 Context::set - Context::set('layout_info', $layout_info); - - $oModule->setLayoutPath($layout_info->path); - $oModule->setLayoutFile('layout'); - - // 레이아웃이 수정되었을 경우 수정본을 지정 - $edited_layout = sprintf('./files/cache/layout/%d.html', $layout_info->layout_srl); - if(file_exists($edited_layout)) $oModule->setEditedLayoutFile($edited_layout); } } diff --git a/common/js/xml_js_filter.js b/common/js/xml_js_filter.js index 0fdb914c0..a7920c56d 100644 --- a/common/js/xml_js_filter.js +++ b/common/js/xml_js_filter.js @@ -297,7 +297,7 @@ function XmlJsFilterProc(confirm_msg) { } exec_xml(this.module, this.act, params, this.user_func, response, params, this.fo_obj); - return null; + return false; } // form proc diff --git a/common/lang/en.lang.php b/common/lang/en.lang.php index 79c05b700..4ddbf33ac 100644 --- a/common/lang/en.lang.php +++ b/common/lang/en.lang.php @@ -236,6 +236,28 @@ $lang->is_active = 'Active'; $lang->is_required = 'Required Field'; + // ftp 관련 + $lang->ftp_form_title = 'FTP 정보 입력'; + $lang->ftp = 'FTP'; + $lang->ftp_port = 'FTP port'; + $lang->cmd_check_ftp_connect = 'FTP 접속 확인'; + $lang->about_ftp_info = " + FTP 정보는 다음의 경우에 이용될 수 있습니다.
+ 1. PHP의 safe_mode=On일 경우에 FTP 정보를 이용해서 XE를 정상적으로 동작할 수 있게 합니다.
+ 2. 자동 업데이트등에서 FTP 정보를 이용할 수 있습니다.
+ 이 FTP정보는 files/config/ftp.config.php 파일내에 정보가 저장됩니다.
+ 그리고 설치 후 관리자 페이지에서 FTP 정보를 변경하거나 제거할 수 있습니다.
+ FTP 정보 노출을 원하지 않으시면 입력하지 않으셔도 됩니다 + "; + + $lang->msg_safe_mode_ftp_needed = "PHP의 safe_mode가 On일 경우 FTP 정보를 꼭 입력해주셔야 XE의 설치 및 사용이 가능합니다"; + $lang->msg_ftp_not_connected = "localhost로의 FTP 접속 오류가 발생하였습니다. ftp 포트 번호를 확인해주시거나 ftp 서비스가 가능한지 확인해주세요"; + $lang->msg_ftp_invalid_auth_info = "입력하신 FTP 정보로 로그인을 하지 못했습니다. FTP정보를 확인해주세요"; + $lang->msg_ftp_mkdir_fail = "FTP를 이용한 디렉토리 생성 명령을 실패하였습니다. FTP 서버의 설정을 확인해주세요"; + $lang->msg_ftp_chmod_fail = "FTP를 이용한 디렉토리의 속성 변경을 실패하였습니다. FTP 서버의 설정을 확인해주세요"; + $lang->msg_ftp_connect_success = "FTP 접속 및 인증 성공하였습니다"; + + // Alert messages for Javascript using by XML filter $lang->filter->isnull = 'Please input a value for %s'; $lang->filter->outofrange = 'Please align the text length of %s'; diff --git a/common/lang/es.lang.php b/common/lang/es.lang.php index 0deb7f450..9a662aecb 100644 --- a/common/lang/es.lang.php +++ b/common/lang/es.lang.php @@ -235,6 +235,28 @@ $lang->is_active = 'Activado'; $lang->is_required = 'Espacio requerido'; + // ftp 관련 + $lang->ftp_form_title = 'FTP 정보 입력'; + $lang->ftp = 'FTP'; + $lang->ftp_port = 'FTP port'; + $lang->cmd_check_ftp_connect = 'FTP 접속 확인'; + $lang->about_ftp_info = " + FTP 정보는 다음의 경우에 이용될 수 있습니다.
+ 1. PHP의 safe_mode=On일 경우에 FTP 정보를 이용해서 XE를 정상적으로 동작할 수 있게 합니다.
+ 2. 자동 업데이트등에서 FTP 정보를 이용할 수 있습니다.
+ 이 FTP정보는 files/config/ftp.config.php 파일내에 정보가 저장됩니다.
+ 그리고 설치 후 관리자 페이지에서 FTP 정보를 변경하거나 제거할 수 있습니다.
+ FTP 정보 노출을 원하지 않으시면 입력하지 않으셔도 됩니다 + "; + + $lang->msg_safe_mode_ftp_needed = "PHP의 safe_mode가 On일 경우 FTP 정보를 꼭 입력해주셔야 XE의 설치 및 사용이 가능합니다"; + $lang->msg_ftp_not_connected = "localhost로의 FTP 접속 오류가 발생하였습니다. ftp 포트 번호를 확인해주시거나 ftp 서비스가 가능한지 확인해주세요"; + $lang->msg_ftp_invalid_auth_info = "입력하신 FTP 정보로 로그인을 하지 못했습니다. FTP정보를 확인해주세요"; + $lang->msg_ftp_mkdir_fail = "FTP를 이용한 디렉토리 생성 명령을 실패하였습니다. FTP 서버의 설정을 확인해주세요"; + $lang->msg_ftp_chmod_fail = "FTP를 이용한 디렉토리의 속성 변경을 실패하였습니다. FTP 서버의 설정을 확인해주세요"; + $lang->msg_ftp_connect_success = "FTP 접속 및 인증 성공하였습니다"; + + // Mensajes de alerta para Javascript usando el filtro XML $lang->filter->isnull = 'Ingresar un valor para %s'; $lang->filter->outofrange = 'Ajustar el largo del texto de %s'; diff --git a/common/lang/fr.lang.php b/common/lang/fr.lang.php index 00025e5b1..8c2ea1bee 100644 --- a/common/lang/fr.lang.php +++ b/common/lang/fr.lang.php @@ -236,6 +236,28 @@ $lang->is_active = 'Actif'; $lang->is_required = 'Item essentielle'; + // ftp 관련 + $lang->ftp_form_title = 'FTP 정보 입력'; + $lang->ftp = 'FTP'; + $lang->ftp_port = 'FTP port'; + $lang->cmd_check_ftp_connect = 'FTP 접속 확인'; + $lang->about_ftp_info = " + FTP 정보는 다음의 경우에 이용될 수 있습니다.
+ 1. PHP의 safe_mode=On일 경우에 FTP 정보를 이용해서 XE를 정상적으로 동작할 수 있게 합니다.
+ 2. 자동 업데이트등에서 FTP 정보를 이용할 수 있습니다.
+ 이 FTP정보는 files/config/ftp.config.php 파일내에 정보가 저장됩니다.
+ 그리고 설치 후 관리자 페이지에서 FTP 정보를 변경하거나 제거할 수 있습니다.
+ FTP 정보 노출을 원하지 않으시면 입력하지 않으셔도 됩니다 + "; + + $lang->msg_safe_mode_ftp_needed = "PHP의 safe_mode가 On일 경우 FTP 정보를 꼭 입력해주셔야 XE의 설치 및 사용이 가능합니다"; + $lang->msg_ftp_not_connected = "localhost로의 FTP 접속 오류가 발생하였습니다. ftp 포트 번호를 확인해주시거나 ftp 서비스가 가능한지 확인해주세요"; + $lang->msg_ftp_invalid_auth_info = "입력하신 FTP 정보로 로그인을 하지 못했습니다. FTP정보를 확인해주세요"; + $lang->msg_ftp_mkdir_fail = "FTP를 이용한 디렉토리 생성 명령을 실패하였습니다. FTP 서버의 설정을 확인해주세요"; + $lang->msg_ftp_chmod_fail = "FTP를 이용한 디렉토리의 속성 변경을 실패하였습니다. FTP 서버의 설정을 확인해주세요"; + $lang->msg_ftp_connect_success = "FTP 접속 및 인증 성공하였습니다"; + + // Messages d\'alerte de le Javascript qui est utilisé dans les filtres en XML $lang->filter->isnull = 'Entrez une valeur pour %s'; $lang->filter->outofrange = 'Aligner la longueur du texte de %s'; diff --git a/common/lang/ge.lang.php b/common/lang/ge.lang.php index 0fe60928d..0c0024b44 100644 --- a/common/lang/ge.lang.php +++ b/common/lang/ge.lang.php @@ -236,6 +236,28 @@ $lang->is_active = 'Aktiv'; $lang->is_required = 'Pflichtfeld'; + // ftp 관련 + $lang->ftp_form_title = 'FTP 정보 입력'; + $lang->ftp = 'FTP'; + $lang->ftp_port = 'FTP port'; + $lang->cmd_check_ftp_connect = 'FTP 접속 확인'; + $lang->about_ftp_info = " + FTP 정보는 다음의 경우에 이용될 수 있습니다.
+ 1. PHP의 safe_mode=On일 경우에 FTP 정보를 이용해서 XE를 정상적으로 동작할 수 있게 합니다.
+ 2. 자동 업데이트등에서 FTP 정보를 이용할 수 있습니다.
+ 이 FTP정보는 files/config/ftp.config.php 파일내에 정보가 저장됩니다.
+ 그리고 설치 후 관리자 페이지에서 FTP 정보를 변경하거나 제거할 수 있습니다.
+ FTP 정보 노출을 원하지 않으시면 입력하지 않으셔도 됩니다 + "; + + $lang->msg_safe_mode_ftp_needed = "PHP의 safe_mode가 On일 경우 FTP 정보를 꼭 입력해주셔야 XE의 설치 및 사용이 가능합니다"; + $lang->msg_ftp_not_connected = "localhost로의 FTP 접속 오류가 발생하였습니다. ftp 포트 번호를 확인해주시거나 ftp 서비스가 가능한지 확인해주세요"; + $lang->msg_ftp_invalid_auth_info = "입력하신 FTP 정보로 로그인을 하지 못했습니다. FTP정보를 확인해주세요"; + $lang->msg_ftp_mkdir_fail = "FTP를 이용한 디렉토리 생성 명령을 실패하였습니다. FTP 서버의 설정을 확인해주세요"; + $lang->msg_ftp_chmod_fail = "FTP를 이용한 디렉토리의 속성 변경을 실패하였습니다. FTP 서버의 설정을 확인해주세요"; + $lang->msg_ftp_connect_success = "FTP 접속 및 인증 성공하였습니다"; + + // Alert Nachrichten für JavaScript unter Verwendung von XML-Filter $lang->filter->isnull = 'Bitte geben Sie einen Wert für% s'; $lang->filter->outofrange = 'Bitte richten Sie die Textlänge von% s'; diff --git a/common/lang/jp.lang.php b/common/lang/jp.lang.php index bb2e6cb03..4a65c85ec 100644 --- a/common/lang/jp.lang.php +++ b/common/lang/jp.lang.php @@ -236,6 +236,28 @@ $lang->is_active = '活性化'; $lang->is_required = '必須項目'; + // ftp 관련 + $lang->ftp_form_title = 'FTP 정보 입력'; + $lang->ftp = 'FTP'; + $lang->ftp_port = 'FTP port'; + $lang->cmd_check_ftp_connect = 'FTP 접속 확인'; + $lang->about_ftp_info = " + FTP 정보는 다음의 경우에 이용될 수 있습니다.
+ 1. PHP의 safe_mode=On일 경우에 FTP 정보를 이용해서 XE를 정상적으로 동작할 수 있게 합니다.
+ 2. 자동 업데이트등에서 FTP 정보를 이용할 수 있습니다.
+ 이 FTP정보는 files/config/ftp.config.php 파일내에 정보가 저장됩니다.
+ 그리고 설치 후 관리자 페이지에서 FTP 정보를 변경하거나 제거할 수 있습니다.
+ FTP 정보 노출을 원하지 않으시면 입력하지 않으셔도 됩니다 + "; + + $lang->msg_safe_mode_ftp_needed = "PHP의 safe_mode가 On일 경우 FTP 정보를 꼭 입력해주셔야 XE의 설치 및 사용이 가능합니다"; + $lang->msg_ftp_not_connected = "localhost로의 FTP 접속 오류가 발생하였습니다. ftp 포트 번호를 확인해주시거나 ftp 서비스가 가능한지 확인해주세요"; + $lang->msg_ftp_invalid_auth_info = "입력하신 FTP 정보로 로그인을 하지 못했습니다. FTP정보를 확인해주세요"; + $lang->msg_ftp_mkdir_fail = "FTP를 이용한 디렉토리 생성 명령을 실패하였습니다. FTP 서버의 설정을 확인해주세요"; + $lang->msg_ftp_chmod_fail = "FTP를 이용한 디렉토리의 속성 변경을 실패하였습니다. FTP 서버의 설정을 확인해주세요"; + $lang->msg_ftp_connect_success = "FTP 접속 및 인증 성공하였습니다"; + + // xml filterで用いられているjavascript用のアラートメッセージ $lang->filter->isnull = '%sを入力してください'; $lang->filter->outofrange = '%sの文字の長さを合わせてください'; diff --git a/common/lang/ko.lang.php b/common/lang/ko.lang.php index 06143758a..aeba3b508 100644 --- a/common/lang/ko.lang.php +++ b/common/lang/ko.lang.php @@ -236,6 +236,27 @@ $lang->is_active = '활성'; $lang->is_required = '필수항목'; + // ftp 관련 + $lang->ftp_form_title = 'FTP 정보 입력'; + $lang->ftp = 'FTP'; + $lang->ftp_port = 'FTP port'; + $lang->cmd_check_ftp_connect = 'FTP 접속 확인'; + $lang->about_ftp_info = " + FTP 정보는 다음의 경우에 이용될 수 있습니다.
+ 1. PHP의 safe_mode=On일 경우에 FTP 정보를 이용해서 XE를 정상적으로 동작할 수 있게 합니다.
+ 2. 자동 업데이트등에서 FTP 정보를 이용할 수 있습니다.
+ 이 FTP정보는 files/config/ftp.config.php 파일내에 정보가 저장됩니다.
+ 그리고 설치 후 관리자 페이지에서 FTP 정보를 변경하거나 제거할 수 있습니다.
+ FTP 정보 노출을 원하지 않으시면 입력하지 않으셔도 됩니다 + "; + + $lang->msg_safe_mode_ftp_needed = "PHP의 safe_mode가 On일 경우 FTP 정보를 꼭 입력해주셔야 XE의 설치 및 사용이 가능합니다"; + $lang->msg_ftp_not_connected = "localhost로의 FTP 접속 오류가 발생하였습니다. ftp 포트 번호를 확인해주시거나 ftp 서비스가 가능한지 확인해주세요"; + $lang->msg_ftp_invalid_auth_info = "입력하신 FTP 정보로 로그인을 하지 못했습니다. FTP정보를 확인해주세요"; + $lang->msg_ftp_mkdir_fail = "FTP를 이용한 디렉토리 생성 명령을 실패하였습니다. FTP 서버의 설정을 확인해주세요"; + $lang->msg_ftp_chmod_fail = "FTP를 이용한 디렉토리의 속성 변경을 실패하였습니다. FTP 서버의 설정을 확인해주세요"; + $lang->msg_ftp_connect_success = "FTP 접속 및 인증 성공하였습니다"; + // xml filter에서 사용되는 javascript용 alert msg $lang->filter->isnull = '%s의 값을 입력해주세요'; $lang->filter->outofrange = '%s의 글자 길이를 맞추어 주세요.'; diff --git a/common/lang/ru.lang.php b/common/lang/ru.lang.php index f92d72f08..a87785973 100644 --- a/common/lang/ru.lang.php +++ b/common/lang/ru.lang.php @@ -233,6 +233,28 @@ $lang->column_name = 'Имя колонки'; $lang->column_title = 'Название колонки'; $lang->default_value = 'Стандартное значение'; + + // ftp 관련 + $lang->ftp_form_title = 'FTP 정보 입력'; + $lang->ftp = 'FTP'; + $lang->ftp_port = 'FTP port'; + $lang->cmd_check_ftp_connect = 'FTP 접속 확인'; + $lang->about_ftp_info = " + FTP 정보는 다음의 경우에 이용될 수 있습니다.
+ 1. PHP의 safe_mode=On일 경우에 FTP 정보를 이용해서 XE를 정상적으로 동작할 수 있게 합니다.
+ 2. 자동 업데이트등에서 FTP 정보를 이용할 수 있습니다.
+ 이 FTP정보는 files/config/ftp.config.php 파일내에 정보가 저장됩니다.
+ 그리고 설치 후 관리자 페이지에서 FTP 정보를 변경하거나 제거할 수 있습니다.
+ FTP 정보 노출을 원하지 않으시면 입력하지 않으셔도 됩니다 + "; + + $lang->msg_safe_mode_ftp_needed = "PHP의 safe_mode가 On일 경우 FTP 정보를 꼭 입력해주셔야 XE의 설치 및 사용이 가능합니다"; + $lang->msg_ftp_not_connected = "localhost로의 FTP 접속 오류가 발생하였습니다. ftp 포트 번호를 확인해주시거나 ftp 서비스가 가능한지 확인해주세요"; + $lang->msg_ftp_invalid_auth_info = "입력하신 FTP 정보로 로그인을 하지 못했습니다. FTP정보를 확인해주세요"; + $lang->msg_ftp_mkdir_fail = "FTP를 이용한 디렉토리 생성 명령을 실패하였습니다. FTP 서버의 설정을 확인해주세요"; + $lang->msg_ftp_chmod_fail = "FTP를 이용한 디렉토리의 속성 변경을 실패하였습니다. FTP 서버의 설정을 확인해주세요"; + $lang->msg_ftp_connect_success = "FTP 접속 및 인증 성공하였습니다"; + $lang->is_active = 'Активно'; $lang->is_required = 'Требуемое поле'; diff --git a/common/lang/zh-CN.lang.php b/common/lang/zh-CN.lang.php index ca9042767..81b39fcbc 100644 --- a/common/lang/zh-CN.lang.php +++ b/common/lang/zh-CN.lang.php @@ -236,6 +236,28 @@ $lang->is_active = '激活'; $lang->is_required = '必填'; + // ftp 관련 + $lang->ftp_form_title = 'FTP 정보 입력'; + $lang->ftp = 'FTP'; + $lang->ftp_port = 'FTP port'; + $lang->cmd_check_ftp_connect = 'FTP 접속 확인'; + $lang->about_ftp_info = " + FTP 정보는 다음의 경우에 이용될 수 있습니다.
+ 1. PHP의 safe_mode=On일 경우에 FTP 정보를 이용해서 XE를 정상적으로 동작할 수 있게 합니다.
+ 2. 자동 업데이트등에서 FTP 정보를 이용할 수 있습니다.
+ 이 FTP정보는 files/config/ftp.config.php 파일내에 정보가 저장됩니다.
+ 그리고 설치 후 관리자 페이지에서 FTP 정보를 변경하거나 제거할 수 있습니다.
+ FTP 정보 노출을 원하지 않으시면 입력하지 않으셔도 됩니다 + "; + + $lang->msg_safe_mode_ftp_needed = "PHP의 safe_mode가 On일 경우 FTP 정보를 꼭 입력해주셔야 XE의 설치 및 사용이 가능합니다"; + $lang->msg_ftp_not_connected = "localhost로의 FTP 접속 오류가 발생하였습니다. ftp 포트 번호를 확인해주시거나 ftp 서비스가 가능한지 확인해주세요"; + $lang->msg_ftp_invalid_auth_info = "입력하신 FTP 정보로 로그인을 하지 못했습니다. FTP정보를 확인해주세요"; + $lang->msg_ftp_mkdir_fail = "FTP를 이용한 디렉토리 생성 명령을 실패하였습니다. FTP 서버의 설정을 확인해주세요"; + $lang->msg_ftp_chmod_fail = "FTP를 이용한 디렉토리의 속성 변경을 실패하였습니다. FTP 서버의 설정을 확인해주세요"; + $lang->msg_ftp_connect_success = "FTP 접속 및 인증 성공하였습니다"; + + // 在xml filter使用的 javascript用 alert msg $lang->filter->isnull = '请输入%s'; $lang->filter->outofrange = '请确认%s字数'; diff --git a/libs/ftp.class.php b/libs/ftp.class.php new file mode 100644 index 000000000..3bd739f54 --- /dev/null +++ b/libs/ftp.class.php @@ -0,0 +1,522 @@ +debug = FALSE; + $this->umask = 0022; + $this->timeout = 30; + + if (!defined("FTP_BINARY")) { + define("FTP_BINARY", 1); + } + if (!defined("FTP_ASCII")) { + define("FTP_ASCII", 0); + } + + $this->ftp_resp = ""; + } + + /* Public functions */ + function ftp_connect($server, $port = 21) + { + $this->ftp_debug("Trying to ".$server.":".$port." ...\n"); + $this->ftp_sock = @fsockopen($server, $port, $errno, $errstr, $this->timeout); + + if (!$this->ftp_sock || !$this->ftp_ok()) { + $this->ftp_debug("Error : Cannot connect to remote host \"".$server.":".$port."\"\n"); + $this->ftp_debug("Error : fsockopen() ".$errstr." (".$errno.")\n"); + return FALSE; + } + $this->ftp_debug("Connected to remote host \"".$server.":".$port."\"\n"); + + return TRUE; + } + + function ftp_login($user, $pass) + { + $this->ftp_putcmd("USER", $user); + if (!$this->ftp_ok()) { + $this->ftp_debug("Error : USER command failed\n"); + return FALSE; + } + + $this->ftp_putcmd("PASS", $pass); + if (!$this->ftp_ok()) { + $this->ftp_debug("Error : PASS command failed\n"); + return FALSE; + } + $this->ftp_debug("Authentication succeeded\n"); + + return TRUE; + } + + function ftp_pwd() + { + $this->ftp_putcmd("PWD"); + if (!$this->ftp_ok()) { + $this->ftp_debug("Error : PWD command failed\n"); + return FALSE; + } + + return ereg_replace("^[0-9]{3} \"(.+)\" .+\r\n", "\\1", $this->ftp_resp); + } + + function ftp_size($pathname) + { + $this->ftp_putcmd("SIZE", $pathname); + if (!$this->ftp_ok()) { + $this->ftp_debug("Error : SIZE command failed\n"); + return -1; + } + + return ereg_replace("^[0-9]{3} ([0-9]+)\r\n", "\\1", $this->ftp_resp); + } + + function ftp_mdtm($pathname) + { + $this->ftp_putcmd("MDTM", $pathname); + if (!$this->ftp_ok()) { + $this->ftp_debug("Error : MDTM command failed\n"); + return -1; + } + $mdtm = ereg_replace("^[0-9]{3} ([0-9]+)\r\n", "\\1", $this->ftp_resp); + $date = sscanf($mdtm, "%4d%2d%2d%2d%2d%2d"); + $timestamp = mktime($date[3], $date[4], $date[5], $date[1], $date[2], $date[0]); + + return $timestamp; + } + + function ftp_systype() + { + $this->ftp_putcmd("SYST"); + if (!$this->ftp_ok()) { + $this->ftp_debug("Error : SYST command failed\n"); + return FALSE; + } + $DATA = explode(" ", $this->ftp_resp); + + return $DATA[1]; + } + + function ftp_cdup() + { + $this->ftp_putcmd("CDUP"); + $response = $this->ftp_ok(); + if (!$response) { + $this->ftp_debug("Error : CDUP command failed\n"); + } + return $response; + } + + function ftp_chdir($pathname) + { + $this->ftp_putcmd("CWD", $pathname); + $response = $this->ftp_ok(); + if (!$response) { + $this->ftp_debug("Error : CWD command failed\n"); + } + return $response; + } + + function ftp_delete($pathname) + { + $this->ftp_putcmd("DELE", $pathname); + $response = $this->ftp_ok(); + if (!$response) { + $this->ftp_debug("Error : DELE command failed\n"); + } + return $response; + } + + function ftp_rmdir($pathname) + { + $this->ftp_putcmd("RMD", $pathname); + $response = $this->ftp_ok(); + if (!$response) { + $this->ftp_debug("Error : RMD command failed\n"); + } + return $response; + } + + function ftp_mkdir($pathname) + { + $this->ftp_putcmd("MKD", $pathname); + $response = $this->ftp_ok(); + if (!$response) { + $this->ftp_debug("Error : MKD command failed\n"); + } + return $response; + } + + function ftp_file_exists($pathname) + { + if (!($remote_list = $this->ftp_nlist("-a"))) { + $this->ftp_debug("Error : Cannot get remote file list\n"); + return -1; + } + + reset($remote_list); + while (list(,$value) = each($remote_list)) { + if ($value == $pathname) { + $this->ftp_debug("Remote file ".$pathname." exists\n"); + return 1; + } + } + $this->ftp_debug("Remote file ".$pathname." does not exist\n"); + + return 0; + } + + function ftp_rename($from, $to) + { + $this->ftp_putcmd("RNFR", $from); + if (!$this->ftp_ok()) { + $this->ftp_debug("Error : RNFR command failed\n"); + return FALSE; + } + $this->ftp_putcmd("RNTO", $to); + + $response = $this->ftp_ok(); + if (!$response) { + $this->ftp_debug("Error : RNTO command failed\n"); + } + return $response; + } + + function ftp_nlist($arg = "", $pathname = "") + { + if (!($string = $this->ftp_pasv())) { + return FALSE; + } + + if ($arg == "") { + $nlst = "NLST"; + } else { + $nlst = "NLST ".$arg; + } + $this->ftp_putcmd($nlst, $pathname); + + $sock_data = $this->ftp_open_data_connection($string); + if (!$sock_data || !$this->ftp_ok()) { + $this->ftp_debug("Error : Cannot connect to remote host\n"); + $this->ftp_debug("Error : NLST command failed\n"); + return FALSE; + } + $this->ftp_debug("Connected to remote host\n"); + + while (!feof($sock_data)) { + $list[] = ereg_replace("[\r\n]", "", fgets($sock_data, 512)); + } + $this->ftp_close_data_connection($sock_data); + $this->ftp_debug(implode("\n", $list)); + + if (!$this->ftp_ok()) { + $this->ftp_debug("Error : NLST command failed\n"); + return FALSE; + } + + return $list; + } + + function ftp_rawlist($pathname = "") + { + if (!($string = $this->ftp_pasv())) { + return FALSE; + } + + $this->ftp_putcmd("LIST", $pathname); + + $sock_data = $this->ftp_open_data_connection($string); + if (!$sock_data || !$this->ftp_ok()) { + $this->ftp_debug("Error : Cannot connect to remote host\n"); + $this->ftp_debug("Error : LIST command failed\n"); + return FALSE; + } + + $this->ftp_debug("Connected to remote host\n"); + + while (!feof($sock_data)) { + $list[] = ereg_replace("[\r\n]", "", fgets($sock_data, 512)); + } + $this->ftp_debug(implode("\n", $list)); + $this->ftp_close_data_connection($sock_data); + + if (!$this->ftp_ok()) { + $this->ftp_debug("Error : LIST command failed\n"); + return FALSE; + } + + return $list; + } + + function ftp_get($localfile, $remotefile, $mode = 1) + { + umask($this->umask); + + if (@file_exists($localfile)) { + $this->ftp_debug("Warning : local file will be overwritten\n"); + } + + $fp = @fopen($localfile, "w"); + if (!$fp) { + $this->ftp_debug("Error : Cannot create \"".$localfile."\""); + $this->ftp_debug("Error : GET command failed\n"); + return FALSE; + } + + if (!$this->ftp_type($mode)) { + $this->ftp_debug("Error : GET command failed\n"); + return FALSE; + } + + if (!($string = $this->ftp_pasv())) { + $this->ftp_debug("Error : GET command failed\n"); + return FALSE; + } + + $this->ftp_putcmd("RETR", $remotefile); + + $sock_data = $this->ftp_open_data_connection($string); + if (!$sock_data || !$this->ftp_ok()) { + $this->ftp_debug("Error : Cannot connect to remote host\n"); + $this->ftp_debug("Error : GET command failed\n"); + return FALSE; + } + $this->ftp_debug("Connected to remote host\n"); + $this->ftp_debug("Retrieving remote file \"".$remotefile."\" to local file \"".$localfile."\"\n"); + while (!feof($sock_data)) { + fputs($fp, fread($sock_data, 4096)); + } + fclose($fp); + + $this->ftp_close_data_connection($sock_data); + + $response = $this->ftp_ok(); + if (!$response) { + $this->ftp_debug("Error : GET command failed\n"); + } + return $response; + } + + function ftp_put($remotefile, $localfile, $mode = 1) + { + + if (!@file_exists($localfile)) { + $this->ftp_debug("Error : No such file or directory \"".$localfile."\"\n"); + $this->ftp_debug("Error : PUT command failed\n"); + return FALSE; + } + + $fp = @fopen($localfile, "r"); + if (!$fp) { + $this->ftp_debug("Error : Cannot read file \"".$localfile."\"\n"); + $this->ftp_debug("Error : PUT command failed\n"); + return FALSE; + } + + if (!$this->ftp_type($mode)) { + $this->ftp_debug("Error : PUT command failed\n"); + return FALSE; + } + + if (!($string = $this->ftp_pasv())) { + $this->ftp_debug("Error : PUT command failed\n"); + return FALSE; + } + + $this->ftp_putcmd("STOR", $remotefile); + + $sock_data = $this->ftp_open_data_connection($string); + if (!$sock_data || !$this->ftp_ok()) { + $this->ftp_debug("Error : Cannot connect to remote host\n"); + $this->ftp_debug("Error : PUT command failed\n"); + return FALSE; + } + $this->ftp_debug("Connected to remote host\n"); + $this->ftp_debug("Storing local file \"".$localfile."\" to remote file \"".$remotefile."\"\n"); + while (!feof($fp)) { + fputs($sock_data, fread($fp, 4096)); + } + fclose($fp); + + $this->ftp_close_data_connection($sock_data); + + $response = $this->ftp_ok(); + if (!$response) { + $this->ftp_debug("Error : PUT command failed\n"); + } + return $response; + } + + function ftp_site($command) + { + $this->ftp_putcmd("SITE", $command); + $response = $this->ftp_ok(); + if (!$response) { + $this->ftp_debug("Error : SITE command failed\n"); + } + return $response; + } + + function ftp_quit() + { + $this->ftp_putcmd("QUIT"); + if (!$this->ftp_ok() || !fclose($this->ftp_sock)) { + $this->ftp_debug("Error : QUIT command failed\n"); + return FALSE; + } + $this->ftp_debug("Disconnected from remote host\n"); + return TRUE; + } + + /* Private Functions */ + + function ftp_type($mode) + { + if ($mode) { + $type = "I"; //Binary mode + } else { + $type = "A"; //ASCII mode + } + $this->ftp_putcmd("TYPE", $type); + $response = $this->ftp_ok(); + if (!$response) { + $this->ftp_debug("Error : TYPE command failed\n"); + } + return $response; + } + + function ftp_port($ip_port) + { + $this->ftp_putcmd("PORT", $ip_port); + $response = $this->ftp_ok(); + if (!$response) { + $this->ftp_debug("Error : PORT command failed\n"); + } + return $response; + } + + function ftp_pasv() + { + $this->ftp_putcmd("PASV"); + if (!$this->ftp_ok()) { + $this->ftp_debug("Error : PASV command failed\n"); + return FALSE; + } + + $ip_port = ereg_replace("^.+ \\(?([0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]+,[0-9]+)\\)?.*\r\n$", "\\1", $this->ftp_resp); + return $ip_port; + } + + function ftp_putcmd($cmd, $arg = "") + { + if ($arg != "") { + $cmd = $cmd." ".$arg; + } + + fputs($this->ftp_sock, $cmd."\r\n"); + $this->ftp_debug("> ".$cmd."\n"); + + return TRUE; + } + + function ftp_ok() + { + $this->ftp_resp = ""; + do { + $res = fgets($this->ftp_sock, 512); + $this->ftp_resp .= $res; + } while (substr($res, 3, 1) != " "); + + $this->ftp_debug(str_replace("\r\n", "\n", $this->ftp_resp)); + + if (!ereg("^[123]", $this->ftp_resp)) { + return FALSE; + } + + return TRUE; + } + + function ftp_close_data_connection($sock) + { + $this->ftp_debug("Disconnected from remote host\n"); + return fclose($sock); + } + + function ftp_open_data_connection($ip_port) + { + if (!ereg("[0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]+,[0-9]+", $ip_port)) { + $this->ftp_debug("Error : Illegal ip-port format(".$ip_port.")\n"); + return FALSE; + } + + $DATA = explode(",", $ip_port); + $ipaddr = $DATA[0].".".$DATA[1].".".$DATA[2].".".$DATA[3]; + $port = $DATA[4]*256 + $DATA[5]; + $this->ftp_debug("Trying to ".$ipaddr.":".$port." ...\n"); + $data_connection = @fsockopen($ipaddr, $port, $errno, $errstr); + if (!$data_connection) { + $this->ftp_debug("Error : Cannot open data connection to ".$ipaddr.":".$port."\n"); + $this->ftp_debug("Error : ".$errstr." (".$errno.")\n"); + return FALSE; + } + + return $data_connection; + } + + function ftp_debug($message = "") + { + if ($this->debug) { + echo $message; + } + + return TRUE; + } + } +?> diff --git a/modules/install/conf/module.xml b/modules/install/conf/module.xml index e1cff33fa..9b035d2d3 100644 --- a/modules/install/conf/module.xml +++ b/modules/install/conf/module.xml @@ -8,6 +8,8 @@ + + diff --git a/modules/install/install.controller.php b/modules/install/install.controller.php index a4f28e3f8..0ca9f7d75 100644 --- a/modules/install/install.controller.php +++ b/modules/install/install.controller.php @@ -59,6 +59,81 @@ $this->setMessage('msg_install_completed'); } + /** + * @brief FTP 정보 등록 + **/ + function procInstallFTP() { + $ftp_info = Context::gets('ftp_user','ftp_password','ftp_port'); + $ftp_info->ftp_port = (int)$ftp_info->ftp_port; + if(!$ftp_info->ftp_port) $ftp_info->ftp_port = 21; + + $buff = ' $val) { + $buff .= sprintf("\$ftp_info->%s = '%s';\n", $key, str_replace("'","\\'",$val)); + } + $buff .= "?>"; + + // safe_mode 일 경우 + if(ini_get('safe_mode')) { + if(!$ftp_info->ftp_user || !$ftp_info->ftp_password) return new Object(-1,'msg_safe_mode_ftp_needed'); + + require_once(_XE_PATH_.'libs/ftp.class.php'); + $oFtp = new ftp(); + if(!$oFtp->ftp_connect('localhost', $ftp_info->ftp_port)) return new Object(-1,'msg_ftp_not_connected'); + + if(!$oFtp->ftp_login($ftp_info->ftp_user, $ftp_info->ftp_password)) { + $oFtp->ftp_quit(); + return new Object(-1,'msg_ftp_invalid_auth_info'); + } + + if(!is_dir(_XE_PATH_.'files') && !$oFtp->ftp_mkdir(_XE_PATH_.'files')) { + $oFtp->ftp_quit(); + return new Object(-1,'msg_ftp_mkdir_fail'); + } + + if(!$oFtp->ftp_site("CHMOD 777 "._XE_PATH_.'files')) { + $oFtp->ftp_quit(); + return new Object(-1,'msg_ftp_chmod_fail'); + } + + if(!is_dir(_XE_PATH_.'files/config') && !$oFtp->ftp_mkdir(_XE_PATH_.'files/config')) { + $oFtp->ftp_quit(); + return new Object(-1,'msg_ftp_mkdir_fail'); + } + + if(!$oFtp->ftp_site("CHMOD 777 "._XE_PATH_.'files/config')) { + $oFtp->ftp_quit(); + return new Object(-1,'msg_ftp_chmod_fail'); + } + + $oFtp->ftp_quit(); + } + + $config_file = Context::getFTPConfigFile(); + FileHandler::WriteFile($config_file, $buff); + } + + function procInstallCheckFtp() { + $ftp_info = Context::gets('ftp_user','ftp_password','ftp_port'); + $ftp_info->ftp_port = (int)$ftp_info->ftp_port; + if(!$ftp_info->ftp_port) $ftp_info->ftp_port = 21; + + if(!$ftp_info->ftp_user || !$ftp_info->ftp_password) return new Object(-1,'msg_safe_mode_ftp_needed'); + + require_once(_XE_PATH_.'libs/ftp.class.php'); + $oFtp = new ftp(); + if(!$oFtp->ftp_connect('localhost', $ftp_info->ftp_port)) return new Object(-1,'msg_ftp_not_connected'); + + if(!$oFtp->ftp_login($ftp_info->ftp_user, $ftp_info->ftp_password)) { + $oFtp->ftp_quit(); + return new Object(-1,'msg_ftp_invalid_auth_info'); + } + + $oFtp->ftp_quit(); + + $this->setMessage('msg_ftp_connect_success'); + } + /** * @brief 인스톨 환경을 체크하여 결과 return **/ diff --git a/modules/install/install.view.php b/modules/install/install.view.php index 93359eec4..202c97165 100644 --- a/modules/install/install.view.php +++ b/modules/install/install.view.php @@ -49,7 +49,12 @@ // 설치 불가능하다면 check_env를 출력 if(!$this->install_enable) return $this->dispInstallCheckEnv(); - $this->setTemplateFile('select_db'); + // ftp 정보 입력 + if(!Context::isFTPRegisted()) { + $this->setTemplateFile('ftp'); + } else { + $this->setTemplateFile('select_db'); + } } /** diff --git a/modules/install/tpl/css/install.css b/modules/install/tpl/css/install.css index 46529d679..230f694f8 100644 --- a/modules/install/tpl/css/install.css +++ b/modules/install/tpl/css/install.css @@ -24,6 +24,7 @@ body { background:#4d4d4d url(../images/installBg.gif) repeat-x;} #content { position:relative; padding:25px 20px 20px 20px; overflow:hidden; background:#ffffff;} #content h2 { font-size:1em; padding-left:.5em; margin:0 0 1em 0;} +#content blockquote { padding:10px; margin:0; border:1px solid #c9c9c9; margin-bottom:10px; color:#696969; line-height:20px;} #agreement { border:1px solid #c9c9c9; height:15em; padding:1.2em; overflow:auto; color:#696969; line-height:1.25em; margin-bottom:20px;} .iePngFix { display:block; } diff --git a/modules/install/tpl/ftp.html b/modules/install/tpl/ftp.html new file mode 100644 index 000000000..39c7b1f6b --- /dev/null +++ b/modules/install/tpl/ftp.html @@ -0,0 +1,38 @@ + + + +
+ +

{$lang->ftp_form_title}

+ +
{$lang->about_ftp_info}
+ + + + + + + + + + + + + + + + + + + + +
+ +
+ + +
+ +
+ + diff --git a/modules/install/tpl/js/install_admin.js b/modules/install/tpl/js/install_admin.js index 7a7a30a96..656a2fd96 100644 --- a/modules/install/tpl/js/install_admin.js +++ b/modules/install/tpl/js/install_admin.js @@ -5,3 +5,29 @@ function completeInstalled(ret_obj) { alert(ret_obj["message"]); location.href = "./index.php?module=admin"; } + +/** + * @brief FTP 정보 입력 + **/ +function doInstallFTPInfo(fo_obj) { + var oFilter = new XmlJsFilter(fo_obj, "install", "procInstallFTP", completeInstallFTPInfo); + oFilter.addResponseItem("error"); + oFilter.addResponseItem("message"); + return oFilter.proc(); +} + +function completeInstallFTPInfo(ret_obj) { + location.href = current_url; +} + +function doCheckFTPInfo() { + var fo_obj = xGetElementById("ftp_form"); + var oFilter = new XmlJsFilter(fo_obj, "install", "procInstallCheckFTP", completeInstallCheckFtpInfo); + oFilter.addResponseItem("error"); + oFilter.addResponseItem("message"); + return oFilter.proc(); +} + +function completeInstallCheckFtpInfo(ret_obj) { + alert(ret_obj['message']); +} diff --git a/modules/member/openid_lib/class_HTTPRetriever.php b/modules/member/openid_lib/class_HTTPRetriever.php index 5f5d79434..8793919f2 100755 --- a/modules/member/openid_lib/class_HTTPRetriever.php +++ b/modules/member/openid_lib/class_HTTPRetriever.php @@ -409,7 +409,7 @@ class HTTPRetriever { if ($this->caching_highvolume) { $cache_dir .= substr($token,0,2) . '/'; - if (!is_dir($cache_dir)) @mkdir($cache_dir); + if (!is_dir($cache_dir)) @FileHandler::makeDir($cache_dir); } $filename = $cache_dir.$token.'.tmp'; diff --git a/modules/tccommentnotify/tccommentnotify.controller.php b/modules/tccommentnotify/tccommentnotify.controller.php index 45a11a24f..a4a919fb4 100644 --- a/modules/tccommentnotify/tccommentnotify.controller.php +++ b/modules/tccommentnotify/tccommentnotify.controller.php @@ -121,7 +121,7 @@ { if(!file_exists($this->cachedir)) { - mkdir($this->cachedir); + FileHandler::makeDir($this->cachedir); } $fp = fopen($this->cachedir.$this->cachefile, "w"); fwrite($fp, "aa");