From 46900dae5885645eb537115725bfb2edfc5ab343 Mon Sep 17 00:00:00 2001 From: misol Date: Thu, 18 Jun 2009 07:34:58 +0000 Subject: [PATCH] =?UTF-8?q?=EC=B2=A8=EB=B6=80=EB=90=A0=20target=5Fsrl?= =?UTF-8?q?=EC=9D=B4=20=EC=9D=B4=EC=A0=84=EC=97=90=20=EC=93=B0=EC=9D=B8=20?= =?UTF-8?q?target=5Fsrl=EC=9D=B8=EC=A7=80=20=ED=99=95=EC=9D=B8,=20?= =?UTF-8?q?=EC=93=B0=EC=98=80=EB=8B=A4=EB=A9=B4=20=EC=9D=B4=20=EB=AA=A8?= =?UTF-8?q?=EB=93=88=EC=97=90=EC=84=9C=20=EC=93=B0=EC=9D=B8=EA=B2=8C=20?= =?UTF-8?q?=EB=A7=9E=EB=8A=94=EC=A7=80=20=ED=99=95=EC=9D=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://xe-core.googlecode.com/svn/sandbox@6585 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- modules/file/file.controller.php | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/modules/file/file.controller.php b/modules/file/file.controller.php index 189b5072c..bc4281a1a 100644 --- a/modules/file/file.controller.php +++ b/modules/file/file.controller.php @@ -19,6 +19,7 @@ **/ function procFileUpload() { // 기본적으로 필요한 변수 설정 + $oFileModel = &getModel('file'); $editor_sequence = Context::get('editor_sequence'); $module_srl = $this->module_srl; @@ -26,13 +27,26 @@ if(!$_SESSION['upload_info'][$editor_sequence]->enabled) exit(); // upload_target_srl 구함 - $upload_target_srl = $_SESSION['upload_info'][$editor_sequence]->upload_target_srl; - if(!$upload_target_srl) { - $oFileModel = &getModel('file'); + $tmp_target_srl = $_SESSION['upload_info'][$editor_sequence]->upload_target_srl; + if(!$tmp_target_srl) { if($oFileModel->getIsPermitted(Context::get('uploadTargetSrl'))) { - $_SESSION['upload_info'][$editor_sequence]->upload_target_srl = $upload_target_srl = Context::get('uploadTargetSrl'); + $tmp_target_srl = Context::get('uploadTargetSrl'); } } + + $tmp_files = $oFileModel->getFiles($tmp_target_srl); + if(is_array($tmp_files)) $tmp_file = $tmp_files[0]; + + // 첨부될 target_srl이 이전에 쓰인 target_srl인지 확인, 쓰였다면 이 모듈에서 쓰인게 맞는지 확인 + if(!$tmp_file || !$tmp_file->file_srl || $tmp_file->module_srl == $module_srl) { + $_SESSION['upload_info'][$editor_sequence]->upload_target_srl = $upload_target_srl = $tmp_target_srl; + } + else { + $_SESSION['upload_info'][$editor_sequence]->upload_target_srl = $upload_target_srl = ''; + } + unset($tmp_files); + unset($tmp_file); + if(!$upload_target_srl) { $_SESSION['upload_info'][$editor_sequence]->upload_target_srl = $upload_target_srl = getNextSequence(); }