getFiles($source_srl);
+ if(!$file_list) return;
+
+ $file_count = count($file_list);
+
+ for($i=0;$i<$file_count;$i++) {
+
+ unset($file_info);
+ $file_info = $file_list[$i];
+ $old_file = $file_info->uploaded_filename;
+
+ // 이미지인지 기타 파일인지 체크하여 이동할 위치 정함
+ if(preg_match("/\.(jpg|jpeg|gif|png|wmv|wma|mpg|mpeg|avi|swf|flv|mp1|mp2|mp3|mp4|asf|wav|asx|mid|midi|asf|mov|moov|qt|rm|ram|ra|rmm|m4v)$/i", $file_info->source_filename)) {
+ $path = sprintf("./files/attach/images/%s/%s/", $target_module_srl,$target_srl);
+ $new_file = $path.$file_info->source_filename;
+ } else {
+ $path = sprintf("./files/attach/binaries/%s/%s/", $target_module_srl, $target_srl);
+ $new_file = $path.md5(crypt(rand(1000000,900000), rand(0,100)));
+ }
+
+ // 이전 대상이 동일하면 그냥 패스
+ if($old_file == $new_file) continue;
+
+ // 디렉토리 생성
+ FileHandler::makeDir($path);
+
+ // 파일 이동
+ FileHandler::rename($old_file, $new_file);
+
+ // DB 정보도 수정
+ unset($args);
+ $args->file_srl = $file_info->file_srl;
+ $args->uploaded_filename = $new_file;
+ $args->module_srl = $file_info->module_srl;
+ $args->upload_target_srl = $target_srl;
+ executeQuery('file.updateFile', $args);
+ }
+ }
+
+ /**
+ * @brief upload_target_srl을 키로 하는 첨부파일을 찾아서 java script 코드로 return
+ **/
+ function printUploadedFileList($editor_sequence, $upload_target_srl) {
+ return;
+ }
+ }
+?>
+>>>>>>> .merge-right.r9269
diff --git a/modules/file/file.model.php b/modules/file/file.model.php
index df8de11c5..b7496d77e 100644
--- a/modules/file/file.model.php
+++ b/modules/file/file.model.php
@@ -1,3 +1,4 @@
+<<<<<<< .working
+=======
+upload_target_srl;
+
+ if($upload_target_srl) {
+ $tmp_files = $this->getFiles($upload_target_srl);
+ $file_count = count($tmp_files);
+
+ for($i=0;$i<$file_count;$i++) {
+ $file_info = $tmp_files[$i];
+ if(!$file_info->file_srl) continue;
+
+ $obj = null;
+ $obj->file_srl = $file_info->file_srl;
+ $obj->source_filename = $file_info->source_filename;
+ $obj->file_size = $file_info->file_size;
+ $obj->disp_file_size = FileHandler::filesize($file_info->file_size);
+ if($file_info->direct_download=='N') $obj->download_url = $this->getDownloadUrl($file_info->file_srl, $file_info->sid);
+ else $obj->download_url = str_replace('./', '', $file_info->uploaded_filename);
+ $obj->direct_download = $file_info->direct_download;
+ $files[] = $obj;
+ $attached_size += $file_info->file_size;
+ }
+ } else {
+ $upload_target_srl = 0;
+ $attached_size = 0;
+ $files = array();
+ }
+
+ // 업로드 상태 표시 작성
+ $upload_status = $this->getUploadStatus($attached_size);
+
+ // 남은 용량 체크
+ $config = $oModuleModel->getModuleInfoByMid($mid);
+ $file_config = $this->getUploadConfig();
+ $left_size = $file_config->allowed_attach_size*1024*1024 - $attached_size;
+
+ // 필요한 정보들 세팅
+ $this->add("files",$files);
+ $this->add("editor_sequence",$editor_sequence);
+ $this->add("upload_target_srl",$upload_target_srl);
+ $this->add("upload_status",$upload_status);
+ $this->add("left_size",$left_size);
+ }
+
+ /**
+ * @brief 특정 문서에 속한 첨부파일의 개수를 return
+ **/
+ function getFilesCount($upload_target_srl) {
+ $args->upload_target_srl = $upload_target_srl;
+ $output = executeQuery('file.getFilesCount', $args);
+ return (int)$output->data->count;
+ }
+
+ /**
+ * @brief 다운로드 경로를 구함
+ **/
+ function getDownloadUrl($file_srl, $sid) {
+ return sprintf('?module=%s&act=%s&file_srl=%s&sid=%s', 'file', 'procFileDownload', $file_srl, $sid);
+ }
+
+ /**
+ * @brief 파일 설정 정보를 구함
+ **/
+ function getFileConfig($module_srl = null) {
+ // 설정 정보를 받아옴 (module model 객체를 이용)
+ $oModuleModel = &getModel('module');
+
+ $file_module_config = $oModuleModel->getModuleConfig('file');
+
+ if($module_srl) $file_config = $oModuleModel->getModulePartConfig('file',$module_srl);
+ if(!$file_config) $file_config = $file_module_config;
+
+ if($file_config) {
+ $config->allowed_filesize = $file_config->allowed_filesize;
+ $config->allowed_attach_size = $file_config->allowed_attach_size;
+ $config->allowed_filetypes = $file_config->allowed_filetypes;
+ $config->download_grant = $file_config->download_grant;
+ $config->allow_outlink = $file_config->allow_outlink;
+ $config->allow_outlink_site = $file_config->allow_outlink_site;
+ $config->allow_outlink_format = $file_config->allow_outlink_format;
+ }
+
+ // 전체 파일첨부 속성을 먼저 따른다
+ if(!$config->allowed_filesize) $config->allowed_filesize = $file_module_config->allowed_filesize;
+ if(!$config->allowed_attach_size) $config->allowed_attach_size = $file_module_config->allowed_attach_size;
+ if(!$config->allowed_filetypes) $config->allowed_filetypes = $file_module_config->allowed_filetypes;
+ if(!$config->allow_outlink) $config->allow_outlink = $file_module_config->allow_outlink;
+ if(!$config->allow_outlink_site) $config->allow_outlink_site = $file_module_config->allow_outlink_site;
+ if(!$config->allow_outlink_format) $config->allow_outlink_format = $file_module_config->allow_outlink_format;
+ if(!$config->download_grant) $config->download_grant = $file_module_config->download_grant;
+
+ // 그래도 없으면 default로
+ if(!$config->allowed_filesize) $config->allowed_filesize = '2';
+ if(!$config->allowed_attach_size) $config->allowed_attach_size = '3';
+ if(!$config->allowed_filetypes) $config->allowed_filetypes = '*.*';
+ if(!$config->allow_outlink) $config->allow_outlink = 'Y';
+ if(!$config->download_grant) $config->download_grant = array();
+
+ return $config;
+ }
+
+ /**
+ * @brief 파일 정보를 구함
+ **/
+ function getFile($file_srl) {
+ $args->file_srl = $file_srl;
+ $output = executeQuery('file.getFile', $args);
+ if(!$output->toBool()) return $output;
+
+ $file = $output->data;
+ $file->download_url = $this->getDownloadUrl($file->file_srl, $file->sid);
+
+ return $file;
+ }
+
+ /**
+ * @brief 특정 문서에 속한 파일을 모두 return
+ **/
+ function getFiles($upload_target_srl) {
+ $args->upload_target_srl = $upload_target_srl;
+ $args->sort_index = 'file_srl';
+ $output = executeQuery('file.getFiles', $args);
+ if(!$output->data) return;
+
+ $file_list = $output->data;
+
+ if($file_list && !is_array($file_list)) $file_list = array($file_list);
+
+ $file_count = count($file_list);
+ for($i=0;$i<$file_count;$i++) {
+ $file = $file_list[$i];
+ $file->source_filename = stripslashes($file->source_filename);
+ $file->download_url = $this->getDownloadUrl($file->file_srl, $file->sid);
+ $file_list[$i] = $file;
+ }
+
+ return $file_list;
+ }
+
+ /**
+ * @brief 첨부파일에 대한 설정을 return (관리자/비관리자 자동 구분)
+ **/
+ function getUploadConfig() {
+ $logged_info = Context::get('logged_info');
+ if($logged_info->is_admin == 'Y') {
+ $file_config->allowed_filesize = preg_replace("/[a-z]/is","",ini_get('upload_max_filesize'));
+ $file_config->allowed_attach_size = preg_replace("/[a-z]/is","",ini_get('upload_max_filesize'));
+ $file_config->allowed_filetypes = '*.*';
+ } else {
+ $module_srl = Context::get('module_srl');
+ // module_srl이 없으면 현재 모듈
+ if(!$module_srl) {
+ $current_module_info = Context::get('current_module_info');
+ $module_srl = $current_module_info->module_srl;
+ }
+ $file_config = $this->getFileConfig($module_srl);
+ }
+ return $file_config;
+ }
+
+ /**
+ * @brief 파일 업로드를 위한 관리자/비관리자에 따른 안내문구 return
+ **/
+ function getUploadStatus($attached_size = 0) {
+ $file_config = $this->getUploadConfig();
+
+ // 업로드 상태 표시 작성
+ $upload_status = sprintf(
+ '%s : %s/ %s
%s : %s (%s : %s)',
+ Context::getLang('allowed_attach_size'),
+ FileHandler::filesize($attached_size),
+ FileHandler::filesize($file_config->allowed_attach_size*1024*1024),
+ Context::getLang('allowed_filesize'),
+ FileHandler::filesize($file_config->allowed_filesize*1024*1024),
+ Context::getLang('allowed_filetypes'),
+ $file_config->allowed_filetypes
+ );
+ return $upload_status;
+ }
+
+ /**
+ * @brief 특정 모듈의 file 설정을 return
+ **/
+ function getFileModuleConfig($module_srl) {
+ return $this->getFileConfig($module_srl);
+ }
+
+ function getFileGrant($file_info, $member_info){
+ if (!$file_info) return null;
+
+ if ($_SESSION['__XE_UPLOADING_FILES_INFO__'][$file_info->file_srl]) {
+ $file_grant->is_deletable = true;
+ return $file_grant;
+ }
+
+ $oModuleModel = &getModel('module');
+ $grant = $oModuleModel->getGrant($oModuleModel->getModuleInfoByModuleSrl($file_info->module_srl), $member_info);
+
+ $oDocumentModel = &getModel('document');
+ $oDocument = $oDocumentModel->getDocument($file_info->upload_target_srl);
+ if ($oDocument->isExists()) $document_grant = $oDocument->isGranted();
+
+ $file_grant->is_deletable = ($document_grant || $member_info->is_admin == 'Y' || $member_info->member_srl == $file_info->member_srl || $grant->manager);
+
+ return $file_grant;
+ }
+ }
+?>
+>>>>>>> .merge-right.r9269
diff --git a/modules/integration_search/integration_search.admin.view.php b/modules/integration_search/integration_search.admin.view.php
index 87eb4f8b4..e6a95c562 100644
--- a/modules/integration_search/integration_search.admin.view.php
+++ b/modules/integration_search/integration_search.admin.view.php
@@ -20,7 +20,7 @@
$oModuleModel = &getModel('module');
$this->config = $oModuleModel->getModuleConfig('integration_search');
Context::set('config',$this->config);
-
+
$this->setTemplatePath($this->module_path."/tpl/");
}
@@ -50,6 +50,9 @@
Context::set('mid_list',$module_categories);*/
+ $security = new Security();
+ $security->encodeHTML('skin_list..title');
+
// Sample Code
Context::set('sample_code', htmlspecialchars('') );
@@ -74,8 +77,11 @@
}
}
Context::set('skin_info', $skin_info);
- Context::set('skin_vars', $skin_vars);
-
+ Context::set('skin_vars', $skin_vars); //maybe not used
+
+ $security = new Security();
+ $security->encodeHTML('skin_info...');
+
$this->setTemplateFile("skin_info");
}
}
diff --git a/modules/integration_search/tpl/skin_info.html b/modules/integration_search/tpl/skin_info.html
index 541821231..29dd215d0 100644
--- a/modules/integration_search/tpl/skin_info.html
+++ b/modules/integration_search/tpl/skin_info.html
@@ -82,10 +82,10 @@
{@ $val->value = $val->default}
-
+
-
+
|
- {htmlspecialchars($val->title)} |
+ {$val->title} |
{zdate($val->regdate,"Y-m-d")} |
diff --git a/modules/layout/tpl/mindex.html b/modules/layout/tpl/mindex.html
index fe2d64b86..71adb11a0 100644
--- a/modules/layout/tpl/mindex.html
+++ b/modules/layout/tpl/mindex.html
@@ -28,7 +28,7 @@
(module)
|
- {htmlspecialchars($val->title)} |
+ {$val->title} |
{zdate($val->regdate,"Y-m-d")} |
diff --git a/modules/member/conf/module.xml b/modules/member/conf/module.xml
index bed4279ca..5068807dc 100644
--- a/modules/member/conf/module.xml
+++ b/modules/member/conf/module.xml
@@ -88,7 +88,7 @@
|