diff --git a/classes/module/ModuleHandler.class.php b/classes/module/ModuleHandler.class.php index 35d7870a8..bd762aeda 100644 --- a/classes/module/ModuleHandler.class.php +++ b/classes/module/ModuleHandler.class.php @@ -297,7 +297,10 @@ $oModule = &$this->getModuleInstance($forward->module, $type, $kind); } $xml_info = $oModuleModel->getModuleActionXml($forward->module); - if($kind == "admin" && $type == "view") + $oMemberModel = &getModel('member'); + $logged_info = $oMemberModel->getLoggedInfo(); + + if($this->module == "admin" && $type == "view") { $logged_info = Context::get('logged_info'); if($logged_info->is_admin=='Y'){ @@ -317,6 +320,18 @@ return $oMessageObject; } } + if ($kind == 'admin'){ + $grant = $oModuleModel->getGrant($this->module_info, $logged_info); + if(!$grant->is_admin && !$grant->manager) { + $this->error = 'msg_is_not_manager'; + $oMessageObject = &ModuleHandler::getModuleInstance('message',$type); + $oMessageObject->setError(-1); + $oMessageObject->setMessage($this->error); + $oMessageObject->dispMessage(); + return $oMessageObject; + } + + } } else if($xml_info->default_index_act && method_exists($oModule, $xml_info->default_index_act)) { diff --git a/common/js/unittest/unittest_common.html b/common/js/unittest/unittest_common.html index d747815d4..0361e7a8a 100644 --- a/common/js/unittest/unittest_common.html +++ b/common/js/unittest/unittest_common.html @@ -1,3 +1,4 @@ +<<<<<<< .working @@ -72,3 +73,79 @@ describe('SetQuery', {

A

B

+======= + + + + +JSSpec results + + + + + + + +

A

B

+ +>>>>>>> .merge-right.r9269 diff --git a/config/func.inc.php b/config/func.inc.php index 0b7833813..be21d1a79 100644 --- a/config/func.inc.php +++ b/config/func.inc.php @@ -414,7 +414,7 @@ * @brief If the recent post within a day, output format of YmdHis is "min/hours ago from now". If not within a day, it return format string. **/ function getTimeGap($date, $format = 'Y.m.d') { - $gap = time() - ztime($date); + $gap = time() - zgap() - ztime($date); $lang_time_gap = Context::getLang('time_gap'); if($gap<60) $buff = sprintf($lang_time_gap['min'], (int)($gap / 60)+1); diff --git a/modules/addon/addon.admin.controller.php b/modules/addon/addon.admin.controller.php index fa02dfeb6..a1b2b43d8 100644 --- a/modules/addon/addon.admin.controller.php +++ b/modules/addon/addon.admin.controller.php @@ -4,6 +4,7 @@ * @author NHN (developers@xpressengine.com) * @brief admin controller class of addon modules **/ + require_once(_XE_PATH_.'modules/addon/addon.controller.php'); class addonAdminController extends addonController { diff --git a/modules/addon/addon.admin.view.php b/modules/addon/addon.admin.view.php index 49fc3e12d..c08ee2252 100644 --- a/modules/addon/addon.admin.view.php +++ b/modules/addon/addon.admin.view.php @@ -74,6 +74,9 @@ // Template specifies the path and file $this->setTemplateFile('setup_addon'); + + $security = new Security(); + $security->encodeHTML('addon_info.', 'addon_info.author..', 'mid_list....'); } /** @@ -91,6 +94,9 @@ $this->setLayoutFile('popup_layout'); // Template specifies the path and file $this->setTemplateFile('addon_info'); + + $security = new Security(); + $security->encodeHTML('addon_info.', 'addon_info.author..'); } } diff --git a/modules/admin/admin.admin.view.php b/modules/admin/admin.admin.view.php index 8f26938ce..80a4b0124 100644 --- a/modules/admin/admin.admin.view.php +++ b/modules/admin/admin.admin.view.php @@ -212,6 +212,9 @@ // add javascript tooltip plugin - gony Context::loadJavascriptPlugin('qtip'); Context::loadJavascriptPlugin('watchinput'); + + $security = new Security(); + $security->encodeHTML('selected_module_info.', 'selected_module_info.author..', 'package_modules..', 'installed_modules..'); } /** @@ -309,7 +312,6 @@ } Context::set('news', $news); } - Context::set('released_version', $buff->zbxe_news->attrs->released_version); Context::set('download_link', $buff->zbxe_news->attrs->download_link); } @@ -356,7 +358,6 @@ Context::set('selected_lang', $db_info->lang_type); Context::set('default_url', $db_info->default_url); - Context::set('langs', Context::loadLangSupported()); Context::set('lang_selected', Context::loadLangSelected()); @@ -388,6 +389,9 @@ Context::set('pwd',$pwd); $this->setTemplateFile('config'); + + $security = new Security(); + $security->encodeHTML('news..', 'released_version', 'download_link', 'selected_lang', 'module_list..', 'module_list..author..', 'addon_list..', 'addon_list..author..', 'start_module.'); } /** diff --git a/modules/autoinstall/autoinstall.admin.view.php b/modules/autoinstall/autoinstall.admin.view.php index 0b4ea31b8..fa79de62f 100644 --- a/modules/autoinstall/autoinstall.admin.view.php +++ b/modules/autoinstall/autoinstall.admin.view.php @@ -97,6 +97,7 @@ $title = $xmlDoc->{$type}->title->body; $installed[$key]->title = $title; } + Context::set('installed', $installed); foreach($installed as $key=>$val) @@ -140,6 +141,9 @@ Context::set('page_navigation', $output->page_navigation); $this->setTemplateFile('index'); + + $security = new Security(); + $security->encodeHTML('item_list..'); } function dispAutoinstallAdminInstall() { @@ -203,7 +207,6 @@ $package->cur_version = $installedPackage->current_version; $package->need_update = version_compare($package->version, $installedPackage->current_version, ">"); } - Context::set("package", $package); } if(!$_SESSION['ftp_password']) @@ -211,6 +214,9 @@ Context::set('need_password', true); } $this->setTemplateFile('install'); + + $security = new Security(); + $security->encodeHTML('package.' , 'package.depends..'); } function dispAutoinstallAdminIndex() { @@ -288,6 +294,9 @@ Context::set('page_navigation', $page_navigation); } + $security = new Security(); + $security->encodeHTML('package.' , 'package.depends..'); + } function dispCategory() @@ -330,6 +339,11 @@ $installedPackage->avail_remove = $item_list[$package_srl]->avail_remove; $installedPackage->deps = $item_list[$package_srl]->deps; Context::set('package', $installedPackage); + $this->setTemplateFile('uninstall'); + Context::addJsFilter($this->module_path.'tpl/filter', 'uninstall_package.xml'); + + $security = new Security(); + $security->encodeHTML('package.'); $this->setTemplateFile('uninstall'); } diff --git a/modules/autoinstall/tpl/list.html b/modules/autoinstall/tpl/list.html index 0f16eb365..501196d9c 100644 --- a/modules/autoinstall/tpl/list.html +++ b/modules/autoinstall/tpl/list.html @@ -24,9 +24,9 @@ Sort by - {$lang->order_newest} | - {$lang->order_download} | - {$lang->order_popular} + {$lang->order_newest} | + {$lang->order_download} | + {$lang->order_popular} diff --git a/modules/comment/tpl/comment_list.html b/modules/comment/tpl/comment_list.html index 5d14fc3d1..90259fbeb 100644 --- a/modules/comment/tpl/comment_list.html +++ b/modules/comment/tpl/comment_list.html @@ -52,10 +52,10 @@ xe.lang.msg_empty_search_keyword = '{$lang->msg_empty_search_keyword}'; - {@ $comment = cut_str(trim(htmlspecialchars(strip_tags($val->content))), 200, '...')} + {@ $comment = cut_str(trim(strip_tags($val->content)), 200, '...')} {$comment}{$lang->no_text_comment} - {htmlspecialchars($val->nick_name)} + {$val->nick_name} 0/0 {(zdate($val->regdate,"Y-m-d\nH:i:s"))} {$val->ipaddress} diff --git a/modules/communication/communication.admin.model.php b/modules/communication/communication.admin.model.php index 862eac520..0c6131265 100644 --- a/modules/communication/communication.admin.model.php +++ b/modules/communication/communication.admin.model.php @@ -1,3 +1,4 @@ +<<<<<<< .working +======= +loadSkinInfo($this->module_path, $skin); + Context::set('skin_info', $skin_info); + + $oModuleModel = &getModel('module'); + $communication_config = $oModuleModel->getModuleConfig('communication'); + if(!$communication_config->colorset) $communication_config->colorset = "white"; + Context::set('communication_config', $communication_config); + + $security = new Security(); + $security->encodeHTML('skin_info.colorset..title','skin_info.colorset..name'); + $security->encodeHTML('skin_info.colorset..name'); + + $oTemplate = &TemplateHandler::getInstance(); + $tpl = $oTemplate->compile($this->module_path.'tpl', 'colorset_list'); + } + + $this->add('tpl', $tpl); + } + + } +?> +>>>>>>> .merge-right.r9269 diff --git a/modules/communication/communication.admin.view.php b/modules/communication/communication.admin.view.php index 9e751746c..c45f37ccc 100644 --- a/modules/communication/communication.admin.view.php +++ b/modules/communication/communication.admin.view.php @@ -27,7 +27,12 @@ Context::set('editor_skin_list', $oEditorModel->getEditorSkinList() ); // get a list of communication skins Context::set('communication_skin_list', $oModuleModel->getSkins($this->module_path) ); - // specify a template + $security = new Security(); + $security->encodeHTML('communication_config..'); + $security->encodeHTML('editor_skin_list..'); + $security->encodeHTML('communication_skin_list..title'); + + // specify a template $this->setTemplatePath($this->module_path.'tpl'); $this->setTemplateFile('index'); } diff --git a/modules/document/document.admin.controller.php b/modules/document/document.admin.controller.php index 8560cfb8d..d17d9e30b 100644 --- a/modules/document/document.admin.controller.php +++ b/modules/document/document.admin.controller.php @@ -544,6 +544,8 @@ $document_args->document_srl = $output->data->document_srl; $document_args->module_srl = $output->data->module_srl; $document_args->member_srl = $output->data->member_srl; + $document_args->ipaddress = $output->data->ipaddress; + $document_args->update_order = $output->data->update_order; $oDocument = $oDocumentModel->getDocument($document_args->document_srl); diff --git a/modules/document/document.admin.view.php b/modules/document/document.admin.view.php index 2ed0b26f7..cbecaa317 100644 --- a/modules/document/document.admin.view.php +++ b/modules/document/document.admin.view.php @@ -1,3 +1,4 @@ +<<<<<<< .working +======= +page = Context::get('page'); ///< 페이지 + $args->list_count = 30; ///< 한페이지에 보여줄 글 수 + $args->page_count = 10; ///< 페이지 네비게이션에 나타날 페이지의 수 + + $args->search_target = Context::get('search_target'); ///< 검색 대상 (title, contents...) + $args->search_keyword = Context::get('search_keyword'); ///< 검색어 + + $args->sort_index = 'list_order'; ///< 소팅 값 + + $args->module_srl = Context::get('module_srl'); + + // 목록 구함, document->getDocumentList 에서 걍 알아서 다 해버리는 구조이다... (아.. 이거 나쁜 버릇인데.. ㅡ.ㅜ 어쩔수 없다) + $oDocumentModel = &getModel('document'); + $output = $oDocumentModel->getDocumentList($args); + + // 템플릿에 쓰기 위해서 document_model::getDocumentList() 의 return object에 있는 값들을 세팅 + Context::set('total_count', $output->total_count); + Context::set('total_page', $output->total_page); + Context::set('page', $output->page); + Context::set('document_list', $output->data); + Context::set('page_navigation', $output->page_navigation); + + // 템플릿에서 사용할 검색옵션 세팅 + $count_search_option = count($this->search_option); + for($i=0;$i<$count_search_option;$i++) { + $search_option[$this->search_option[$i]] = Context::getLang($this->search_option[$i]); + } + Context::set('search_option', $search_option); + + // 템플릿 지정 + $this->setTemplatePath($this->module_path.'tpl'); + $this->setTemplateFile('document_list'); + } + + /** + * @brief 문서 모듈 설정 + **/ + function dispDocumentAdminConfig() { + $oDocumentModel = &getModel('document'); + $config = $oDocumentModel->getDocumentConfig(); + Context::set('config',$config); + + // 템플릿 파일 지정 + $this->setTemplatePath($this->module_path.'tpl'); + $this->setTemplateFile('document_config'); + } + + /** + * @brief 관리자 페이지의 신고 목록 보기 + **/ + function dispDocumentAdminDeclared() { + // 목록을 구하기 위한 옵션 + $args->page = Context::get('page'); ///< 페이지 + $args->list_count = 30; ///< 한페이지에 보여줄 글 수 + $args->page_count = 10; ///< 페이지 네비게이션에 나타날 페이지의 수 + + $args->sort_index = 'document_declared.declared_count'; ///< 소팅 값 + $args->order_type = 'desc'; ///< 소팅 정렬 값 + + // 목록을 구함 + $declared_output = executeQuery('document.getDeclaredList', $args); + + if($declared_output->data && count($declared_output->data)) { + $document_list = array(); + + $oDocumentModel = &getModel('document'); + foreach($declared_output->data as $key => $document) { + $document_list[$key] = new documentItem(); + $document_list[$key]->setAttribute($document); + } + $declared_output->data = $document_list; + } + + // 템플릿에 쓰기 위해서 document_model::getDocumentList() 의 return object에 있는 값들을 세팅 + Context::set('total_count', $declared_output->total_count); + Context::set('total_page', $declared_output->total_page); + Context::set('page', $declared_output->page); + Context::set('document_list', $declared_output->data); + Context::set('page_navigation', $declared_output->page_navigation); + + // 템플릿 지정 + $this->setTemplatePath($this->module_path.'tpl'); + $this->setTemplateFile('declared_list'); + } + + function dispDocumentAdminAlias() { + $args->document_srl = Context::get('document_srl'); + if(!$args->document_srl) return $this->dispDocumentAdminList(); + + $oModel = &getModel('document'); + $oDocument = $oModel->getDocument($args->document_srl); + if(!$oDocument->isExists()) return $this->dispDocumentAdminList(); + Context::set('oDocument', $oDocument); + + $output = executeQueryArray('document.getAliases', $args); + if(!$output->data) + { + $aliases = array(); + } + else + { + $aliases = $output->data; + } + + Context::set('aliases', $aliases); + + $this->setTemplatePath($this->module_path.'tpl'); + $this->setTemplateFile('document_alias'); + } + + function dispDocumentAdminTrashList() { + // 목록을 구하기 위한 옵션 + $args->page = Context::get('page'); ///< 페이지 + $args->list_count = 30; ///< 한페이지에 보여줄 글 수 + $args->page_count = 10; ///< 페이지 네비게이션에 나타날 페이지의 수 + + $args->sort_index = 'list_order'; ///< 소팅 값 + $args->order_type = 'desc'; ///< 소팅 정렬 값 + + $args->module_srl = Context::get('module_srl'); + + // 목록을 구함 + $oDocumentAdminModel = &getAdminModel('document'); + $output = $oDocumentAdminModel->getDocumentTrashList($args); + + // 템플릿에 쓰기 위해서 document_admin_model::getDocumentTrashList() 의 return object에 있는 값들을 세팅 + Context::set('total_count', $output->total_count); + Context::set('total_page', $output->total_page); + Context::set('page', $output->page); + Context::set('document_list', $output->data); + Context::set('page_navigation', $output->page_navigation); + + // 템플릿 지정 + $this->setTemplatePath($this->module_path.'tpl'); + $this->setTemplateFile('document_trash_list'); + } + } +?> +>>>>>>> .merge-right.r9269 diff --git a/modules/document/document.controller.php b/modules/document/document.controller.php index 78e6d4418..80a9d499a 100644 --- a/modules/document/document.controller.php +++ b/modules/document/document.controller.php @@ -1603,20 +1603,26 @@ class documentController extends document { else $document_srl_list = $cart; $document_srl_count = count($document_srl_list); + + $oDocumentModel = &getModel('document'); + $document_items = array(); + foreach($document_srl_list as $document_srl){ + $oDocument = $oDocumentModel->getDocument($document_srl); + $document_items[] = $oDocument; + if (!$oDocument->isGranted()) return $this->stop('msg_not_permitted'); + } + // Send a message if($message_content) { $oCommunicationController = &getController('communication'); - $oDocumentModel = &getModel('document'); $logged_info = Context::get('logged_info'); $title = cut_str($message_content,10,'...'); $sender_member_srl = $logged_info->member_srl; - for($i=0;$i<$document_srl_count;$i++) { - $document_srl = $document_srl_list[$i]; - $oDocument = $oDocumentModel->getDocument($document_srl); + foreach($document_items as $oDocument){ if(!$oDocument->get('member_srl') || $oDocument->get('member_srl')==$sender_member_srl) continue; if($type=='move') $purl = sprintf("%s", $oDocument->getPermanentUrl(), $oDocument->getPermanentUrl()); @@ -1802,4 +1808,4 @@ class documentController extends document { if(!$obj->status && $obj->is_secret != 'Y') $obj->status = $this->getConfigStatus('public'); } } -?> +?> \ No newline at end of file diff --git a/modules/document/document.item.php b/modules/document/document.item.php index 81360772d..c0cfe4176 100644 --- a/modules/document/document.item.php +++ b/modules/document/document.item.php @@ -80,7 +80,8 @@ $logged_info = Context::get('logged_info'); if($logged_info->is_admin == 'Y') return true; - $grant = Context::get('grant'); + $oModuleModel = &getModel('module'); + $grant = $oModuleModel->getGrant($oModuleModel->getModuleInfoByModuleSrl($this->get('module_srl')), $logged_info); if($grant->manager) return true; if($this->get('member_srl') && ($this->get('member_srl') == $logged_info->member_srl || $this->get('member_srl')*-1 == $logged_info->member_srl)) return true; diff --git a/modules/document/document.model.php b/modules/document/document.model.php index d3d120665..daf2b4851 100644 --- a/modules/document/document.model.php +++ b/modules/document/document.model.php @@ -819,7 +819,10 @@ // Bringing existing extra_keys $extra_keys = $this->getExtraKeys($module_srl); Context::set('extra_keys', $extra_keys); - // Get information of module_grants + $security = new Security(); + $security->encodeHTML('extra_keys..name','extra_keys..eid'); + + // Get information of module_grants $oTemplate = &TemplateHandler::getInstance(); return $oTemplate->compile($this->module_path.'tpl', 'extra_keys'); } @@ -878,6 +881,10 @@ $category_info->title = htmlspecialchars($category_info->title); Context::set('category_info', $category_info); + + $security = new Security(); + $security->encodeHTML('group_list..title'); + // tpl template file directly compile and will return a variable and puts it on. $oTemplate = &TemplateHandler::getInstance(); $tpl = $oTemplate->compile('./modules/document/tpl', 'category_info'); diff --git a/modules/document/tpl/extra_keys.html b/modules/document/tpl/extra_keys.html index 5617adee6..a345e325e 100644 --- a/modules/document/tpl/extra_keys.html +++ b/modules/document/tpl/extra_keys.html @@ -28,7 +28,7 @@
{$lang->column_name}
- {$lang->cmd_find_langcode} + {$lang->cmd_find_langcode} diff --git a/modules/editor/editor.admin.view.php b/modules/editor/editor.admin.view.php index 723204163..b9b5ac6b0 100644 --- a/modules/editor/editor.admin.view.php +++ b/modules/editor/editor.admin.view.php @@ -71,7 +71,10 @@ Context::set('component_list', $component_list); Context::set('component_count', $component_count); Context::set('editor_config_default', $editor_config_default); - + + $security = new Security(); + $security->encodeHTML('component_list....'); + $this->setTemplatePath($this->module_path.'tpl'); $this->setTemplateFile('admin_index'); } @@ -109,10 +112,16 @@ } } else { $module_categories[0]->list = $mid_list; - } + } Context::set('mid_list',$module_categories); + //Security + $security = new Security(); + $security->encodeHTML('group_list..title'); + $security->encodeHTML('component...'); + $security->encodeHTML('mid_list..title','mid_list..list..browser_title'); + $this->setTemplatePath($this->module_path.'tpl'); $this->setTemplateFile('setup_component'); $this->setLayoutFile("popup_layout"); diff --git a/modules/editor/editor.view.php b/modules/editor/editor.view.php index 6deded5ab..6d3b6daa8 100644 --- a/modules/editor/editor.view.php +++ b/modules/editor/editor.view.php @@ -96,18 +96,26 @@ $style = $contents[$i]; $info = $oModuleModel->loadSkinInfo($this->module_path,$style,'styles'); $content_style_list[$style]->title = $info->title; - } + } Context::set('content_style_list', $content_style_list); // Get a group list $oMemberModel = &getModel('member'); $site_module_info = Context::get('site_module_info'); $group_list = $oMemberModel->getGroups($site_module_info->site_srl); Context::set('group_list', $group_list); - // Set a template file + + //Security + $security = new Security(); + $security->encodeHTML('group_list..title'); + $security->encodeHTML('group_list..description'); + $security->encodeHTML('content_style_list..'); + $security->encodeHTML('editor_comment_colorset_list..title'); + + // Set a template file $oTemplate = &TemplateHandler::getInstance(); $tpl = $oTemplate->compile($this->module_path.'tpl', 'editor_module_config'); $obj .= $tpl; - + return new Object(); } diff --git a/modules/file/file.admin.view.php b/modules/file/file.admin.view.php index 5f7e673f7..cc3a9652c 100644 --- a/modules/file/file.admin.view.php +++ b/modules/file/file.admin.view.php @@ -164,8 +164,13 @@ Context::set('page', $output->page); Context::set('page_navigation', $output->page_navigation); // Set a template + $security = new Security(); + $security->encodeHTML('file_list..source_filename','file_list..ipaddress'); + $security->encodeHTML('module_list..browser_title','module_list..mid'); + $this->setTemplatePath($this->module_path.'tpl'); $this->setTemplateFile('file_list'); + } /** diff --git a/modules/file/file.controller.php b/modules/file/file.controller.php index 173387be0..39fa7f4ca 100644 --- a/modules/file/file.controller.php +++ b/modules/file/file.controller.php @@ -1,3 +1,4 @@ +<<<<<<< .working +======= +module_srl; + + // 업로드 권한이 없거나 정보가 없을시 종료 + if(!$_SESSION['upload_info'][$editor_sequence]->enabled) exit(); + + // upload_target_srl 값이 명시되지 않았을 경우 세션정보에서 추출 + if(!$upload_target_srl) $upload_target_srl = $_SESSION['upload_info'][$editor_sequence]->upload_target_srl; + + // 세션정보에도 정의되지 않았다면 새로 생성 + if(!$upload_target_srl) $_SESSION['upload_info'][$editor_sequence]->upload_target_srl = $upload_target_srl = getNextSequence(); + + + return $this->insertFile($file_info, $module_srl, $upload_target_srl); + } + + + /** + * @brief iframe 첨부파일 업로드 + **/ + function procFileIframeUpload() { + // 기본적으로 필요한 변수 설정 + $editor_sequence = Context::get('editor_sequence'); + $callback = Context::get('callback'); + $module_srl = $this->module_srl; + $upload_target_srl = intval(Context::get('uploadTargetSrl')); + if(!$upload_target_srl) $upload_target_srl = intval(Context::get('upload_target_srl')); + + // 업로드 권한이 없거나 정보가 없을시 종료 + if(!$_SESSION['upload_info'][$editor_sequence]->enabled) exit(); + + // upload_target_srl 값이 명시되지 않았을 경우 세션정보에서 추출 + if(!$upload_target_srl) $upload_target_srl = $_SESSION['upload_info'][$editor_sequence]->upload_target_srl; + + // 세션정보에도 정의되지 않았다면 새로 생성 + if(!$upload_target_srl) $_SESSION['upload_info'][$editor_sequence]->upload_target_srl = $upload_target_srl = getNextSequence(); + + // file_srl이 요청되었을 경우 삭제 후 재업로드 시도 + $file_srl = Context::get('file_srl'); + if($file_srl) $this->deleteFile($file_srl); + + $file_info = Context::get('Filedata'); + + // 정상적으로 업로드된 파일이 아니면 오류 출력 + if(is_uploaded_file($file_info['tmp_name'])) { + $output = $this->insertFile($file_info, $module_srl, $upload_target_srl); + Context::set('uploaded_fileinfo',$output); + } + + Context::set('layout','none'); + + $this->setTemplatePath($this->module_path.'tpl'); + $this->setTemplateFile('iframe'); + + } + + /** + * @brief image resize + **/ + function procFileImageResize() { + $source_src = Context::get('source_src'); + $width = Context::get('width'); + $height = Context::get('height'); + $type = Context::get('type'); + $output_src = Context::get('output_src'); + + if(!$source_src || !$width) return new Object(-1,'msg_invalid_request'); + if(!$output_src){ + $output_src = $source_src . '.resized' . strrchr($source_src,'.'); + } + if(!$type) $type = 'ratio'; + if(!$height) $height = $width-1; + + if(FileHandler::createImageFile($source_src,$output_src,$width,$height,'','ratio')){ + $output->info = getimagesize($output_src); + $output->src = $output_src; + }else{ + return new Object(-1,'msg_invalid_request'); + } + + $this->add('resized_info',$output); + } + + + + /** + * @brief 첨부파일 다운로드 + * 직접 요청을 받음 + * file_srl : 파일의 sequence + * sid : db에 저장된 비교 값, 틀리면 다운로드 하지 않음 + **/ + function procFileDownload() { + $oFileModel = &getModel('file'); + + $file_srl = Context::get('file_srl'); + $sid = Context::get('sid'); + $logged_info = Context::get('logged_info'); + + // 파일의 정보를 DB에서 받아옴 + $file_obj = $oFileModel->getFile($file_srl); + + // 요청된 파일 정보가 잘못되었다면 파일을 찾을 수 없다는 오류 출력 + if($file_obj->file_srl!=$file_srl || $file_obj->sid!=$sid) return $this->stop('msg_file_not_found'); + + // 대기 상태일 경우 파일 다운로드 권한이 없음을 알림 (최고관리자는 다운 로드 허용) + if($logged_info->is_admin != 'Y' && $file_obj->isvalid!='Y') return $this->stop('msg_not_permitted_download'); + + // 파일 이름 + $filename = $file_obj->source_filename; + $file_module_config = $oFileModel->getFileModuleConfig($file_obj->module_srl); + + // 파일 외부링크 차단 + if($file_module_config->allow_outlink == 'N') { + //외부링크 허용 확장자 처리 + if($file_module_config->allow_outlink_format) { + $allow_outlink_format_array = array(); + $allow_outlink_format_array = explode(',', $file_module_config->allow_outlink_format); + if(!is_array($allow_outlink_format_array)) $allow_outlink_format_array[0] = $file_module_config->allow_outlink_format; + + foreach($allow_outlink_format_array as $val) { + $val = trim($val); + if(preg_match("/\.{$val}$/i", $filename)) { + $file_module_config->allow_outlink = 'Y'; + break; + } + } + } + //외부링크 허용 사이트 처리 + if($file_module_config->allow_outlink != 'Y') { + $referer = parse_url($_SERVER["HTTP_REFERER"]); + if($referer['host'] != $_SERVER['HTTP_HOST']) { + if($file_module_config->allow_outlink_site) { + $allow_outlink_site_array = array(); + $allow_outlink_site_array = explode("\n", $file_module_config->allow_outlink_site); + if(!is_array($allow_outlink_site_array)) $allow_outlink_site_array[0] = $file_module_config->allow_outlink_site; + + foreach($allow_outlink_site_array as $val) { + $site = parse_url(trim($val)); + if($site['host'] == $referer['host']) { + $file_module_config->allow_outlink = 'Y'; + break; + } + } + } + } + else $file_module_config->allow_outlink = 'Y'; + } + if($file_module_config->allow_outlink != 'Y') return $this->stop('msg_not_allowed_outlink'); + } + + // 파일 다운로드 권한이 있는지 확인 + if(is_array($file_module_config->download_grant) && count($file_module_config->download_grant)>0) { + if(!Context::get('is_logged')) return $this->stop('msg_not_permitted_download'); + $logged_info = Context::get('logged_info'); + if($logged_info->is_admin != 'Y') { + + $oModuleModel =& getModel('module'); + $module_info = $oModuleModel->getModuleInfoByModuleSrl($file_obj->module_srl); + + if(!$oModuleModel->isSiteAdmin($logged_info, $module_info->site_srl)) + { + $oMemberModel =& getModel('member'); + $member_groups = $oMemberModel->getMemberGroups($logged_info->member_srl, $module_info->site_srl); + + $is_permitted = false; + for($i=0;$idownload_grant);$i++) { + $group_srl = $file_module_config->download_grant[$i]; + if($member_groups[$group_srl]) { + $is_permitted = true; + break; + } + } + if(!$is_permitted) return $this->stop('msg_not_permitted_download'); + } + } + } + + // trigger 호출 (before) + $output = ModuleHandler::triggerCall('file.downloadFile', 'before', $file_obj); + if(!$output->toBool()) return $this->stop(($output->message)?$output->message:'msg_not_permitted_download'); + + // 파일 출력 + if(strstr($_SERVER['HTTP_USER_AGENT'], "MSIE")) { + $filename = rawurlencode($filename); + $filename = preg_replace('/\./', '%2e', $filename, substr_count($filename, '.') - 1); + } + + $uploaded_filename = $file_obj->uploaded_filename; + if(!file_exists($uploaded_filename)) return $this->stop('msg_file_not_found'); + + $fp = fopen($uploaded_filename, 'rb'); + if(!$fp) return $this->stop('msg_file_not_found'); + + header("Cache-Control: "); + header("Pragma: "); + header("Content-Type: application/octet-stream"); + header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); + + header("Content-Length: " .(string)($file_obj->file_size)); + header('Content-Disposition: attachment; filename="'.$filename.'"'); + header("Content-Transfer-Encoding: binary\n"); + + // if file size is lager than 10MB, use fread function (#18675748) + if (filesize($uploaded_filename) > 1024 * 1024) { + while(!feof($fp)) echo fread($fp, 1024); + fclose($fp); + } else { + fpassthru($fp); + } + + // 이상이 없으면 download_count 증가 + $args->file_srl = $file_srl; + executeQuery('file.updateFileDownloadCount', $args); + + // trigger 호출 (after) + $output = ModuleHandler::triggerCall('file.downloadFile', 'after', $file_obj); + + Context::close(); + + exit(); + } + + /** + * @brief 에디터에서 첨부 파일 삭제 + **/ + function procFileDelete() { + // 기본적으로 필요한 변수인 upload_target_srl, module_srl을 설정 + $editor_sequence = Context::get('editor_sequence'); + $file_srl = Context::get('file_srl'); + $file_srls = Context::get('file_srls'); + if($file_srls) $file_srl = $file_srls; + + // 업로드 권한이 없거나 정보가 없을시 종료 + if(!$_SESSION['upload_info'][$editor_sequence]->enabled) exit(); + + $upload_target_srl = $_SESSION['upload_info'][$editor_sequence]->upload_target_srl; + + $logged_info = Context::get('logged_info'); + $oFileModel = &getModel('file'); + + $srls = explode(',',$file_srl); + if(!count($srls)) return; + + for($i=0;$ifile_srl = $srl; + $output = executeQuery('file.getFile', $args); + if(!$output->toBool()) continue; + + $file_info = $output->data; + if(!$file_info) continue; + + $file_grant = $oFileModel->getFileGrant($file_info, $logged_info); + + if(!$file_grant->is_deletable) continue; + + if($upload_target_srl && $file_srl) $output = $this->deleteFile($file_srl); + } + + } + + /** + * @brief 특정 upload_target_srl(document_srl)에 등록된 첨부파일의 갯수를 return하는 trigger + **/ + function triggerCheckAttached(&$obj) { + $document_srl = $obj->document_srl; + if(!$document_srl) return new Object(); + + // 첨부 파일의 갯수를 구함 + $oFileModel = &getModel('file'); + $obj->uploaded_count = $oFileModel->getFilesCount($document_srl); + + return new Object(); + } + + /** + * @brief 특정 upload_target_srl(document_srl)에 등록된 첨부파일을 연결하는 trigger + **/ + function triggerAttachFiles(&$obj) { + $document_srl = $obj->document_srl; + if(!$document_srl) return new Object(); + + $output = $this->setFilesValid($document_srl); + if(!$output->toBool()) return $output; + + return new Object(); + } + + /** + * @brief 특정 upload_target_srl(document_srl)에 등록된 첨부파일을 삭제하는 trigger + **/ + function triggerDeleteAttached(&$obj) { + $document_srl = $obj->document_srl; + if(!$document_srl) return new Object(); + + $output = $this->deleteFiles($document_srl); + return $output; + } + + /** + * @brief 특정 upload_target_srl(comment_srl)에 등록된 첨부파일의 갯수를 return하는 trigger + **/ + function triggerCommentCheckAttached(&$obj) { + $comment_srl = $obj->comment_srl; + if(!$comment_srl) return new Object(); + + // 첨부 파일의 갯수를 구함 + $oFileModel = &getModel('file'); + $obj->uploaded_count = $oFileModel->getFilesCount($comment_srl); + + return new Object(); + } + + /** + * @brief 특정 upload_target_srl(comment_srl)에 등록된 첨부파일을 연결하는 trigger + **/ + function triggerCommentAttachFiles(&$obj) { + $comment_srl = $obj->comment_srl; + $uploaded_count = $obj->uploaded_count; + if(!$comment_srl || !$uploaded_count) return new Object(); + + $output = $this->setFilesValid($comment_srl); + if(!$output->toBool()) return $output; + + return new Object(); + } + + /** + * @brief 특정 upload_target_srl(comment_srl)에 등록된 첨부파일을 삭제하는 trigger + **/ + function triggerCommentDeleteAttached(&$obj) { + $comment_srl = $obj->comment_srl; + if(!$comment_srl) return new Object(); + + $output = $this->deleteFiles($comment_srl); + return $output; + } + + /** + * @brief module 삭제시 해당 첨부파일 모두 삭제하는 trigger + **/ + function triggerDeleteModuleFiles(&$obj) { + $module_srl = $obj->module_srl; + if(!$module_srl) return new Object(); + + $oFileController = &getAdminController('file'); + return $oFileController->deleteModuleFiles($module_srl); + } + + /** + * @brief 업로드 가능하다고 세팅 + **/ + function setUploadInfo($editor_sequence, $upload_target_srl=0) { + $_SESSION['upload_info'][$editor_sequence]->enabled = true; + $_SESSION['upload_info'][$editor_sequence]->upload_target_srl = $upload_target_srl; + } + + /** + * @brief 특정 upload_target_srl의 첨부파일들의 상태를 유효로 변경 + * 글이 등록될때 글에 첨부된 파일들의 상태를 유효상태로 변경함으로서 관리시 불필요 파일로 인식되지 않도록 함 + **/ + function setFilesValid($upload_target_srl) { + $args->upload_target_srl = $upload_target_srl; + return executeQuery('file.updateFileValid', $args); + } + + /** + * @brief 첨부파일 추가 + **/ + function insertFile($file_info, $module_srl, $upload_target_srl, $download_count = 0, $manual_insert = false) { + // trigger 호출 (before) + $trigger_obj->module_srl = $module_srl; + $trigger_obj->upload_target_srl = $upload_target_srl; + $output = ModuleHandler::triggerCall('file.insertFile', 'before', $trigger_obj); + if(!$output->toBool()) return $output; + + // A workaround for Firefox upload bug + if (preg_match('/^=\?UTF-8\?B\?(.+)\?=$/i', $file_info['name'], $match)) { + $file_info['name'] = base64_decode(strtr($match[1], ':', '/')); + } + + if(!$manual_insert) { + // 첨부파일 설정 가져옴 + $logged_info = Context::get('logged_info'); + if($logged_info->is_admin != 'Y') { + $oFileModel = &getModel('file'); + $config = $oFileModel->getFileConfig($module_srl); + $allowed_filesize = $config->allowed_filesize * 1024 * 1024; + $allowed_attach_size = $config->allowed_attach_size * 1024 * 1024; + + // 한 파일당 허용 용량 초과시 오류 출력 + if($allowed_filesize < filesize($file_info['tmp_name'])) return new Object(-1, 'msg_exceeds_limit_size'); + + + // 해당 문서에 첨부된 모든 파일의 용량을 가져옴 (DB에서 가져옴) + $size_args->upload_target_srl = $upload_target_srl; + $output = executeQuery('file.getAttachedFileSize', $size_args); + $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'); + } + } + + // 이미지인지 기타 파일인지 체크하여 upload path 지정 + if(preg_match("/\.(jpe?g|gif|png|wm[va]|mpe?g|avi|swf|flv|mp[1-4]|as[fx]|wav|midi?|moo?v|qt|r[am]{1,2}|m4v)$/i", $file_info['name'])) { + // direct 파일에 해킹을 의심할 수 있는 확장자가 포함되어 있으면 바로 삭제함 + $file_info['name'] = preg_replace('/\.(php|phtm|html?|cgi|pl|exe|jsp|asp|inc)/i', '$0-x',$file_info['name']); + $file_info['name'] = str_replace(array('<','>'),array('%3C','%3E'),$file_info['name']); + + $path = sprintf("./files/attach/images/%s/%s", $module_srl,getNumberingPath($upload_target_srl,3)); + + // special character to '_' + // change to md5 file name. because window php bug. window php is not recognize unicode character file name - by cherryfilter + $ext = substr(strrchr($file_info['name'],'.'),1); + //$_filename = preg_replace('/[#$&*?+%"\']/', '_', $file_info['name']); + $_filename = md5(crypt(rand(1000000,900000), rand(0,100))).'.'.$ext; + $filename = $path.$_filename; + $idx = 1; + while(file_exists($filename)) { + $filename = $path.preg_replace('/\.([a-z0-9]+)$/i','_'.$idx.'.$1',$_filename); + $idx++; + } + $direct_download = 'Y'; + } else { + $path = sprintf("./files/attach/binaries/%s/%s", $module_srl, getNumberingPath($upload_target_srl,3)); + $filename = $path.md5(crypt(rand(1000000,900000), rand(0,100))); + $direct_download = 'N'; + } + + // 디렉토리 생성 + if(!FileHandler::makeDir($path)) return new Object(-1,'msg_not_permitted_create'); + + // 파일 이동 + if($manual_insert) { + @copy($file_info['tmp_name'], $filename); + if(!file_exists($filename)) { + $filename = $path. md5(crypt(rand(1000000,900000).$file_info['name'])).'.'.$ext; + @copy($file_info['tmp_name'], $filename); + } + } else { + if(!@move_uploaded_file($file_info['tmp_name'], $filename)) { + $filename = $path. md5(crypt(rand(1000000,900000).$file_info['name'])).'.'.$ext; + if(!@move_uploaded_file($file_info['tmp_name'], $filename)) return new Object(-1,'msg_file_upload_error'); + } + } + + // 사용자 정보를 구함 + $oMemberModel = &getModel('member'); + $member_srl = $oMemberModel->getLoggedMemberSrl(); + + // 파일 정보를 정리 + $args->file_srl = getNextSequence(); + $args->upload_target_srl = $upload_target_srl; + $args->module_srl = $module_srl; + $args->direct_download = $direct_download; + $args->source_filename = $file_info['name']; + $args->uploaded_filename = $filename; + $args->download_count = $download_count; + $args->file_size = @filesize($filename); + $args->comment = NULL; + $args->member_srl = $member_srl; + $args->sid = md5(rand(rand(1111111,4444444),rand(4444445,9999999))); + + $output = executeQuery('file.insertFile', $args); + if(!$output->toBool()) return $output; + + // trigger 호출 (after) + $trigger_output = ModuleHandler::triggerCall('file.insertFile', 'after', $args); + if(!$trigger_output->toBool()) return $trigger_output; + + + $_SESSION['__XE_UPLOADING_FILES_INFO__'][$args->file_srl] = true; + + $output->add('file_srl', $args->file_srl); + $output->add('file_size', $args->file_size); + $output->add('sid', $args->sid); + $output->add('direct_download', $args->direct_download); + $output->add('source_filename', $args->source_filename); + $output->add('upload_target_srl', $upload_target_srl); + $output->add('uploaded_filename', $args->uploaded_filename); + return $output; + } + + /** + * @brief 첨부파일 삭제 + **/ + function deleteFile($file_srl) { + if(!$file_srl) return; + + $srls = explode(',',$file_srl); + if(!count($srls)) return; + + for($i=0;$ifile_srl = $srl; + $output = executeQuery('file.getFile', $args); + if(!$output->toBool()) continue; + + $file_info = $output->data; + if(!$file_info) continue; + + $source_filename = $output->data->source_filename; + $uploaded_filename = $output->data->uploaded_filename; + + // trigger 호출 (before) + $trigger_obj = $output->data; + $output = ModuleHandler::triggerCall('file.deleteFile', 'before', $trigger_obj); + if(!$output->toBool()) return $output; + + // DB에서 삭제 + $output = executeQuery('file.deleteFile', $args); + if(!$output->toBool()) return $output; + + // trigger 호출 (after) + $trigger_output = ModuleHandler::triggerCall('file.deleteFile', 'after', $trigger_obj); + if(!$trigger_output->toBool()) return $trigger_output; + + // 삭제 성공하면 파일 삭제 + FileHandler::removeFile($uploaded_filename); + } + + return $output; + } + + /** + * @brief 특정 문서의 첨부파일을 모두 삭제 + **/ + function deleteFiles($upload_target_srl) { + // 첨부파일 목록을 받음 + $oFileModel = &getModel('file'); + $file_list = $oFileModel->getFiles($upload_target_srl); + + // 첨부파일이 없으면 성공 return + if(!is_array($file_list)||!count($file_list)) return new Object(); + + // DB에서 삭제 + $args->upload_target_srl = $upload_target_srl; + $output = executeQuery('file.deleteFiles', $args); + if(!$output->toBool()) return $output; + + // 실제 파일 삭제 + $path = array(); + $file_count = count($file_list); + for($i=0;$i<$file_count;$i++) { + $uploaded_filename = $file_list[$i]->uploaded_filename; + FileHandler::removeFile($uploaded_filename); + $module_srl = $file_list[$i]->module_srl; + + $path_info = pathinfo($uploaded_filename); + if(!in_array($path_info['dirname'], $path)) $path[] = $path_info['dirname']; + } + + // 해당 글의 첨부파일 디렉토리 삭제 + for($i=0;$igetFiles($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} - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Total {number_format($total_count)}, Page {number_format($page)}/{number_format($total_page)}
{$lang->no}
{$lang->title}
{$lang->regdate}
 
{$no}{$val->title}{zdate($val->regdate,"Y-m-d")}{$lang->cmd_setup}{$lang->cmd_delete}
+ {$lang->cmd_make} +
+ + + +>>>>>>> .merge-right.r9269 diff --git a/modules/menu/tpl/menu_item_info.html b/modules/menu/tpl/menu_item_info.html index b23b95a7d..4e3f52b1b 100644 --- a/modules/menu/tpl/menu_item_info.html +++ b/modules/menu/tpl/menu_item_info.html @@ -22,14 +22,14 @@
{$lang->menu_name}
- + {$lang->cmd_find_langcode}
{$lang->menu_url}
- + {$lang->cmd_search_mid}

{$lang->about_menu_url}

diff --git a/modules/menu/tpl/menu_management.html b/modules/menu/tpl/menu_management.html index 38c4da962..47d5a909c 100644 --- a/modules/menu/tpl/menu_management.html +++ b/modules/menu/tpl/menu_management.html @@ -27,7 +27,7 @@
{$lang->title}
- +
diff --git a/modules/menu/tpl/mid_list.html b/modules/menu/tpl/mid_list.html index a74053c92..d61b6c3b1 100644 --- a/modules/menu/tpl/mid_list.html +++ b/modules/menu/tpl/mid_list.html @@ -33,6 +33,7 @@ + diff --git a/modules/message/message.admin.view.php b/modules/message/message.admin.view.php index 4797e8699..dd2594445 100644 --- a/modules/message/message.admin.view.php +++ b/modules/message/message.admin.view.php @@ -1,3 +1,4 @@ +<<<<<<< .working +======= +getskins($this->module_path); + Context::set('skin_list', $skin_list); + + // 설정 정보를 받아옴 (module model 객체를 이용) + $config = $oModuleModel->getModuleConfig('message'); + Context::set('config',$config); + + // 템플릿 파일 지정 + $this->setTemplatePath($this->module_path.'tpl'); + + //Security + $security = new Security(); + $security->encodeHTML('skin_list..title'); + + $this->setTemplateFile('config'); + } + + } +?> +>>>>>>> .merge-right.r9269 diff --git a/modules/module/module.admin.controller.php b/modules/module/module.admin.controller.php index 84e0a6f77..c2fd38860 100644 --- a/modules/module/module.admin.controller.php +++ b/modules/module/module.admin.controller.php @@ -1,3 +1,4 @@ +<<<<<<< .working +======= +title = Context::get('title'); + $output = executeQuery('module.insertModuleCategory', $args); + if(!$output->toBool()) return $output; + + $this->setMessage("success_registed"); + } + + /** + * @brief 카테고리의 내용 수정 + **/ + function procModuleAdminUpdateCategory() { + $mode = Context::get('mode'); + + switch($mode) { + case 'delete' : + $output = $this->doDeleteModuleCategory(); + $msg_code = 'success_deleted'; + break; + case 'update' : + $output = $this->doUpdateModuleCategory(); + $msg_code = 'success_updated'; + break; + } + if(!$output->toBool()) return $output; + + $this->setMessage($msg_code); + } + + /** + * @brief 모듈 카테고리의 제목 변경 + **/ + function doUpdateModuleCategory() { + $args->title = Context::get('title'); + $args->module_category_srl = Context::get('module_category_srl'); + return executeQuery('module.updateModuleCategory', $args); + } + + /** + * @brief 모듈 카테고리 삭제 + **/ + function doDeleteModuleCategory() { + $args->module_category_srl = Context::get('module_category_srl'); + return executeQuery('module.deleteModuleCategory', $args); + } + + /** + * @brief 모듈 복사 + **/ + function procModuleAdminCopyModule() { + // 복사하려는 대상 모듈의 정보를 구함 + $module_srl = Context::get('module_srl'); + if(!$module_srl) return; + + // 새로 생성하려는 모듈들의 이름/브라우저 제목을 구함 + $clones = array(); + $args = Context::getAll(); + for($i=1;$i<=10;$i++) { + $mid = trim($args->{"mid_".$i}); + if(!$mid) continue; + if(!preg_match("/^[a-zA-Z]([a-zA-Z0-9_]*)$/i", $mid)) return new Object(-1, 'msg_limit_mid'); + $browser_title = $args->{"browser_title_".$i}; + if(!$mid) continue; + if($mid && !$browser_title) $browser_title = $mid; + $clones[$mid] = $browser_title; + } + if(!count($clones)) return; + + $oModuleModel = &getModel('module'); + $oModuleController = &getController('module'); + + // 모듈 정보 가져옴 + $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl); + + // 권한 정보 가져옴 + $module_args->module_srl = $module_srl; + $output = executeQueryArray('module.getModuleGrants', $module_args); + $grant = array(); + if($output->data) { + foreach($output->data as $key => $val) $grant[$val->name][] = $val->group_srl; + } + + + $oDB = &DB::getInstance(); + $oDB->begin(); + + // 모듈 복사 + foreach($clones as $mid => $browser_title) { + $clone_args = null; + $clone_args = clone($module_info); + $clone_args->module_srl = null; + $clone_args->content = null; + $clone_args->mid = $mid; + $clone_args->browser_title = $browser_title; + $clone_args->is_default = 'N'; + + // 모듈 생성 + $output = $oModuleController->insertModule($clone_args); + $module_srl = $output->get('module_srl'); + + // 권한 정보 등록 + if(count($grant)) $oModuleController->insertModuleGrants($module_srl, $grant); + } + + $oDB->commit(); + $this->setMessage('success_registed'); + } + + /** + * @brief 모듈 권한 저장 + **/ + function procModuleAdminInsertGrant() { + $oModuleController = &getController('module'); + $oModuleModel = &getModel('module'); + + // 모듈 번호 구함 + $module_srl = Context::get('module_srl'); + + // 해당 모듈의 정보를 구함 + $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl); + if(!$module_info) return new Object(-1,'msg_invalid_request'); + + // 관리자 아이디 등록 + $oModuleController->deleteAdminId($module_srl); + $admin_member = Context::get('admin_member'); + if($admin_member) { + $admin_members = explode(',',$admin_member); + for($i=0;$iinsertAdminId($module_srl, $admin_id); + + } + } + + // 권한 정리 + $xml_info = $oModuleModel->getModuleActionXML($module_info->module); + + $grant_list = $xml_info->grant; + + $grant_list->access->default = 'guest'; + $grant_list->manager->default = 'manager'; + + foreach($grant_list as $grant_name => $grant_info) { + // default값을 구함 + $default = Context::get($grant_name.'_default'); + + // -1 = 로그인 사용자만, -2 = 사이트 가입자만, 0 = 모든 사용자 + if(strlen($default)){ + $grant->{$grant_name}[] = $default; + continue; + + // 특정 그룹 사용자 + } else { + $group_srls = Context::get($grant_name); + if($group_srls) { + if(strpos($group_srls,'|@|')!==false) $group_srls = explode('|@|',$group_srls); + elseif(strpos($group_srls,',')!==false) $group_srls = explode(',',$group_srls); + else $group_srls = array($group_srls); + $grant->{$grant_name} = $group_srls; + } + continue; + } + $grant->{$group_srls} = array(); + } + + // DB에 저장 + $args->module_srl = $module_srl; + $output = executeQuery('module.deleteModuleGrants', $args); + if(!$output->toBool()) return $output; + + // DB에 권한 저장 + if ($grant){ + foreach($grant as $grant_name => $group_srls) { + foreach($group_srls as $key => $val) { + $args = null; + $args->module_srl = $module_srl; + $args->name = $grant_name; + $args->group_srl = $val; + $output = executeQuery('module.insertModuleGrant', $args); + if(!$output->toBool()) return $output; + } + } + } + $this->setMessage('success_registed'); + } + + /** + * @brief 스킨 정보 업데이트 + **/ + function procModuleAdminUpdateSkinInfo() { + // module_srl에 해당하는 정보들을 가져오기 + $module_srl = Context::get('module_srl'); + + $oModuleModel = &getModel('module'); + $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl); + if($module_info->module_srl) { + $skin = $module_info->skin; + + // 스킨의 정보를 구해옴 (extra_vars를 체크하기 위해서) + $module_path = './modules/'.$module_info->module; + $skin_info = $oModuleModel->loadSkinInfo($module_path, $skin); + $skin_vars = $oModuleModel->getModuleSkinVars($module_srl); + // 입력받은 변수들을 체크 (mo, act, module_srl, page등 기본적인 변수들 없앰) + $obj = Context::getRequestVars(); + unset($obj->act); + unset($obj->module_srl); + unset($obj->page); + unset($obj->mid); + unset($obj->module); + + // 원 skin_info에서 extra_vars의 type이 image일 경우 별도 처리를 해줌 + if($skin_info->extra_vars) { + foreach($skin_info->extra_vars as $vars) { + if($vars->type!='image') continue; + + $image_obj = $obj->{$vars->name}; + + // 삭제 요청에 대한 변수를 구함 + $del_var = $obj->{"del_".$vars->name}; + unset($obj->{"del_".$vars->name}); + if($del_var == 'Y') { + FileHandler::removeFile($skin_vars[$vars->name]->value); + continue; + } + + // 업로드 되지 않았다면 이전 데이터를 그대로 사용 + if(!$image_obj['tmp_name']) { + $obj->{$vars->name} = $skin_vars[$vars->name]->value; + continue; + } + + // 정상적으로 업로드된 파일이 아니면 무시 + if(!is_uploaded_file($image_obj['tmp_name'])) { + unset($obj->{$vars->name}); + continue; + } + + // 이미지 파일이 아니어도 무시 + if(!preg_match("/\.(jpg|jpeg|gif|png)$/i", $image_obj['name'])) { + unset($obj->{$vars->name}); + continue; + } + + // 경로를 정해서 업로드 + $path = sprintf("./files/attach/images/%s/", $module_srl); + + // 디렉토리 생성 + if(!FileHandler::makeDir($path)) return false; + + $filename = $path.$image_obj['name']; + + // 파일 이동 + if(!move_uploaded_file($image_obj['tmp_name'], $filename)) { + unset($obj->{$vars->name}); + continue; + } + + // 정상 파일 업로드 + FileHandler::removeFile($skin_vars[$vars->name]->value); + // 변수를 바꿈 + unset($obj->{$vars->name}); + $obj->{$vars->name} = $filename; + } + } + // 해당 모듈의 전체 스킨 불러와서 이미지는 제거 + /* + if($skin_info->extra_vars) { + foreach($skin_info->extra_vars as $vars) { + if($vars->type!='image') continue; + $value = $skin_vars[$vars->name]; + if(file_exists($value)) @unlink($value); + } + } + */ + $oModuleController = &getController('module'); + $oModuleController->deleteModuleSkinVars($module_srl); + + // 등록 + $oModuleController->insertModuleSkinVars($module_srl, $obj); + } + + $this->setLayoutPath('./common/tpl'); + $this->setLayoutFile('default_layout.html'); + $this->setTemplatePath('./modules/module/tpl'); + $this->setTemplateFile("top_refresh.html"); + } + + /** + * @brief 모듈 일괄 정리 + **/ + function procModuleAdminModuleSetup() { + $vars = Context::getRequestVars(); + + if(!$vars->module_srls) return new Object(-1,'msg_invalid_request'); + + $module_srls = explode(',',$vars->module_srls); + if(!count($module_srls)) return new Object(-1,'msg_invalid_request'); + + $oModuleModel = &getModel('module'); + $oModuleController= &getController('module'); + foreach($module_srls as $module_srl) { + $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl); + $module_info->module_category_srl = $vars->module_category_srl; + $module_info->layout_srl = $vars->layout_srl; + $module_info->skin = $vars->skin; + $module_info->description = $vars->description; + $module_info->header_text = $vars->header_text; + $module_info->footer_text = $vars->footer_text; + $oModuleController->updateModule($module_info); + } + + $this->setMessage('success_registed'); + } + + /** + * @brief 모듈 권한 일괄 정리 + **/ + function procModuleAdminModuleGrantSetup() { + $module_srls = Context::get('module_srls'); + if(!$module_srls) return new Object(-1,'msg_invalid_request'); + + $modules = explode(',',$module_srls); + if(!count($modules)) return new Object(-1,'msg_invalid_request'); + + $oModuleController = &getController('module'); + $oModuleModel = &getModel('module'); + + $module_info = $oModuleModel->getModuleInfoByModuleSrl($modules[0]); + $xml_info = $oModuleModel->getModuleActionXml($module_info->module); + $grant_list = $xml_info->grant; + + $grant_list->access->default = 'guest'; + $grant_list->manager->default = 'manager'; + + foreach($grant_list as $grant_name => $grant_info) { + // default값을 구함 + $default = Context::get($grant_name.'_default'); + + // -1 = 로그인 사용자만, 0 = 모든 사용자 + if(strlen($default)){ + $grant->{$grant_name}[] = $default; + continue; + + // 특정 그룹 사용자 + } else { + $group_srls = Context::get($grant_name); + if($group_srls) { + if(strpos($group_srls,'|@|')!==false) $group_srls = explode('|@|',$group_srls); + elseif(strpos($group_srls,',')!==false) $group_srls = explode(',',$group_srls); + else $group_srls = array($group_srls); + $grant->{$grant_name} = $group_srls; + } + continue; + } + $grant->{$group_srls} = array(); + } + + + // DB에 저장 + foreach($modules as $module_srl) { + $args = null; + $args->module_srl = $module_srl; + $output = executeQuery('module.deleteModuleGrants', $args); + if(!$output->toBool()) continue; + + // DB에 권한 저장 + foreach($grant as $grant_name => $group_srls) { + foreach($group_srls as $key => $val) { + $args = null; + $args->module_srl = $module_srl; + $args->name = $grant_name; + $args->group_srl = $val; + $output = executeQuery('module.insertModuleGrant', $args); + if(!$output->toBool()) return $output; + } + } + } + $this->setMessage('success_registed'); + } + + /** + * @brief 언어 추가/ 업데이트 + **/ + function procModuleAdminInsertLang() { + // 언어코드명 가져옴 + $site_module_info = Context::get('site_module_info'); + $args->site_srl = (int)$site_module_info->site_srl; + $args->name = str_replace(' ','_',Context::get('lang_code')); + if(!$args->name) return new Object(-1,'msg_invalid_request'); + + // 언어코드가 있는지 조사 + $output = executeQueryArray('module.getLang', $args); + if(!$output->toBool()) return $output; + + // 있으면 업데이트를 위해 기존 값들을 지움 + if($output->data) $output = executeQuery('module.deleteLang', $args); + if(!$output->toBool()) return $output; + + // 입력 + $lang_supported = Context::get('lang_supported'); + foreach($lang_supported as $key => $val) { + $args->lang_code = $key; + $args->value = trim(Context::get($key)); + if(!$args->value) { + $args->value = Context::get(strtolower($key)); + if(!$args->value) $args->value = $args->name; + } + $output = executeQuery('module.insertLang', $args); + if(!$output->toBool()) return $output; + } + $this->makeCacheDefinedLangCode($args->site_srl); + + $this->add('name', $args->name); + } + + /** + * @brief 언어 제거 + **/ + function procModuleAdminDeleteLang() { + // 언어코드명 가져옴 + $site_module_info = Context::get('site_module_info'); + $args->site_srl = (int)$site_module_info->site_srl; + $args->name = str_replace(' ','_',Context::get('name')); + if(!$args->name) return new Object(-1,'msg_invalid_request'); + + $output = executeQuery('module.deleteLang', $args); + if(!$output->toBool()) return $output; + $this->makeCacheDefinedLangCode($args->site_srl); + } + + /** + * @brief 사용자 정이 언어코드 파일 저장 + **/ + function makeCacheDefinedLangCode($site_srl = 0) { + // 현재 사이트의 언어파일 가져오기 + if(!$site_srl) { + $site_module_info = Context::get('site_module_info'); + $args->site_srl = (int)$site_module_info->site_srl; + } else { + $args->site_srl = $site_srl; + } + $output = executeQueryArray('module.getLang', $args); + if(!$output->toBool() || !$output->data) return; + + // 캐시 디렉토리 설정 + $cache_path = _XE_PATH_.'files/cache/lang_defined/'; + if(!is_dir($cache_path)) FileHandler::makeDir($cache_path); + + $lang_supported = Context::get('lang_supported'); + foreach($lang_supported as $key => $val) { + $fp[$key] = fopen( sprintf('%s/%d.%s.php', $cache_path, $args->site_srl, $key), 'w' ); + if(!$fp[$key]) return; + fwrite($fp[$key],"data as $key => $val) { + if($fp[$val->lang_code]) fwrite($fp[$val->lang_code], sprintf('$lang["%s"] = "%s";'."\r\n", $val->name, str_replace('"','\\"',$val->value))); + } + + foreach($lang_supported as $key => $val) { + if(!$fp[$key]) continue; + fwrite($fp[$key],"?>"); + fclose($fp[$key]); + } + } + + } +?> +>>>>>>> .merge-right.r9269 diff --git a/modules/module/module.admin.model.php b/modules/module/module.admin.model.php index c364e9d5f..f589a7b92 100644 --- a/modules/module/module.admin.model.php +++ b/modules/module/module.admin.model.php @@ -96,7 +96,13 @@ $oMemberModel = &getModel('member'); $group_list = $oMemberModel->getGroups($module_info->site_srl); Context::set('group_list', $group_list); - // Get information of module_grants + + //Security + $security = new Security(); + $security->encodeHTML('group_list..title'); + $security->encodeHTML('group_list..description'); + + // Get information of module_grants $oTemplate = &TemplateHandler::getInstance(); return $oTemplate->compile($this->module_path.'tpl', 'module_grants'); } @@ -132,7 +138,13 @@ Context::set('module_info', $module_info); Context::set('mid', $module_info->mid); Context::set('skin_info', $skin_info); - Context::set('skin_vars', $skin_vars); + Context::set('skin_vars', $skin_vars); + + //Security + $security = new Security(); + $security->encodeHTML('mid'); + $security->encodeHTML('module_info.browser_title'); + $security->encodeHTML('skin_info...'); $oTemplate = &TemplateHandler::getInstance(); return $oTemplate->compile($this->module_path.'tpl', 'skin_config'); diff --git a/modules/module/module.admin.view.php b/modules/module/module.admin.view.php index 410eace80..8901126d8 100644 --- a/modules/module/module.admin.view.php +++ b/modules/module/module.admin.view.php @@ -62,6 +62,10 @@ Context::set('favoriteModuleList', $favoriteModuleList); Context::set('module_list', $module_list); + + $security = new Security(); + $security->encodeHTML('module_list....'); + // Set a template file $this->setTemplateFile('module_list'); @@ -75,7 +79,11 @@ $oModuleModel = &getModel('module'); $module_info = $oModuleModel->getModuleInfoXml(Context::get('selected_module')); Context::set('module_info', $module_info); - // Set the layout to be pop-up + + $security = new Security(); + $security->encodeHTML('module_info...'); + + // Set the layout to be pop-up $this->setLayoutFile('popup_layout'); // Set a template file $this->setTemplateFile('module_info'); @@ -90,16 +98,27 @@ // Obtain a list of modules $oModuleModel = &getModel('module'); // Display the category page if a category is selected + //Security + $security = new Security(); + if($module_category_srl) { $selected_category = $oModuleModel->getModuleCategory($module_category_srl); Context::set('selected_category', $selected_category); - // Set a template file + + //Security + $security->encodeHTML('selected_category.title'); + + // Set a template file $this->setTemplateFile('category_update_form'); // If not selected, display a list of categories } else { $category_list = $oModuleModel->getModuleCategories(); Context::set('category_list', $category_list); - // Set a template file + + //Security + $security->encodeHTML('category_list..title'); + + // Set a template file $this->setTemplateFile('category_list'); } } @@ -143,7 +162,13 @@ // Get a list of module categories $module_category = $oModuleModel->getModuleCategories(); Context::set('module_category', $module_category); - // Set the layout to be pop-up + + $security = new Security(); + $security->encodeHTML('layout_list..title','layout_list..layout'); + $security->encodeHTML('skin_list....'); + $security->encodeHTML('module_category...') + + // Set the layout to be pop-up $this->setLayoutFile('popup_layout'); // Set a template file $this->setTemplateFile('module_setup'); @@ -201,7 +226,10 @@ $oMemberModel = &getModel('member'); $group_list = $oMemberModel->getGroups($module_info->site_srl); Context::set('group_list', $group_list); - // Set the layout to be pop-up + $security = new Security(); + $security->encodeHTML('group_list..title'); + + // Set the layout to be pop-up $this->setLayoutFile('popup_layout'); // Set a template file $this->setTemplateFile('module_grant_setup'); diff --git a/modules/module/tpl/skin_config.html b/modules/module/tpl/skin_config.html index bdaaded02..8506ff858 100644 --- a/modules/module/tpl/skin_config.html +++ b/modules/module/tpl/skin_config.html @@ -84,11 +84,11 @@
{$val->title}
- + {$lang->cmd_find_langcode} - + {$lang->cmd_find_langcode} diff --git a/modules/opage/opage.admin.view.php b/modules/opage/opage.admin.view.php index 51a4bc7de..2448f2620 100644 --- a/modules/opage/opage.admin.view.php +++ b/modules/opage/opage.admin.view.php @@ -22,7 +22,11 @@ // Get a list of module categories $module_category = $oModuleModel->getModuleCategories(); Context::set('module_category', $module_category); - // Get a template path (admin templates are collected on the tpl for opage) + //Security + $security = new Security(); + $security->encodeHTML('module_category..title'); + + // Get a template path (admin templates are collected on the tpl for opage) $this->setTemplatePath($this->module_path.'tpl'); } @@ -41,8 +45,12 @@ Context::set('total_page', $output->total_page); Context::set('page', $output->page); Context::set('opage_list', $output->data); - Context::set('page_navigation', $output->page_navigation); - // Set a template file + Context::set('page_navigation', $output->page_navigation); + //Security + $security = new Security(); + $security->encodeHTML('opage_list..'); + + // Set a template file $this->setTemplateFile('index'); } @@ -77,7 +85,21 @@ $mobile_layout_list = $oLayoutModel->getLayoutList(0,"M"); Context::set('mlayout_list', $mobile_layout_list); - // Set a template file + //Security + $security = new Security(); + $security->encodeHTML('module_info.'); + $security->encodeHTML('layout_list..layout'); + $security->encodeHTML('layout_list..title'); + $security->encodeHTML('mlayout_list..layout'); + $security->encodeHTML('mlayout_list..title'); + //group_list 및 grant는 사용되는 곳을 모르겠음. + /* + $security->encodeHTML('group_list..title'); + $security->encodeHTML('group_list..description'); + $security->encodeHTML('grant_list..'); + */ + + // Set a template file $this->setTemplateFile('opage_insert'); } @@ -93,7 +115,13 @@ $columnList = array('module_srl', 'mid', 'module'); $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList); Context::set('module_info',$module_info); - // Set a template file + //Security + $security = new Security(); + $security->encodeHTML('module_info.module'); + $security->encodeHTML('module_info.mid'); + $security->encodeHTML('module_info.browser_title'); + + // Set a template file $this->setTemplateFile('opage_delete'); } @@ -121,6 +149,10 @@ $grant_content = $oModuleAdminModel->getModuleGrantHTML($this->module_info->module_srl, $this->xml_info->grant); Context::set('grant_content', $grant_content); + //Security + $security = new Security(); + $security->encodeHTML('module_info..'); + $this->setTemplateFile('grant_list'); } } diff --git a/modules/opage/opage.view.php b/modules/opage/opage.view.php index 3bf4f9ac3..25b94c93a 100644 --- a/modules/opage/opage.view.php +++ b/modules/opage/opage.view.php @@ -1,3 +1,4 @@ +<<<<<<< .working +======= +setTemplatePath($this->module_path.'tpl'); + + // 외부 페이지 모듈의 정보를 구함 + $oOpageModel = &getModel('opage'); + $module_info = $oOpageModel->getOpage($this->module_srl); + Context::set('module_info', $module_info); + + // 외부 페이지에서 명시된 외부 페이지 경로/ 캐싱 간격을 를 구함 + $this->path = $module_info->path; + $this->caching_interval = $module_info->caching_interval; + + // 캐시 파일 지정 + $this->cache_file = sprintf("./files/cache/opage/%d.cache.php", $module_info->module_srl); + } + + /** + * @brief 일반 요청시 출력 + **/ + function dispOpageIndex() { + + // http 인지 내부 파일인지 점검 + if($this->path) { + if(preg_match("/^([a-z]+):\/\//i",$this->path)) $content = $this->getHtmlPage($this->path, $this->caching_interval, $this->cache_file); + else $content = $this->executeFile($this->path, $this->caching_interval, $this->cache_file); + } + + Context::set('opage_content', $content); + + // 결과 출력 템플릿 지정 + $this->setTemplateFile('content'); + } + + /** + * @brief 외부 http로 요청되는 파일일 경우 파일을 받아와서 저장 후 return + **/ + function getHtmlPage($path, $caching_interval, $cache_file) { + + // 캐시 검사 + if($caching_interval > 0 && file_exists($cache_file) && filemtime($cache_file) + $caching_interval*60 > time()) { + + $content = FileHandler::readFile($cache_file); + + } else { + + FileHandler::getRemoteFile($path, $cache_file); + $content = FileHandler::readFile($cache_file); + + } + + // opage controller 생성 + $oOpageController = &getController('opage'); + + // 외부 서버의 페이지 일 경우 이미지, css, javascript등의 url을 변경 + $content = $oOpageController->replaceSrc($content, $path); + + // 해당 문서를 utf-8로 변경 + $buff->content = $content; + $buff = Context::convertEncoding($buff); + $content = $buff->content; + + // title 추출 + $title = $oOpageController->getTitle($content); + if($title) Context::setBrowserTitle($title); + + // header script 추출 + $head_script = $oOpageController->getHeadScript($content); + if($head_script) Context::addHtmlHeader($head_script); + + // body 내용 추출 + $body_script = $oOpageController->getBodyScript($content); + if(!$body_script) $body_script = $content; + + return $content; + } + + /** + * @brief 내부 파일일 경우 include하도록 캐시파일을 만들고 처리 + **/ + function executeFile($path, $caching_interval, $cache_file) { + // 파일이 없으면 취소 + if(!file_exists($path)) return; + + // 경로와 파일이름을 구함 + $tmp_path = explode('/',$cache_file); + $filename = $tmp_path[count($tmp_path)-1]; + $filepath = preg_replace('/'.$filename."$/i","",$cache_file); + + // 캐시 검사 + if($caching_interval <1 || !file_exists($cache_file) || filemtime($cache_file) + $caching_interval*60 <= time() || filemtime($cache_file)path = str_replace('\\', '/', realpath($path_info['dirname'])).'/'; + $content = preg_replace_callback('/(src=|href=|url\()("|\')?([^"\'\)]+)("|\'\))?/is',array($this,'_replacePath'),$content); + $content = preg_replace_callback('/(]+target=)(")([^"]+)(")/is',array($this,'_replacePath'),$content); + $content = preg_replace_callback('/( @@ -83,3 +84,90 @@ {$lang->last_page}
+======= + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Total {number_format($total_count)}, page {number_format($page)}/{number_format($total_page)}
{$lang->no}
+
+ + + + +
+
{$lang->mid}
{$lang->browser_title}
{$lang->regdate}
 
{$no} + + {$lang->not_exists} + + {$module_category[$val->module_category_srl]->title} + + {$val->mid}{$val->browser_title}{zdate($val->regdate,"Y-m-d")}{$lang->cmd_setup}{$lang->cmd_copy}{$lang->cmd_delete}
+ + + + +
+ + + +>>>>>>> .merge-right.r9269 diff --git a/modules/opage/tpl/opage_insert.html b/modules/opage/tpl/opage_insert.html index 1ac126c7a..5aab31f88 100644 --- a/modules/opage/tpl/opage_insert.html +++ b/modules/opage/tpl/opage_insert.html @@ -32,7 +32,7 @@
{$lang->browser_title}
- + {$lang->cmd_find_langcode}

{$lang->about_browser_title}

@@ -68,8 +68,6 @@

{$lang->about_layout}

- -
{$lang->opage_caching_interval}
@@ -80,14 +78,14 @@
{$lang->opage_path}
- +

{$lang->about_opage_path}{realpath("./")}

{$lang->opage_mobile_path}
- +

{$lang->about_opage_mobile_path}{realpath("./")}

diff --git a/modules/page/page.admin.view.php b/modules/page/page.admin.view.php index 4a44df879..e80860613 100644 --- a/modules/page/page.admin.view.php +++ b/modules/page/page.admin.view.php @@ -34,7 +34,11 @@ // Get a list of module categories $module_category = $oModuleModel->getModuleCategories(); Context::set('module_category', $module_category); - // Get a template path (page in the administrative template tpl putting together) + //Security + $security = new Security(); + $security->encodeHTML('module_category..title'); + + // Get a template path (page in the administrative template tpl putting together) $this->setTemplatePath($this->module_path.'tpl'); } @@ -66,7 +70,13 @@ Context::set('page', $output->page); Context::set('page_list', $output->data); Context::set('page_navigation', $output->page_navigation); - // Set a template file + //Security + $security = new Security(); + $security->encodeHTML('page_list..browser_title'); + $security->encodeHTML('page_list..mid'); + $security->encodeHTML('module_info.'); + + // Set a template file $this->setTemplateFile('index'); } @@ -76,7 +86,6 @@ function dispPageAdminInfo() { // Get module_srl by GET parameter $module_srl = Context::get('module_srl'); - $module_info = Context::get('module_info'); // If you do not value module_srl just showing the index page if(!$module_srl) return $this->dispPageAdminContent(); @@ -105,6 +114,14 @@ Context::set('mskin_list', $mskin_list); } + //Security + $security = new Security(); + $security->encodeHTML('layout_list..layout'); + $security->encodeHTML('layout_list..title'); + $security->encodeHTML('mlayout_list..layout'); + $security->encodeHTML('mlayout_list..title'); + $security->encodeHTML('module_info.'); + $this->setTemplateFile('page_info'); } @@ -121,6 +138,9 @@ Context::set('setup_content', $content); // Set a template file $this->setTemplateFile('addition_setup'); + + $security = new Security(); + $security->encodeHTML('module_info.'); } /** @@ -154,6 +174,14 @@ $mskin_list = $oModuleModel->getSkins($this->module_path, "m.skins"); Context::set('mskin_list', $mskin_list); + + //Security + $security = new Security(); + $security->encodeHTML('layout_list..layout'); + $security->encodeHTML('layout_list..title'); + $security->encodeHTML('mlayout_list..layout'); + $security->encodeHTML('mlayout_list..title'); + // Set a template file $this->setTemplateFile('page_insert'); } @@ -168,7 +196,7 @@ else $mtime = filemtime($cache_file); if($mtime + $interval*60 > time()) { - $page_content = FileHandler::readFile($cache_file); + $page_content = FileHandler::readFile($cache_file); } else { $oWidgetController = &getController('widget'); $page_content = $oWidgetController->transWidgetCode($this->module_info->mcontent); @@ -178,7 +206,7 @@ if(file_exists($cache_file)) FileHandler::removeFile($cache_file); $page_content = $this->module_info->mcontent; } - + Context::set('module_info', $this->module_info); Context::set('page_content', $page_content); @@ -199,7 +227,12 @@ $oWidgetModel = &getModel('widget'); $widget_list = $oWidgetModel->getDownloadedWidgetList(); Context::set('widget_list', $widget_list); - // Set a template file + + //Security + $security = new Security(); + $security->encodeHTML('widget_list..title','module_info.mid'); + + // Set a template file $this->setTemplateFile('page_mobile_content_modify'); } @@ -231,6 +264,14 @@ $this->setTemplateFile('page_content_modify'); } + //Security + $security = new Security(); + $security->encodeHTML('widget_list..title','module_info.mid'); + + // 템플릿 파일 지정 + $this->setTemplateFile('page_content_modify'); + } + function _setArticleTypeContentModify() { $oDocumentModel = &getModel('document'); $oDocument = $oDocumentModel->getDocument(0, true); @@ -259,6 +300,9 @@ Context::set('module_info',$module_info); // Set a template file $this->setTemplateFile('page_delete'); + + $security = new Security(); + $security->encodeHTML('module_info.'); } /** @@ -271,6 +315,9 @@ Context::set('grant_content', $grant_content); $this->setTemplateFile('grant_list'); + + $security = new Security(); + $security->encodeHTML('module_info.'); } } ?> diff --git a/modules/page/tpl/index.html b/modules/page/tpl/index.html index 716e4600c..e33420891 100644 --- a/modules/page/tpl/index.html +++ b/modules/page/tpl/index.html @@ -9,8 +9,8 @@
- {$lang->mid} - {$lang->browser_title} + {$lang->mid} + {$lang->browser_title} {$lang->cmd_cancel}
@@ -65,7 +65,7 @@ {$val->page_type} - {htmlspecialchars($val->mid)} + {$val->mid} {$val->browser_title} {zdate($val->regdate,"Y-m-d")} {$lang->cmd_setup} diff --git a/modules/page/tpl/page_info.html b/modules/page/tpl/page_info.html index 86c82b628..8c7fc459c 100644 --- a/modules/page/tpl/page_info.html +++ b/modules/page/tpl/page_info.html @@ -37,7 +37,7 @@
{$lang->browser_title}
- + {$lang->cmd_find_langcode}

{$lang->about_browser_title}

diff --git a/modules/page/tpl/page_insert.html b/modules/page/tpl/page_insert.html index 7e7877b11..71f9da062 100644 --- a/modules/page/tpl/page_insert.html +++ b/modules/page/tpl/page_insert.html @@ -54,7 +54,7 @@
{$lang->browser_title}
- + {$lang->cmd_find_langcode}

{$lang->about_browser_title}

diff --git a/modules/point/point.admin.view.php b/modules/point/point.admin.view.php index da6de08df..db6d252f5 100644 --- a/modules/point/point.admin.view.php +++ b/modules/point/point.admin.view.php @@ -15,8 +15,14 @@ $oModuleModel = &getModel('module'); $config = $oModuleModel->getModuleConfig('point'); // Set the configuration variable - Context::set('config', $config); - // Set the template path + Context::set('config', $config); + + //Security + $security = new Security(); + $security->encodeHTML('config.point_name','config.level_icon'); + $security->encodeHTML('module_info..'); + + // Set the template path $this->setTemplatePath($this->module_path.'tpl'); } @@ -36,9 +42,13 @@ if($val->is_admin == 'Y' || $val->is_default == 'Y') continue; $selected_group_list[$key] = $val; } - } + } Context::set('group_list', $selected_group_list); - // Set the template + //Security + $security = new Security(); + $security->encodeHTML('group_list..title','group_list..description'); + + // Set the template $this->setTemplateFile('config'); } @@ -53,7 +63,11 @@ Context::set('mid_list', $mid_list); Context::set('module_config', $oModuleModel->getModulePartConfigs('point')); - // Set the template + //Security + $security = new Security(); + $security->encodeHTML('mid_list..browser_title','mid_list..mid'); + + // Set the template $this->setTemplateFile('module_config'); } @@ -87,7 +101,12 @@ // Get a list of groups $this->group_list = $oMemberModel->getGroups(); Context::set('group_list', $this->group_list); - // Set the template + //Security + $security = new Security(); + $security->encodeHTML('group_list..title','group_list..description'); + $security->encodeHTML('member_list..'); + + // Set the template $this->setTemplateFile('member_list'); } } diff --git a/modules/point/tpl/member_list.html b/modules/point/tpl/member_list.html index 20dab82d2..1554edbf6 100644 --- a/modules/point/tpl/member_list.html +++ b/modules/point/tpl/member_list.html @@ -1,3 +1,4 @@ +<<<<<<< .working @@ -90,3 +91,96 @@ {$lang->cmd_cancel} +======= + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Total {number_format($total_count)}, Page {number_format($page)}/{number_format($total_page)}
{$lang->no}
{$lang->user_id}
{$lang->user_name}
{$lang->nick_name}
{$lang->point}
{$lang->level}
{$no}{$val->user_id}{$val->user_name}{$val->nick_name} +
+ + + + + + +
+
{$val->level}
+ +
+ + + +
+ + + + + + +
+ + + +
+ + + + + + + + {$lang->cmd_cancel} +
+
+>>>>>>> .merge-right.r9269 diff --git a/modules/poll/poll.admin.view.php b/modules/poll/poll.admin.view.php index b2217aa3a..a79ad5ffa 100644 --- a/modules/poll/poll.admin.view.php +++ b/modules/poll/poll.admin.view.php @@ -1,3 +1,4 @@ +<<<<<<< .working +======= +s_title= $search_keyword; + break; + case 'regdate' : + $args->s_regdate = $search_keyword; + break; + case 'ipaddress' : + $args->s_ipaddress= $search_keyword; + break; + } + } + // 목록을 구하기 위한 옵션 + $args->page = Context::get('page'); ///< 페이지 + $args->list_count = 50; ///< 한페이지에 보여줄 글 수 + $args->page_count = 10; ///< 페이지 네비게이션에 나타날 페이지의 수 + + $args->sort_index = 'list_order'; ///< 소팅 값 + + // 목록 구함 + $oPollAdminModel = &getAdminModel('poll'); + $output = $oPollAdminModel->getPollList($args); + + // 템플릿 변수 설정 + Context::set('total_count', $output->total_count); + Context::set('total_page', $output->total_page); + Context::set('page', $output->page); + Context::set('poll_list', $output->data); + Context::set('page_navigation', $output->page_navigation); + Context::set('module_list', $module_list); + + $security = new Security(); + $security->encodeHTML('poll_list..title'); + + // 템플릿 지정 + $this->setTemplatePath($this->module_path.'tpl'); + $this->setTemplateFile('poll_list'); + } + + /** + * @brief 설문조사 스킨, 컬러셋 설정 + **/ + function dispPollAdminConfig() { + $oModuleModel = &getModel('module'); + + // 설정 정보 가져오기 + $config = $oModuleModel->getModuleConfig('poll'); + Context::set('config', $config); + + // 스킨 정보 가져오기 + $skin_list = $oModuleModel->getSkins($this->module_path); + Context::set('skin_list', $skin_list); + + if(!$skin_list[$config->skin]) $config->skin = "default"; + + // 설정된 스킨의 컬러셋 설정 + Context::set('colorset_list', $skin_list[$config->skin]->colorset); + + $security = new Security(); + $security->encodeHTML('config..'); + $security->encodeHTML('skin_list..title'); + $security->encodeHTML('colorset_list..name','colorset_list..title'); + + // 템플릿 지정 + $this->setTemplatePath($this->module_path.'tpl'); + $this->setTemplateFile('config'); + } + + /** + * @brief 설문조사 결과 + **/ + function dispPollAdminResult() { + // 팝업 레이아웃 + $this->setLayoutFile("popup_layout"); + + // 결과 뽑기 + $args->poll_srl = Context::get('poll_srl'); + $args->poll_index_srl = Context::get('poll_index_srl'); + + $output = executeQuery('poll.getPoll', $args); + if(!$output->data) return $this->stop('msg_poll_not_exists'); + $poll->stop_date = $output->data->stop_date; + $poll->poll_count = $output->data->poll_count; + + $output = executeQuery('poll.getPollTitle', $args); + if(!$output->data) return $this->stop('msg_poll_not_exists'); + + $poll->poll[$args->poll_index_srl]->title = $output->data->title; + $poll->poll[$args->poll_index_srl]->checkcount = $output->data->checkcount; + $poll->poll[$args->poll_index_srl]->poll_count = $output->data->poll_count; + + $output = executeQuery('poll.getPollItem', $args); + foreach($output->data as $key => $val) { + $poll->poll[$val->poll_index_srl]->item[] = $val; + } + + $poll->poll_srl = $poll_srl; + + Context::set('poll',$poll); + + // 기본 설정의 스킨, 컬러셋 설정 + $oModuleModel = &getModel('module'); + $poll_config = $oModuleModel->getModuleConfig('poll'); + Context::set('poll_config', $poll_config); + + $this->setTemplatePath($this->module_path.'tpl'); + $this->setTemplateFile('result'); + } + } +?> +>>>>>>> .merge-right.r9269 diff --git a/modules/poll/tpl/config.html b/modules/poll/tpl/config.html index 11ae37bba..4c27a2b49 100644 --- a/modules/poll/tpl/config.html +++ b/modules/poll/tpl/config.html @@ -13,7 +13,7 @@ diff --git a/modules/poll/tpl/poll_list.html b/modules/poll/tpl/poll_list.html index 8956eb4a6..83f5ed214 100644 --- a/modules/poll/tpl/poll_list.html +++ b/modules/poll/tpl/poll_list.html @@ -37,7 +37,7 @@ xe.lang.msg_empty_search_keyword = '{$lang->msg_empty_search_keyword}'; - {htmlspecialchars($val->title)} + {$val->title} {$lang->single_check}{$lang->multi_check} {$val->poll_count} {$val->nick_name} diff --git a/modules/rss/rss.admin.view.php b/modules/rss/rss.admin.view.php index 694cb836a..e2a8b417c 100644 --- a/modules/rss/rss.admin.view.php +++ b/modules/rss/rss.admin.view.php @@ -44,8 +44,13 @@ Context::set('feed_config', $feed_config); Context::set('total_config', $total_config); + + $security = new Security(); + $security->encodeHTML('feed_config..mid','feed_config..url'); + $security->encodeHTML('total_config..'); + $this->setTemplatePath($this->module_path.'tpl'); $this->setTemplateFile('rss_admin_index'); } } -?> +?> \ No newline at end of file diff --git a/modules/rss/tpl/rss_admin_index.html b/modules/rss/tpl/rss_admin_index.html index 9f2bccb20..9622ce39e 100644 --- a/modules/rss/tpl/rss_admin_index.html +++ b/modules/rss/tpl/rss_admin_index.html @@ -91,4 +91,4 @@ - + \ No newline at end of file diff --git a/modules/spamfilter/spamfilter.admin.view.php b/modules/spamfilter/spamfilter.admin.view.php index 507724481..bcf427da7 100644 --- a/modules/spamfilter/spamfilter.admin.view.php +++ b/modules/spamfilter/spamfilter.admin.view.php @@ -32,7 +32,12 @@ Context::set('config',$config); Context::set('ip_list', $ip_list); Context::set('word_list', $word_list); - // Set a template file + + $security = new Security(); + $security->encodeHTML('word_list..word'); + $security->encodeHTML('ip_list..'); + + // Set a template file $this->setTemplateFile('index'); } } diff --git a/modules/syndication/syndication.admin.view.php b/modules/syndication/syndication.admin.view.php index 5c45b1400..02bbe760b 100644 --- a/modules/syndication/syndication.admin.view.php +++ b/modules/syndication/syndication.admin.view.php @@ -1,3 +1,4 @@ +<<<<<<< .working +======= +getModuleConfig('syndication'); + if(!$module_config->target_services) $module_config->target_services = array(); + + foreach($this->services as $key => $val) { + unset($obj); + $obj->service = $key; + $obj->ping = $val; + $obj->selected = in_array($key, $module_config->target_services)?true:false; + $services[] = $obj; + } + Context::set('services', $services); + + if(!$module_config->site_url) { + $module_config->site_url = Context::getDefaultUrl()?Context::getDefaultUrl():getFullUrl(); + } + Context::set('site_url', preg_replace('/^(http|https):\/\//i','',$module_config->site_url)); + + if(!$module_config->year) { + $module_config->year = date("Y"); + } + Context::set('year', $module_config->year); + + $output = executeQueryArray('syndication.getExceptModules'); + $except_module_list = array(); + for($i=0,$c=count($output->data);$i<$c;$i++) { + $except_module_list[] = $output->data[$i]; + } + Context::set('except_module', $except_module_list); + + //Security + $security = new Security(); + $security->encodeHTML('services..service','except_module..ping'); + $security->encodeHTML('except_module..mid','except_module..browser_title'); + + + $this->setTemplatePath($this->module_path.'tpl'); + $this->setTemplateFile('config'); + } + + } +?> +>>>>>>> .merge-right.r9269 diff --git a/modules/trackback/trackback.admin.view.php b/modules/trackback/trackback.admin.view.php index 1534890b3..276d74a9e 100644 --- a/modules/trackback/trackback.admin.view.php +++ b/modules/trackback/trackback.admin.view.php @@ -39,7 +39,12 @@ Context::set('page', $output->page); Context::set('trackback_list', $output->data); Context::set('page_navigation', $output->page_navigation); - // Set a template + //Security + $security = new Security(); + $security->encodeHTML('config.'); + $security->encodeHTML('trackback_list..'); + + // Set a template $this->setTemplatePath($this->module_path.'tpl'); $this->setTemplateFile('trackback_list'); } diff --git a/modules/widget/widget.admin.view.php b/modules/widget/widget.admin.view.php index a402b3db0..9091db130 100644 --- a/modules/widget/widget.admin.view.php +++ b/modules/widget/widget.admin.view.php @@ -34,6 +34,9 @@ Context::set('tCount', count($widget_list)); $this->setTemplateFile('downloaded_widget_list'); + + $security = new Security(); + $security->encodeHTML('widget_list..', 'widget_list..author..'); } function dispWidgetAdminGenerateCode() @@ -65,6 +68,9 @@ $editor = $oEditorModel->getModuleEditor('document',$module_srl, $module_srl,'module_srl','content'); Context::set('editor', $editor); + $security = new Security(); + $security->encodeHTML('member_config..'); + $this->setLayoutPath('./common/tpl'); $this->setLayoutFile("default_layout"); $this->setTemplateFile('add_content_widget');