git-svn-id: http://xe-core.googlecode.com/svn/trunk@1450 201d5d3c-b55e-5fd7-737f-ddc643e51545

This commit is contained in:
zero 2007-05-17 04:32:48 +00:00
parent db4065573b
commit 3eb1088b77
4 changed files with 18 additions and 19 deletions

View file

@ -60,19 +60,21 @@
/** /**
* @brief 첨부파일 추가 * @brief 첨부파일 추가
**/ **/
function insertFile($file_info, $module_srl, $upload_target_srl, $download_count = 0) { function insertFile($file_info, $module_srl, $upload_target_srl, $download_count = 0, $manual_insert = false) {
// 첨부파일 설정 가져옴 if(!$manual_insert) {
$logged_info = Context::get('logged_info'); // 첨부파일 설정 가져옴
if($logged_info->is_admin != 'Y') { $logged_info = Context::get('logged_info');
$oFileModel = &getModel('file'); if($logged_info->is_admin != 'Y') {
$config = $oFileModel->getFileConfig(); $oFileModel = &getModel('file');
$allowed_attach_size = $config->allowed_attach_size * 1024 * 1024; $config = $oFileModel->getFileConfig();
$allowed_attach_size = $config->allowed_attach_size * 1024 * 1024;
// 해당 문서에 첨부된 모든 파일의 용량을 가져옴 (DB에서 가져옴) // 해당 문서에 첨부된 모든 파일의 용량을 가져옴 (DB에서 가져옴)
$size_args->upload_target_srl = $upload_target_srl; $size_args->upload_target_srl = $upload_target_srl;
$output = executeQuery('file.getAttachedFileSize', $size_args); $output = executeQuery('file.getAttachedFileSize', $size_args);
$attached_size = (int)$output->data->attached_size + filesize($file_info['tmp_name']); $attached_size = (int)$output->data->attached_size + filesize($file_info['tmp_name']);
if($attached_size > $allowed_attach_size) return new Object(-1, 'msg_exceeds_limit_size'); if($attached_size > $allowed_attach_size) return new Object(-1, 'msg_exceeds_limit_size');
}
} }
// 이미지인지 기타 파일인지 체크하여 upload path 지정 // 이미지인지 기타 파일인지 체크하여 upload path 지정
@ -90,7 +92,8 @@
if(!FileHandler::makeDir($path)) return false; if(!FileHandler::makeDir($path)) return false;
// 파일 이동 // 파일 이동
if(!move_uploaded_file($file_info['tmp_name'], $filename)) return false; if(!$manual_insert&&!move_uploaded_file($file_info['tmp_name'], $filename)) return false;
elseif($manual_insert) @rename($file_info['tmp_name'], $filename);
// 사용자 정보를 구함 // 사용자 정보를 구함
$oMemberModel = &getModel('member'); $oMemberModel = &getModel('member');

View file

@ -96,7 +96,7 @@
@set_time_limit(0); @set_time_limit(0);
// 디버그 메세지의 양이 무척 커지기에 디버그 메세지 생성을 중단 // 디버그 메세지의 양이 무척 커지기에 디버그 메세지 생성을 중단
//define('__STOP_DEBUG__', true); define('__STOP_DEBUG__', true);
// 변수 체크 // 변수 체크
$this->module_srl = Context::get('module_srl'); $this->module_srl = Context::get('module_srl');

View file

@ -80,10 +80,7 @@
<!-- step 2. XML 파일 지정 --> <!-- step 2. XML 파일 지정 -->
<div id="step2" style="display:none"> <div id="step2" style="display:none">
<!--<form action="./" method="get" onsubmit="return doStep2(this)" id="fo_step2">--> <form action="./" method="get" onsubmit="return doStep2(this)" id="fo_step2">
<form action="./" method="get" id="fo_step2">
<input type="hidden" name="module" value="importer" />
<input type="hidden" name="act" value="procImporterAdminImport" />
<input type="hidden" name="module_srl" value="" /> <input type="hidden" name="module_srl" value="" />
<input type="hidden" name="category_srl" value="" /> <input type="hidden" name="category_srl" value="" />
<input type="hidden" name="position" value="0" /> <input type="hidden" name="position" value="0" />

View file

@ -78,7 +78,6 @@ function doStep2(fo_obj) {
procFilter(fo_obj, import_xml); procFilter(fo_obj, import_xml);
xGetElementById('step2_status').style.display = 'block'; xGetElementById('step2_status').style.display = 'block';
return false; return false;
} }