fix merge error

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9276 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
flyskyko 2011-09-22 10:19:58 +00:00
parent c32beaf35e
commit d311ccc377
14 changed files with 59 additions and 2439 deletions

View file

@ -1,4 +1,3 @@
<<<<<<< .working
<?php
/**
* @class communicationAdminModel
@ -25,47 +24,6 @@
$skin_info = $oModuleModel->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);
$oTemplate = &TemplateHandler::getInstance();
$tpl = $oTemplate->compile($this->module_path.'tpl', 'colorset_list');
}
$this->add('tpl', $tpl);
}
}
?>
=======
<?php
/**
* @class communicationAdminModel
* @author NHN (developers@xpressengine.com)
* @brief communication module의 admin model class
**/
class communicationAdminModel extends communication {
/**
* @brief 초기화
**/
function init() {
}
/**
* @brief 지정된 스킨의 컬러셋 선택을 위한 html을 return
**/
function getCommunicationAdminColorset() {
$skin = Context::get('skin');
if(!$skin) $tpl = "";
else {
$oModuleModel = &getModel('module');
$skin_info = $oModuleModel->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";
@ -84,4 +42,3 @@
}
?>
>>>>>>> .merge-right.r9269

View file

@ -1,4 +1,3 @@
<<<<<<< .working
<?php
/**
* @class documentAdminView
@ -136,9 +135,8 @@
$aliases = $output->data;
}
Context::set('aliases', $aliases);
$this->setTemplatePath($this->module_path.'tpl');
$this->setTemplateFile('document_alias');
}
@ -170,163 +168,3 @@
}
}
?>
=======
<?php
/**
* @class documentAdminView
* @author NHN (developers@xpressengine.com)
* @brief document 모듈의 admin view 클래스
**/
class documentAdminView extends document {
/**
* @brief 초기화
**/
function init() {
}
/**
* @brief 목록 출력 (관리자용)
**/
function dispDocumentAdminList() {
// 목록을 구하기 위한 옵션
$args->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

View file

@ -1,4 +1,3 @@
<<<<<<< .working
<?php
/**
* @class fileController
@ -222,7 +221,7 @@
header("Content-Transfer-Encoding: binary\n");
// if file size is lager than 10MB, use fread function (#18675748)
if (filesize($uploaded_filename) > pow(1024, 10240)) {
if (filesize($uploaded_filename) > 1024 * 1024) {
while(!feof($fp)) echo fread($fp, 1024);
fclose($fp);
} else {
@ -253,7 +252,32 @@
if(!$_SESSION['upload_info'][$editor_sequence]->enabled) exit();
$upload_target_srl = $_SESSION['upload_info'][$editor_sequence]->upload_target_srl;
if($upload_target_srl && $file_srl) $output = $this->deleteFile($file_srl);
$logged_info = Context::get('logged_info');
$oFileModel = &getModel('file');
$srls = explode(',',$file_srl);
if(!count($srls)) return;
for($i=0;$i<count($srls);$i++) {
$srl = (int)$srls[$i];
if(!$srl) continue;
$args = null;
$args->file_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);
}
}
/**
@ -487,6 +511,9 @@
$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);
@ -617,654 +644,3 @@
}
}
?>
=======
<?php
/**
* @class fileController
* @author NHN (developers@xpressengine.com)
* @brief file 모듈의 controller 클래스
**/
class fileController extends file {
/**
* @brief 초기화
**/
function init() {
}
/**
* @brief 에디터에서 첨부파일 업로드
* editor_sequence, uploadTargetSrl 변수값을 받아서 이를 바탕으로 첨부 대상 srl을 결정함.
* 만약 uploadTargetSrl이 없다면 새로 생성하고 return 하여 UI에서 이에 대한 값을 재설정하도록 하여
* sync이상없도록
**/
function procFileUpload() {
$file_info = Context::get('Filedata');
// 정상적으로 업로드된 파일이 아니면 오류 출력
if(!is_uploaded_file($file_info['tmp_name'])) exit();
// 기본적으로 필요한 변수 설정
$oFileModel = &getModel('file');
$editor_sequence = Context::get('editor_sequence');
$upload_target_srl = intval(Context::get('uploadTargetSrl'));
if(!$upload_target_srl) $upload_target_srl = intval(Context::get('upload_target_srl'));
$module_srl = $this->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;$i<count($file_module_config->download_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;$i<count($srls);$i++) {
$srl = (int)$srls[$i];
if(!$srl) continue;
$args = null;
$args->file_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;$i<count($srls);$i++) {
$srl = (int)$srls[$i];
if(!$srl) continue;
$args = null;
$args->file_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;$i<count($path);$i++) FileHandler::removeBlankDir($path[$i]);
return $output;
}
/**
* @brief 특정 글의 첨부파일을 다른 글로 이동
**/
function moveFile($source_srl, $target_module_srl, $target_srl) {
if($source_srl == $target_srl) return;
$oFileModel = &getModel('file');
$file_list = $oFileModel->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

View file

@ -1,4 +1,3 @@
<<<<<<< .working
<?php
/**
* @class fileModel
@ -219,220 +218,6 @@
**/
function getFileModuleConfig($module_srl) {
return $this->getFileConfig($module_srl);
}
}
?>
=======
<?php
/**
* @class fileModel
* @author NHN (developers@xpressengine.com)
* @brief file 모듈의 model 클래스
**/
class fileModel extends file {
/**
* @brief 초기화
**/
function init() {
}
/**
* @brief 특정 문서에 속한 첨부파일 목록을 return
* 문서 생성/ 수정시 ajax로 특정 upload_target_srl에 대해서 파일 목록을 요청받을 사용됨.
* upload_target_srl이 정해지지 않은 경우 서버측 session의 값으로 대체 시도
**/
function getFileList() {
$oModuleModel = &getModel('module');
$mid = Context::get('mid');
$editor_sequence = Context::get('editor_sequence');
$upload_target_srl = Context::get('upload_target_srl');
if(!$upload_target_srl) $upload_target_srl = $_SESSION['upload_info'][$editor_sequence]->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&amp;act=%s&amp;file_srl=%s&amp;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<br /> %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){
@ -456,4 +241,3 @@
}
}
?>
>>>>>>> .merge-right.r9269

View file

@ -1,4 +1,3 @@
<<<<<<< .working
<?php
/**
* @class memberAdminModel
@ -54,6 +53,7 @@
case 'nick_name' :
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
$args->s_nick_name = $search_keyword;
$args->html_nick_name = htmlspecialchars($search_keyword);
break;
case 'email_address' :
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
@ -208,147 +208,3 @@
}
}
?>
=======
<?php
/**
* @class memberAdminModel
* @author NHN (developers@xpressengine.com)
* @brief member module의 admin model class
**/
class memberAdminModel extends member {
/**
* @brief 자주 호출될거라 예상되는 데이터는 내부적으로 가지고 있자...
**/
var $member_info = NULL;
var $member_groups = NULL;
var $join_form_list = NULL;
/**
* @brief 초기화
**/
function init() {
}
/**
* @brief 회원 목록을 구함
**/
function getMemberList() {
// 검색 옵션 정리
$args->is_admin = Context::get('is_admin')=='Y'?'Y':'';
$args->is_denied = Context::get('is_denied')=='Y'?'Y':'';
$args->selected_group_srl = Context::get('selected_group_srl');
$search_target = trim(Context::get('search_target'));
$search_keyword = trim(Context::get('search_keyword'));
if($search_target && $search_keyword) {
switch($search_target) {
case 'user_id' :
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
$args->s_user_id = $search_keyword;
break;
case 'user_name' :
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
$args->s_user_name = $search_keyword;
break;
case 'nick_name' :
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
$args->s_nick_name = $search_keyword;
$args->html_nick_name = htmlspecialchars($search_keyword);
break;
case 'email_address' :
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
$args->s_email_address = $search_keyword;
break;
case 'regdate' :
$args->s_regdate = preg_replace("/[^0-9]/","",$search_keyword);
break;
case 'regdate_more' :
$args->s_regdate_more = substr(preg_replace("/[^0-9]/","",$search_keyword) . '00000000000000',0,14);
break;
case 'regdate_less' :
$args->s_regdate_less = substr(preg_replace("/[^0-9]/","",$search_keyword) . '00000000000000',0,14);
break;
case 'last_login' :
$args->s_last_login = $search_keyword;
break;
case 'last_login_more' :
$args->s_last_login_more = substr(preg_replace("/[^0-9]/","",$search_keyword) . '00000000000000',0,14);
break;
case 'last_login_less' :
$args->s_last_login_less = substr(preg_replace("/[^0-9]/","",$search_keyword) . '00000000000000',0,14);
break;
case 'extra_vars' :
$args->s_extra_vars = ereg_replace("[^0-9]","",$search_keyword);
break;
}
}
// selected_group_srl이 있으면 query id를 변경 (table join때문에)
$sort_order = Context::get('sort_order');
$sort_index = Context::get('sort_index');
if($sort_index != 'last_login') {
$sort_index = "list_order";
}else{
$sort_order = 'desc';
}
if($args->selected_group_srl) {
$query_id = 'member.getMemberListWithinGroup';
$args->sort_index = "member.".$sort_index;
} else {
$query_id = 'member.getMemberList';
$args->sort_index = $sort_index;
}
if($sort_order != "desc") $sort_order = "asc";
$args->sort_order = $sort_order;
Context::set('sort_order', $sort_order);
// 기타 변수들 정리
$args->page = Context::get('page');
$args->list_count = 40;
$args->page_count = 10;
$output = executeQuery($query_id, $args);
return $output;
}
/**
* @brief 사이트별 회원 목록을 구함
**/
function getSiteMemberList($site_srl, $page = 1) {
$args->site_srl = $site_srl;
$args->page = $page;
$args->list_count = 40;
$args->page_count = 10;
$query_id = 'member.getSiteMemberList';
$output = executeQueryArray($query_id, $args);
return $output;
}
/**
* @brief 회원 모듈의 특정 스킨에 속한 컬러셋 목록을 return
**/
function getMemberAdminColorset() {
$skin = Context::get('skin');
if(!$skin) $tpl = "";
else {
$oModuleModel = &getModel('module');
$skin_info = $oModuleModel->loadSkinInfo($this->module_path, $skin);
Context::set('skin_info', $skin_info);
$oModuleModel = &getModel('module');
$config = $oModuleModel->getModuleConfig('member');
if(!$config->colorset) $config->colorset = "white";
Context::set('config', $config);
$oTemplate = &TemplateHandler::getInstance();
$tpl = $oTemplate->compile($this->module_path.'tpl', 'colorset_list');
}
$this->add('tpl', $tpl);
}
}
?>
>>>>>>> .merge-right.r9269

View file

@ -1,56 +1,3 @@
<<<<<<< .working
<!--%import("filter/delete_menu.xml")-->
<!--%import("js/menu_admin.js")-->
<!--#include("header.html")-->
<!-- 삭제를 위한 임시 form -->
<form id="fo_menu" action="./" method="get">
<input type="hidden" name="menu_srl" value="" />
</form>
<!-- 목록 -->
<table cellspacing="0" class="crossTable">
<caption>Total {number_format($total_count)}, Page {number_format($page)}/{number_format($total_page)}</caption>
<thead>
<tr>
<th scope="col"><div>{$lang->no}</div></th>
<th scope="col" class="wide"><div>{$lang->title}</div></th>
<th scope="col"><div>{$lang->regdate}</div></th>
<th scope="col" colspan="2"><div>&nbsp;</div></th>
</tr>
</thead>
<tbody>
<!--@foreach($menu_list as $no => $val)-->
<tr class="row{$cycle_idx}">
<td class="number center">{$no}</td>
<td class="wide">{htmlspecialchars($val->title)}</td>
<td class="nowrap">{zdate($val->regdate,"Y-m-d")}</td>
<td><a href="{getUrl('act','dispMenuAdminManagement','menu_srl',$val->menu_srl)}" class="buttonSet buttonSetting"><span>{$lang->cmd_setup}</span></a></td>
<td><a href="#" onclick="doDeleteMenu('{$val->menu_srl}');return false;" title="{htmlspecialchars($lang->cmd_delete)}" class="buttonSet buttonDelete"><span>{$lang->cmd_delete}</span></a></td>
</tr>
<!--@end-->
<tr>
<th colspan="5" class="button">
<a href="{getUrl('act','dispMenuAdminInsert','module_srl','')}" class="button black strong"><span>{$lang->cmd_make}</span></a>
</th>
</tr>
</tbody>
</table>
<!-- 페이지 네비게이션 -->
<div class="pagination a1">
<a href="{getUrl('page','','module_srl','')}" class="prevEnd">{$lang->first_page}</a>
<!--@while($page_no = $page_navigation->getNextPage())-->
<!--@if($page == $page_no)-->
<strong>{$page_no}</strong>
<!--@else-->
<a href="{getUrl('page',$page_no,'module_srl','')}">{$page_no}</a>
<!--@end-->
<!--@end-->
<a href="{getUrl('page',$page_navigation->last_page,'module_srl','')}" class="nextEnd">{$lang->last_page}</a>
</div>
=======
<!--%import("filter/delete_menu.xml")-->
<!--%import("js/menu_admin.js")-->
@ -102,4 +49,3 @@
<!--@end-->
<a href="{getUrl('page',$page_navigation->last_page,'module_srl','')}" class="nextEnd">{$lang->last_page}</a>
</div>
>>>>>>> .merge-right.r9269

View file

@ -1,4 +1,3 @@
<<<<<<< .working
<?php
/**
* @class messageAdminView
@ -26,42 +25,6 @@
$config = $oModuleModel->getModuleConfig('message');
Context::set('config',$config);
// Set a template file
$this->setTemplatePath($this->module_path.'tpl');
$this->setTemplateFile('config');
}
}
?>
=======
<?php
/**
* @class messageAdminView
* @author NHN (developers@xpressengine.com)
* @brief message모듈의 admin view class
**/
class messageAdminView extends message {
/**
* @brief 초기화
**/
function init() {
}
/**
* @brief 설정
**/
function dispMessageAdminConfig() {
// 스킨 목록을 구해옴
$oModuleModel = &getModel('module');
$skin_list = $oModuleModel->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
@ -73,4 +36,3 @@
}
?>
>>>>>>> .merge-right.r9269

View file

@ -1,4 +1,3 @@
<<<<<<< .working
<?php
/**
* @class moduleAdminController
@ -213,16 +212,18 @@
$output = executeQuery('module.deleteModuleGrants', $args);
if(!$output->toBool()) return $output;
// Permissions stored in the 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;
}
}
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');
}
@ -593,492 +594,3 @@
}
?>
=======
<?php
/**
* @class moduleAdminController
* @author NHN (developers@xpressengine.com)
* @brief module 모듈의 admin controller class
**/
class moduleAdminController extends module {
/**
* @brief 초기화
**/
function init() {
}
/**
* @brief 모듈 카테고리 추가
**/
function procModuleAdminInsertCategory() {
$args->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;$i<count($admin_members);$i++) {
$admin_id = trim($admin_members[$i]);
if(!$admin_id) continue;
$oModuleController->insertAdminId($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],"<?php if(!defined('__ZBXE__')) exit(); \r\n");
}
foreach($output->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

View file

@ -1,4 +1,3 @@
<<<<<<< .working
<?php
/**
* @class opageView
@ -100,7 +99,8 @@
// Replace relative path to the absolute path
$path_info = pathinfo($path);
$this->path = str_replace('\\', '/', realpath($path_info['dirname'])).'/';
$content = preg_replace_callback('/(target=|src=|href=|url\()("|\')?([^"\'\)]+)("|\'\))?/is',array($this,'_replacePath'),$content);
$content = preg_replace_callback('/(src=|href=|url\()("|\')?([^"\'\)]+)("|\'\))?/is',array($this,'_replacePath'),$content);
$content = preg_replace_callback('/(<load[^>]+target=)(")([^"]+)(")/is',array($this,'_replacePath'),$content);
$content = preg_replace_callback('/(<!--%import\()(\")([^"]+)(\")/is',array($this,'_replacePath'),$content);
FileHandler::writeFile($cache_file, $content);
@ -144,172 +144,3 @@
}
?>
=======
<?php
/**
* @class opageView
* @author NHN (developers@xpressengine.com)
* @brief opage 모듈의 view 클래스
**/
class opageView extends opage {
var $path;
var $cache_file;
var $caching_interval;
/**
* @brief 초기화
**/
function init() {
// 템플릿 경로 구함 (opage의 경우 tpl에 관리자용 템플릿 모아놓음)
$this->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)<filemtime($path) ) {
if(file_exists($cache_file)) FileHandler::removeFile($cache_file);
// 일단 대상 파일을 읽어서 내용을 구함
ob_start();
@include($path);
$content = ob_get_clean();
// 상대경로를 절대경로로 변경
$path_info = pathinfo($path);
$this->path = str_replace('\\', '/', realpath($path_info['dirname'])).'/';
$content = preg_replace_callback('/(src=|href=|url\()("|\')?([^"\'\)]+)("|\'\))?/is',array($this,'_replacePath'),$content);
$content = preg_replace_callback('/(<load[^>]+target=)(")([^"]+)(")/is',array($this,'_replacePath'),$content);
$content = preg_replace_callback('/(<!--%import\()(\")([^"]+)(\")/is',array($this,'_replacePath'),$content);
FileHandler::writeFile($cache_file, $content);
// include후 결과를 return
if(!file_exists($cache_file)) return;
// 컴파일 시도
$oTemplate = &TemplateHandler::getInstance();
$script = $oTemplate->compileDirect($filepath, $filename);
FileHandler::writeFile($cache_file, $script);
}
$__Context = &$GLOBALS['__Context__'];
$__Context->tpl_path = $filepath;
if($_SESSION['is_logged']) $__Context->logged_info = $_SESSION['logged_info'];
ob_start();
@include($cache_file);
$content = ob_get_clean();
return $content;
}
function _replacePath($matches) {
$val = trim($matches[3]);
// 외부 또는 /, #, { 로 시작하는 경로라면 그냥 pass
// /=absolute path, #=hash in a page, {=Template syntax
if(preg_match('@^((?:http|https|ftp|telnet|mms)://|(?:mailto|javascript):|[/#{])@i',$val)) {
return $matches[0];
// .. 와 같은 경우 대상 경로를 구함
} elseif(preg_match('/^\.\./i',$val)) {
$p = Context::pathToUrl($this->path);
return sprintf("%s%s%s%s",$matches[1],$matches[2],$p.$val,$matches[4]);
}
if(substr($val,0,2)=='./') $val = substr($val,2);
$p = Context::pathToUrl($this->path);
$path = sprintf("%s%s%s%s",$matches[1],$matches[2],$p.$val,$matches[4]);
return $path;
}
}
?>
>>>>>>> .merge-right.r9269

View file

@ -1,90 +1,3 @@
<<<<<<< .working
<!--%import("js/opage_admin.js")-->
<!--#include("header.html")-->
<!-- 정보 -->
<form action="./" method="get" onsubmit="return doChangeCategory(this);" id="fo_list">
<!-- 목록 -->
<table cellspacing="0" class="rowTable">
<caption>Total {number_format($total_count)}, page {number_format($page)}/{number_format($total_page)}</caption>
<thead>
<tr>
<th scope="col"><div>{$lang->no}</div></th>
<th scope="col"><div><input type="checkbox" onclick="XE.checkboxToggleAll(); return false;" /></div></th>
<th scope="col">
<div>
<input type="hidden" name="module" value="{$module}" />
<input type="hidden" name="act" value="{$act}" />
<select name="module_category_srl">
<option value="">{$lang->module_category}</option>
<option value="0" <!--@if($module_category_srl==="0")-->selected="selected"<!--@end-->>{$lang->not_exists}</option>
<!--@foreach($module_category as $key => $val)-->
<option value="{$key}" <!--@if($module_category_srl==$key)-->selected="selected"<!--@end-->>{$val->title}</option>
<!--@end-->
<option value="">---------</option>
<option value="-1">{$lang->cmd_management}</option>
</select>
<input type="submit" name="go_button" id="go_button" value="GO" class="buttonTypeGo" />
</div>
</th>
<th scope="col" class="half_wide"><div>{$lang->mid}</div></th>
<th scope="col" class="half_wide"><div>{$lang->browser_title}</div></th>
<th scope="col"><div>{$lang->regdate}</div></th>
<th scope="col" colspan="3"><div>&nbsp;</div></th>
</tr>
</thead>
<tbody>
<!--@foreach($opage_list as $no => $val)-->
<tr class="row{$cycle_idx}">
<td class="number center">{$no}</td>
<td class="center"><input type="checkbox" name="cart" value="{$val->module_srl}" /></td>
<td>
<!--@if(!$val->module_category_srl)-->
{$lang->not_exists}
<!--@else-->
{$module_category[$val->module_category_srl]->title}
<!--@end-->
</td>
<td>{htmlspecialchars($val->mid)}</td>
<td><a href="{getUrl('','mid',$val->mid)}" onclick="window.open(this.href); return false;">{$val->browser_title}</a></td>
<td>{zdate($val->regdate,"Y-m-d")}</td>
<td><a href="{getUrl('act','dispOpageAdminInsert','module_srl',$val->module_srl)}" class="buttonSet buttonSetting"><span>{$lang->cmd_setup}</span></a></td>
<td><a href="./?module=module&act=dispModuleAdminCopyModule&module_srl={$val->module_srl}" onclick="popopen(this.href);return false;" class="buttonSet buttonCopy"><span>{$lang->cmd_copy}</span></a></td>
<td><a href="{getUrl('act','dispOpageAdminDelete','module_srl', $val->module_srl)}" class="buttonSet buttonDelete"><span>{$lang->cmd_delete}</span></a></td>
</tr>
<!--@end-->
</tbody>
</table>
<!-- 버튼 -->
<div class="clear">
<div class="fl">
<a href="{getUrl('','module','module','act','dispModuleAdminModuleSetup')}" onclick="doCartSetup(this.href); return false;" class="button green"><span>{$lang->cmd_setup}</span></a>
<a href="{getUrl('','module','module','act','dispModuleAdminModuleGrantSetup')}" onclick="doCartSetup(this.href); return false;" class="button blue"><span>{$lang->cmd_manage_grant}</span></a>
</div>
<div class="fr ">
<a href="{getUrl('act','dispOpageAdminInsert','module_srl','')}" class="button black strong"><span>{$lang->cmd_make}</span></a>
</div>
</div>
</form>
<!-- 페이지 네비게이션 -->
<div class="pagination a1">
<a href="{getUrl('page','','module_srl','')}" class="prevEnd">{$lang->first_page}</a>
<!--@while($page_no = $page_navigation->getNextPage())-->
<!--@if($page == $page_no)-->
<strong>{$page_no}</strong>
<!--@else-->
<a href="{getUrl('page',$page_no,'module_srl','')}">{$page_no}</a>
<!--@end-->
<!--@end-->
<a href="{getUrl('page',$page_navigation->last_page,'module_srl','')}" class="nextEnd">{$lang->last_page}</a>
</div>
=======
<!--%import("js/opage_admin.js")-->
<!--#include("header.html")-->
@ -170,4 +83,3 @@
<!--@end-->
<a href="{getUrl('page',$page_navigation->last_page,'module_srl','')}" class="nextEnd">{$lang->last_page}</a>
</div>
>>>>>>> .merge-right.r9269

View file

@ -1,4 +1,3 @@
<<<<<<< .working
<load target="js/point_admin.js" usecdn="true" />
<!--#include("header.html")-->
@ -22,9 +21,9 @@
<!--@foreach($member_list as $no => $val)-->
<tr class="row{$cycle_idx}">
<td class="center number">{$no}</td>
<td class="nowrap">{htmlspecialchars($val->user_id)}</td>
<td class="nowrap">{htmlspecialchars($val->user_name)}</td>
<td class="nowrap"><span class="member_{$val->member_srl}">{htmlspecialchars($val->nick_name)}</span></td>
<td class="nowrap">{$val->user_id}</td>
<td class="nowrap">{$val->user_name}</td>
<td class="nowrap"><span class="member_{$val->member_srl}">{$val->nick_name}</span></td>
<td class="nowrap">
<form action="./" method="get">
<input type="hidden" name="member_srl" value="{$val->member_srl}" />
@ -91,96 +90,3 @@
<a href="#" onclick="location.href='{getUrl('','module',$module,'act',$act)}';return false;" class="button"><span>{$lang->cmd_cancel}</span></a>
</fieldset>
</form>
=======
<!--%import("filter/update_point.xml")-->
<!--%import("js/point_admin.js")-->
<!--#include("header.html")-->
<table cellspacing="0" class="crossTable">
<caption>Total {number_format($total_count)}, Page {number_format($page)}/{number_format($total_page)}</caption>
<thead>
<tr>
<th scope="col"><div>{$lang->no}</div></th>
<th scope="col"><div>{$lang->user_id}</div></th>
<th scope="col"><div>{$lang->user_name}</div></th>
<th scope="col"><div>{$lang->nick_name}</div></th>
<th scope="col"><div>{$lang->point}</div></th>
<th scope="col"><div>{$lang->level}</div></th>
</tr>
</thead>
<tbody>
<!--@foreach($member_list as $no => $val)-->
<tr class="row{$cycle_idx}">
<td class="center number">{$no}</td>
<td class="nowrap">{$val->user_id}</td>
<td class="nowrap">{$val->user_name}</td>
<td class="nowrap"><span class="member_{$val->member_srl}">{$val->nick_name}</span></td>
<td class="nowrap">
<form action="./" method="get">
<input type="hidden" name="member_srl" value="{$val->member_srl}" />
<input type="text" name="orgpoint" value="{$val->point}" class="inputTypeText w80" readonly />
<input type="text" id="point_{$val->member_srl}" name="point" class="inputTypeText w80" />
<span class="button"><input type="button" value="+" onclick="updatePoint({$val->member_srl}, 'add')"/></span>
<span class="button"><input type="button" value="-" onclick="updatePoint({$val->member_srl}, 'minus')"/></span>
<span class="button"><input type="button" value="{$lang->cmd_update}" onclick="updatePoint({$val->member_srl}, 'update')" /></span>
</form>
</td>
<td class="number center">{$val->level}</td>
</tr>
<!--@end-->
</tbody>
</table>
<form id="updateForm" action="./" method="POST">
<input type="hidden" id="update_action" name="action" value="" />
<input type="hidden" id="update_member_srl" name="member_srl" value="" />
<input type="hidden" id="update_point" name="point" class="inputTypeText w80" />
</form>
<!-- 페이지 네비게이션 -->
<div class="pagination a1">
<a href="{getUrl('page','','module_srl','')}" class="prevEnd">{$lang->first_page}</a>
<!--@while($page_no = $page_navigation->getNextPage())-->
<!--@if($page == $page_no)-->
<strong>{$page_no}</strong>
<!--@else-->
<a href="{getUrl('page',$page_no,'module_srl','')}">{$page_no}</a>
<!--@end-->
<!--@end-->
<a href="{getUrl('page',$page_navigation->last_page,'module_srl','')}" class="nextEnd">{$lang->last_page}</a>
</div>
<!-- 검색 -->
<form action="./" method="get" class="adminSearch">
<input type="hidden" name="module" value="{$module}" />
<input type="hidden" name="act" value="{$act}" />
<fieldset>
<select name="is_admin">
<option value="" <!--@if($is_admin!='Y')-->selected="selected"<!--@end-->>{$lang->total}</option>
<option value="Y" <!--@if($is_admin=='Y')-->selected="selected"<!--@end-->>{$lang->is_admin}</option>
</select>
<select name="is_denied">
<option value="" <!--@if($is_denied!='Y')-->selected="selected"<!--@end-->>{$lang->total}</option>
<option value="Y" <!--@if($is_denied=='Y')-->selected="selected"<!--@end-->>{$lang->denied}</option>
</select>
<select name="selected_group_srl">
<option value="0">{$lang->group}</option>
<!--@foreach($group_list as $key => $val)-->
<option value="{$val->group_srl}" <!--@if($selected_group_srl==$val->group_srl)-->selected="selected"<!--@end-->>{$val->title}</option>
<!--@end-->
</select>
<select name="search_target">
<option value="">{$lang->search_target}</option>
<!--@foreach($lang->search_target_list as $key => $val)-->
<option value="{$key}" <!--@if($search_target==$key)-->selected="selected"<!--@end-->>{$val}</option>
<!--@end-->
</select>
<input type="text" name="search_keyword" value="{htmlspecialchars($search_keyword)}" class="inputTypeText" />
<span class="button black strong"><input type="submit" value="{$lang->cmd_search}" /></span>
<a href="#" onclick="location.href='{getUrl('','module',$module,'act',$act)}';return false;" class="button"><span>{$lang->cmd_cancel}</span></a>
</fieldset>
</form>
>>>>>>> .merge-right.r9269

View file

@ -1,4 +1,3 @@
<<<<<<< .working
<?php
/**
* @class pollAdminView
@ -84,7 +83,10 @@
Context::set('page', $output->page);
Context::set('poll_list', $output->data);
Context::set('page_navigation', $output->page_navigation);
Context::set('module_list', $module_list);
Context::set('module_list', $module_list);
$security = new Security();
$security->encodeHTML('poll_list..title');
// Set a template
$this->setTemplatePath($this->module_path.'tpl');
$this->setTemplateFile('poll_list');
@ -105,7 +107,12 @@
if(!$skin_list[$config->skin]) $config->skin = "default";
// Set the skin colorset once the configurations is completed
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');
// Set a template
$this->setTemplatePath($this->module_path.'tpl');
$this->setTemplateFile('config');
@ -151,140 +158,3 @@
}
}
?>
=======
<?php
/**
* @class pollAdminView
* @author NHN (developers@xpressengine.com)
* @brief poll모듈의 admin view class
**/
class pollAdminView extends poll {
/**
* @brief 초기화
**/
function init() {
}
/**
* @brief 관리자 페이지
**/
function dispPollAdminList() {
// 검색 옵션 정리
$search_target = trim(Context::get('search_target'));
$search_keyword = trim(Context::get('search_keyword'));
if($search_target && $search_keyword) {
switch($search_target) {
case 'title' :
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
$args->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

View file

@ -1,55 +1,3 @@
<<<<<<< .working
<?php
/**
* @class syndicationAdminView
* @author NHN (developers@xpressengine.com)
* @brief syndication admin view class
**/
class syndicationAdminView extends syndication {
function init() {
}
function dispSyndicationAdminConfig() {
$oModuleModel = &getModel('module');
$module_config = $oModuleModel->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);
$this->setTemplatePath($this->module_path.'tpl');
$this->setTemplateFile('config');
}
}
?>
=======
<?php
/**
* @class syndicationAdminView
@ -106,4 +54,3 @@
}
?>
>>>>>>> .merge-right.r9269