mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 18:51:41 +09:00
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:
parent
5c9b048738
commit
0ccabfcbbb
20 changed files with 131 additions and 84 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -1,18 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* @class autoinstallController
|
||||
* @author sol (sol@ngleader.com)
|
||||
* @brief autoinstall 모듈의 Controller class
|
||||
**/
|
||||
|
||||
class autoinstallController extends autoinstall {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue