mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-05 11:32:12 +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
|
|
@ -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');
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue