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