ftp root path 를 Core관리로

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@6925 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ngleader 2009-11-11 07:20:27 +00:00
parent 5c9b048738
commit 0ccabfcbbb
20 changed files with 131 additions and 84 deletions

View file

@ -296,6 +296,10 @@
$lang->msg_ftp_chmod_fail = "Chmod failed. Please check the permission and configuration of FTP server.";
$lang->msg_ftp_connect_success = "Connection and authentication to the FTP server succeeded.";
$lang->ftp_path_title = 'FTP 경로 정보 입력';
$lang->msg_ftp_installed_realpath = '설치된 XE의 절대경로';
$lang->msg_ftp_installed_ftp_realpath = '설치된 XE의 FTP 절대경로 설정';
// Alert messages for Javascript using by XML filter
$lang->filter->isnull = 'Please input a value for %s';

View file

@ -302,6 +302,11 @@
$lang->msg_ftp_chmod_fail = "Ha fallado el comando de FTP para la modificación de atributos de directorio. Verifique la configuración del servicio FTP en el servidor.";
$lang->msg_ftp_connect_success = "conexión con éxito al FTP";
$lang->ftp_path_title = 'FTP 경로 정보 입력';
$lang->msg_ftp_installed_realpath = '설치된 XE의 절대경로';
$lang->msg_ftp_installed_ftp_realpath = '설치된 XE의 FTP 절대경로 설정';
// Mensajes de alerta para Javascript usando el filtro XML
$lang->filter->isnull = 'Introduzca valor en el %s';

View file

@ -296,6 +296,10 @@
$lang->msg_ftp_chmod_fail = "FTP를 이용한 디렉토리의 속성 변경을 실패하였습니다. FTP 서버의 설정을 확인해주세요";
$lang->msg_ftp_connect_success = "FTP 접속 및 인증 성공하였습니다";
$lang->ftp_path_title = 'FTP 경로 정보 입력';
$lang->msg_ftp_installed_realpath = '설치된 XE의 절대경로';
$lang->msg_ftp_installed_ftp_realpath = '설치된 XE의 FTP 절대경로 설정';
// Messages d\'alerte de le Javascript qui est utilisé dans les filtres en XML
$lang->filter->isnull = 'Entrez une valeur pour %s';

View file

@ -296,6 +296,10 @@
$lang->msg_ftp_chmod_fail = "FTP를 이용한 디렉토리의 속성 변경을 실패하였습니다. FTP 서버의 설정을 확인해주세요";
$lang->msg_ftp_connect_success = "FTP 접속 및 인증 성공하였습니다";
$lang->ftp_path_title = 'FTP 경로 정보 입력';
$lang->msg_ftp_installed_realpath = '설치된 XE의 절대경로';
$lang->msg_ftp_installed_ftp_realpath = '설치된 XE의 FTP 절대경로 설정';
// Alert Nachrichten für JavaScript unter Verwendung von XML-Filter
$lang->filter->isnull = 'Bitte geben Sie einen Wert für% s';

View file

@ -298,6 +298,11 @@
$lang->msg_ftp_chmod_fail = 'FTPを用いたディレクトリパーミッション(permission)変更に失敗しました。FTPサーバーの設定を再度ご確認下さい。';
$lang->msg_ftp_connect_success = 'FTP接続に成功しました。';
$lang->ftp_path_title = 'FTP 경로 정보 입력';
$lang->msg_ftp_installed_realpath = '설치된 XE의 절대경로';
$lang->msg_ftp_installed_ftp_realpath = '설치된 XE의 FTP 절대경로 설정';
// xml filterで用いられているjavascript用のアラートメッセージ
$lang->filter->isnull = '%sを入力して下さい。';
$lang->filter->outofrange = '%sの文字の長さを合わせて下さい。';

View file

@ -279,7 +279,7 @@
$lang->eid = '확장변수 이름';
// ftp 관련
$lang->ftp_form_title = 'FTP 정보 입력';
$lang->ftp_form_title = 'FTP 계정 정보 입력';
$lang->ftp = 'FTP';
$lang->ftp_port = 'FTP port';
$lang->cmd_check_ftp_connect = 'FTP 접속 확인';
@ -298,6 +298,10 @@
$lang->msg_ftp_chmod_fail = 'FTP를 이용한 디렉토리의 속성 변경에 실패하였습니다. FTP 서버의 설정을 확인해주세요.';
$lang->msg_ftp_connect_success = 'FTP 접속 및 인증에 성공하였습니다.';
$lang->ftp_path_title = 'FTP 경로 정보 입력';
$lang->msg_ftp_installed_realpath = '설치된 XE의 절대경로';
$lang->msg_ftp_installed_ftp_realpath = '설치된 XE의 FTP 절대경로 설정';
// xml filter에서 사용되는 javascript용 alert msg
$lang->filter->isnull = '%s을 입력해주세요.';
$lang->filter->outofrange = '%s의 글자 수를 맞추어 주세요.';

View file

@ -291,6 +291,12 @@
$lang->msg_ftp_chmod_fail = "FTP를 이용한 디렉토리의 속성 변경을 실패하였습니다. FTP 서버의 설정을 확인해주세요";
$lang->msg_ftp_connect_success = "FTP 접속 및 인증 성공하였습니다";
$lang->ftp_path_title = 'FTP 경로 정보 입력';
$lang->msg_ftp_installed_realpath = '설치된 XE의 절대경로';
$lang->msg_ftp_installed_ftp_realpath = '설치된 XE의 FTP 절대경로 설정';
$lang->is_active = 'Активно';
$lang->is_required = 'Требуемое поле';
$lang->eid = '확장변수 이름';

View file

@ -286,6 +286,10 @@
$lang->msg_ftp_chmod_fail = "CHMOD không thành công. Xin vui lòng kiểm tra lại.";
$lang->msg_ftp_connect_success = "Đã xác nhận và kết nối thành công tới máy chủ bằng FTP.";
$lang->ftp_path_title = 'FTP 경로 정보 입력';
$lang->msg_ftp_installed_realpath = '설치된 XE의 절대경로';
$lang->msg_ftp_installed_ftp_realpath = '설치된 XE의 FTP 절대경로 설정';
// Alert messages for Javascript using by XML filter
$lang->filter->isnull = 'Xin vui lòng nhập giá trị cho %s';

View file

@ -298,6 +298,10 @@
$lang->msg_ftp_chmod_fail = "修改文件夹属性失败。请确认 FTP服务器设置。";
$lang->msg_ftp_connect_success = "FTP连接成功。";
$lang->ftp_path_title = 'FTP 경로 정보 입력';
$lang->msg_ftp_installed_realpath = '설치된 XE의 절대경로';
$lang->msg_ftp_installed_ftp_realpath = '설치된 XE의 FTP 절대경로 설정';
// 在xml filter使用的 javascript用 alert msg
$lang->filter->isnull = '请输入%s';
$lang->filter->outofrange = '请确认%s字数';

View file

@ -297,6 +297,11 @@
$lang->msg_ftp_chmod_fail = '修改資料夾權限失敗。請確認FTP主機設置。';
$lang->msg_ftp_connect_success = 'FTP連線成功。';
$lang->ftp_path_title = 'FTP 경로 정보 입력';
$lang->msg_ftp_installed_realpath = '설치된 XE의 절대경로';
$lang->msg_ftp_installed_ftp_realpath = '설치된 XE의 FTP 절대경로 설정';
// 在xml filter中所使用的JavaScript警告訊息
$lang->filter->isnull = '請輸入%s';
$lang->filter->outofrange = '請確認%s字數';

View file

@ -48,7 +48,7 @@
/* Constractor */
function ftp()
{
$this->debug = FALSE;
$this->debug = false;
$this->umask = 0022;
$this->timeout = 30;

View file

@ -268,6 +268,41 @@
$output = executeQuery('module.getSiteInfo', $site_args);
Context::set('start_module', $output->data);
$pwd = Context::get('pwd');
if(!$pwd) $pwd = '/';
Context::set('pwd',$pwd);
require_once(_XE_PATH_.'libs/ftp.class.php');
$ftp_info = Context::getFTPInfo();
$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');
}
$_list = $oFtp->ftp_rawlist($pwd);
$oFtp->ftp_quit();
$list = array();
if(count($_list) == 0 || !$_list[0]) {
$oFtp = new ftp();
if(!$oFtp->ftp_connect($_SERVER['SERVER_NAME'], $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');
}
$_list = $oFtp->ftp_rawlist($pwd);
$oFtp->ftp_quit();
}
if($_list){
foreach($_list as $k => $v){
if(strpos($v,'d') === 0) $list[] = substr(strrchr($v,' '),1) . '/';
}
}
Context::set('list',$list);
Context::set('layout','none');
$this->setTemplateFile('config');
}

View file

@ -3,6 +3,7 @@
<!--%import("./filter/update_env_config.xml")-->
<!--%import("./filter/update_lang_select.xml")-->
<!--%import("./filter/install_ftp_info.xml")-->
<!--%import("./filter/install_ftp_path.xml")-->
<!--%import("../../install/lang")-->
<!--%import("../../install/tpl/js/install_admin.js",optimized=false)-->
@ -141,7 +142,46 @@
</tr>
</table>
</form>
<!--@if($ftp_info && $ftp_info->ftp_password && $ftp_info->ftp_user)-->
<h4 class="xeAdmin" id="ftp_setup">{$lang->ftp_path_title}</h4>
<form action="./" method="get" onsubmit="return procFilter(this, install_ftp_path)">
<input type="hidden" name="ftp_user" value="{$ftp_info->ftp_user}" />
<input type="hidden" name="ftp_password" value="{$ftp_info->ftp_password}" />
<input type="hidden" name="ftp_port" value="{$ftp_info->ftp_port}" />
<table cellspacing="0" class="rowTable">
<tr>
<th scope="col"><div>{$lang->msg_ftp_installed_realpath}</div></th>
<td>{_XE_PATH_}
</td>
</tr>
<tr>
<th scope="col" rowspan="2"><div>{$lang->msg_ftp_installed_ftp_realpath}</div></th>
<td>
<input type="text" name="ftp_root_path" value="<!--@if($pwd && $pwd!='/')-->{$pwd}<!--@else-->{$ftp_info->ftp_root_path}<!--@end-->" class="inputTypeText w400" />
</td>
</tr>
<tr>
<td>
<!--@if($list)-->
<ul>
<!--@foreach($list as $k => $v)-->
<!--@if($v)-->
<li> <a href="{getUrl('pwd',$pwd.$v)}#ftp_setup">{$v}</a></li>
<!--@end-->
<!--@end-->
</ul>
<!--@end-->
</td>
</tr>
<tr class="row2">
<th colspan="2" class="button">
<span class="button black strong"><input type="submit" value="{$lang->cmd_registration}" /></span>
</th>
</tr>
</table>
</form>
<!--@end-->
</div>
<hr />

View file

@ -83,7 +83,7 @@
return new Object(-1,'msg_ftp_invalid_auth_info');
}
$_list = $oFtp->ftp_rawlist($config->ftp_root_path);
$_list = $oFtp->ftp_rawlist($ftp_config->ftp_root_path);
if(count($_list) == 0 || !$_list[0]) {
$oFtp->ftp_quit();
$oFtp = new ftp();
@ -94,10 +94,8 @@
}
}
$oModuleModel = &getModel('module');
$config = $oModuleModel->getModuleConfig('autoinstall');
$target_dir = $config->ftp_root_path.$this->target_path;
$ftp_config = Context::getFTPInfo();
$target_dir = $ftp_config->ftp_root_path.$this->target_path;
foreach($file_list as $k => $file){
$org_file = $file;
@ -109,7 +107,7 @@
$path_list = explode('/', dirname($this->target_path."/".$file));
$real_path = "./";
$ftp_path = $config->ftp_root_path;
$ftp_path = $ftp_config->ftp_root_path;
for($i=0;$i<count($path_list);$i++)
{
@ -139,15 +137,6 @@
function init() {
}
function procAutoinstallAdminInsertConfig(){
$oModuleController = &getController('module');
$config->ftp_root_path = Context::get('ftp_root_path');
$output = $oModuleController->insertModuleConfig('autoinstall',$config);
return $output;
}
function checkFileCheckSum($file, $checksum){
$local_checksum = md5_file(FileHandler::getRealPath($file));
return ($local_checksum === $checksum);

View file

@ -185,49 +185,5 @@
Context::set('categories', $categories);
Context::set('tCount', $oModel->getPackageCount(null));
}
function dispAutoinstallAdminConfig(){
$pwd = Context::get('pwd');
if(!$pwd) $pwd = '/';
Context::set('pwd',$pwd);
require_once(_XE_PATH_.'libs/ftp.class.php');
$ftp_info = Context::getFTPInfo();
$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');
}
$_list = $oFtp->ftp_rawlist($pwd);
$oFtp->ftp_quit();
$list = array();
if(count($_list) == 0 || !$_list[0]) {
$oFtp = new ftp();
if(!$oFtp->ftp_connect($_SERVER['SERVER_NAME'], $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');
}
$_list = $oFtp->ftp_rawlist($pwd);
$oFtp->ftp_quit();
}
if($_list){
foreach($_list as $k => $v){
if(strpos($v,'d') === 0) $list[] = substr(strrchr($v,' '),1) . '/';
}
}
Context::set('list',$list);
$oModuleModel = &getModel('module');
$config = $oModuleModel->getModuleConfig('autoinstall');
Context::set('config',$config);
$this->setTemplateFile('config');
}
}
?>

View file

@ -1,18 +0,0 @@
<?php
/**
* @class autoinstallController
* @author sol (sol@ngleader.com)
* @brief autoinstall 모듈의 Controller class
**/
class autoinstallController extends autoinstall {
/**
* @brief 초기화
**/
function init() {
}
}
?>

View file

@ -1,11 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<module>
<actions>
<action name="dispAutoinstallTest" type="view" index="true" />
<action name="dispAutoinstallAdminInstall" type="view" standalone="true" />
<action name="dispAutoinstallAdminConfig" type="view" standalone="true" />
<action name="dispAutoinstallAdminIndex" type="view" standalone="true" admin_index="true" />
<action name="procAutoinstallAdminInsertConfig" type="controller" standalone="true" />
<action name="procAutoinstallAdminUpdateinfo" type="controller" standalone="true" />
<action name="procAutoinstallAdminPackageinstall" type="controller" standalone="true" />
</actions>

View file

@ -3,6 +3,5 @@
<div class="header4">
<ul class="localNavigation">
<li <!--@if($act=="dispAutoinstallAdminIndex")-->class="on"<!--@end-->><a href="{getUrl('act','dispAutoinstallAdminIndex')}">Index</a></li>
<li <!--@if($act=="dispAutoinstallAdminConfig")-->class="on"<!--@end-->><a href="{getUrl('act','dispAutoinstallAdminConfig')}">Config</a></li>
</ul>
</div>

View file

@ -119,7 +119,7 @@
* @brief FTP 정보 등록
**/
function procInstallAdminSaveFTPInfo() {
$ftp_info = Context::gets('ftp_user','ftp_password','ftp_port');
$ftp_info = Context::gets('ftp_user','ftp_password','ftp_port','ftp_root_path');
$ftp_info->ftp_port = (int)$ftp_info->ftp_port;
if(!$ftp_info->ftp_port) $ftp_info->ftp_port = 21;
$buff = '<?php if(!defined("__ZBXE__")) exit();'."\n";

View file

@ -31,3 +31,7 @@ function doCheckFTPInfo() {
function completeInstallCheckFtpInfo(ret_obj) {
alert(ret_obj['message']);
}
function completeFtpPath(ret_obj){
location.reload();
}