Virtual Site 생성시 도메인 단위(서브도메인 또는 독립 도메인)이 아닌 ID 형식으로 생성 가능하도록 기능 개선.

SID 로 불리는 이 사이트ID는 MID와 중복이 불가능함.


git-svn-id: http://xe-core.googlecode.com/svn/sandbox@6051 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
zero 2009-04-08 10:10:17 +00:00
parent 40e1740839
commit bb97446dfc
40 changed files with 313 additions and 189 deletions

110
.htaccess
View file

@ -1,82 +1,64 @@
RewriteEngine On
# image...
RewriteRule ^(.+)/files/attach/images/(.*) ./files/attach/images/$2 [L]
RewriteRule ^(.+)/files/attach/menu_button/(.*) ./files/attach/menu_button/$2 [L]
RewriteRule ^(.+)/files/member_extra_info/(.*) ./files/member_extra_info/$2 [L]
RewriteRule ^(.+)/files/cache/(.*) ./files/cache/$2 [L]
RewriteRule ^(.+)/modules/(.*) ./modules/$2 [L]
RewriteRule ^(.+)/common/css/(.*) ./common/css/$2 [L]
RewriteRule ^(.+)/common/js/(.*) ./common/js/$2 [L]
RewriteRule ^(.+)/common/tpl/(.*) ./common/tpl/$2 [L]
RewriteRule ^(.+)/widgets/(.*) ./widgets/$2 [L]
RewriteRule ^(.+)/layouts/(.*) ./layouts/$2 [L]
RewriteRule ^(.+)/addons/(.*) ./addons/$2 [L]
# static files
RewriteRule ^([a-zA-Z0-9_]+)/files/(.*) ./files/$2 [L]
RewriteRule ^([a-zA-Z0-9_]+)/modules/(.*) ./modules/$2 [L]
RewriteRule ^([a-zA-Z0-9_]+)/common/(.*) ./common/$2 [L]
RewriteRule ^([a-zA-Z0-9_]+)/widgets/(.*) ./widgets/$2 [L]
RewriteRule ^([a-zA-Z0-9_]+)/widgetstyle/(.*) ./widgetstyle/$2 [L]
RewriteRule ^([a-zA-Z0-9_]+)/layouts/(.*) ./layouts/$2 [L]
RewriteRule ^([a-zA-Z0-9_]+)/addons/(.*) ./addons/$2 [L]
RewriteRule ^([a-zA-Z0-9_]+)/entry/files/(.*) ./files/$2 [L]
RewriteRule ^([a-zA-Z0-9_]+)/entry/modules/(.*) ./modules/$2 [L]
RewriteRule ^([a-zA-Z0-9_]+)/entry/common/(.*) ./common/$2 [L]
RewriteRule ^([a-zA-Z0-9_]+)/entry/widgets/(.*) ./widgets/$2 [L]
RewriteRule ^([a-zA-Z0-9_]+)/entry/widgetstyle/(.*) ./widgetstyle/$2 [L]
RewriteRule ^([a-zA-Z0-9_]+)/entry/layouts/(.*) ./layouts/$2 [L]
RewriteRule ^([a-zA-Z0-9_]+)/entry/addons/(.*) ./addons/$2 [L]
RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/files/(.*) ./files/$2 [L]
RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/modules/(.*) ./modules/$2 [L]
RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/common/(.*) ./common/$2 [L]
RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/widgets/(.*) ./widgets/$2 [L]
RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/widgetstyle/(.*) ./widgetstyle/$2 [L]
RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/layouts/(.*) ./layouts/$2 [L]
RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/addons/(.*) ./addons/$2 [L]
RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/entry/files/(.*) ./files/$3 [L]
RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/entry/modules/(.*) ./modules/$3 [L]
RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/entry/common/(.*) ./common/$3 [L]
RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/entry/widgets/(.*) ./widgets/$3 [L]
RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/entry/widgetstyle/(.*) ./widgetstyle/$3 [L]
RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/entry/layouts/(.*) ./layouts/$3 [L]
RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/entry/addons/(.*) ./addons/$3 [L]
# page
RewriteRule ^([a-zA-Z0-9_]+)/([[:digit:]]+)page$ ./index.php?mid=$1&page=$2 [L]
# total rss
RewriteRule ^rss/([[:digit:]]+){0,14}/([[:digit:]]+){0,14}/([[:digit:]]+)$ ./index.php?module=rss&act=rss&start_date=$1&end_date=$2&page=$3 [L]
RewriteRule ^rss/([[:digit:]]+)$ ./index.php?module=rss&act=rss&page=$1 [L]
# rss , blogAPI
RewriteRule ^rss$ ./index.php?module=rss&act=rss [L]
RewriteRule ^atom/([[:digit:]]+){0,14}/([[:digit:]]+){0,14}/([[:digit:]]+)$ ./index.php?module=rss&act=atom&start_date=$1&end_date=$2&page=$3 [L]
RewriteRule ^atom/([[:digit:]]+)$ ./index.php?module=rss&act=atom&page=$1 [L]
RewriteRule ^atom$ ./index.php?module=rss&act=atom [L]
RewriteRule ^([a-zA-Z0-9_]+)/rss$ ./index.php?mid=$1&act=rss [L]
RewriteRule ^([a-zA-Z0-9_]+)/atom$ ./index.php?mid=$1&act=atom [L]
RewriteRule ^([a-zA-Z0-9_]+)/api$ ./index.php?mid=$1&act=api [L]
RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/rss$ ./index.php?sid=$1&mid=$2&act=rss [L]
RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/atom$ ./index.php?sid=$1&mid=$2&act=atom [L]
RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/api$ ./index.php?sid=$1&mid=$2&act=api [L]
# administrator page
RewriteRule ^admin/?$ ./index.php?module=admin [L]
# mid + act
RewriteRule ^([a-zA-Z0-9_]+)/api$ ./index.php?mid=$1&act=api [L]
# document permanent link
RewriteRule ^([[:digit:]]+)$ ./index.php?document_srl=$1 [L]
# sid + document permanent link
RewriteRule ^([a-zA-Z0-9_]+)/([[:digit:]]+)$ ./index.php?sid=$1&document_srl=$2 [L]
# document + act link
RewriteRule ^([[:digit:]]+)/([a-zA-Z0-9_]+)$ ./index.php?document_srl=$1&act=$2 [L]
# document + key + act link
RewriteRule ^([[:digit:]]+)/([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)$ ./index.php?document_srl=$1&act=$3&key=$2 [L]
# mid link
RewriteRule ^([a-zA-Z0-9_]+)(/){0,1}$ ./index.php?mid=$1 [L]
# sid + mid link
RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)(/){0,1}$ ./index.php?sid=$1&mid=$2 [L]
# mid + document link
RewriteRule ^([a-zA-Z0-9_]+)/([[:digit:]]+)$ ./index.php?mid=$1&document_srl=$2 [L]
# mid + act link
RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)$ ./index.php?mid=$1&act=$2 [L]
# mid + page link
RewriteRule ^([a-zA-Z0-9_]+)/page/([[:digit:]]+)$ ./index.php?mid=$1&page=$2 [L]
# sid + mid + document link
RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/([[:digit:]]+)$ ./index.php?sid=$1&mid=$2&document_srl=$3 [L]
# mid + entry title
RewriteRule ^([a-zA-Z0-9_]+)/entry/(.+)$ ./index.php?mid=$1&entry=$2 [L]
# mid + category link
RewriteRule ^([a-zA-Z0-9_]+)/category/([[:digit:]]+)$ ./index.php?mid=$1&category=$2 [L]
# mid + act + document_Srl
RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z])([a-zA-Z0-9_]+)/([[:digit:]]+)$ ./index.php?mid=$1&document_srl=$4&act=$2$3 [L]
# mid + document_Srl + page
RewriteRule ^([a-zA-Z0-9_]+)/([[:digit:]]+)/page/([[:digit:]]+)$ ./index.php?mid=$1&document_srl=$2&page=$3 [L]
# mid + category + page
RewriteRule ^([a-zA-Z0-9_]+)/category/([[:digit:]]+)/page/([[:digit:]]+)$ ./index.php?mid=$1&category=$2&page=$3 [L]
# mid + search target regdate (year+month)
RewriteRule ^([a-zA-Z0-9_]+)/([[:digit:]]+)/([[:digit:]]+)$ ./index.php?mid=$1&search_target=regdate&search_keyword=$2$3 [L]
# mid + search target regdate (year+month+day)
RewriteRule ^([a-zA-Z0-9_]+)/([[:digit:]]+)/([[:digit:]]+)/([[:digit:]]+)$ ./index.php?mid=$1&search_target=regdate&search_keyword=$2$3$4 [L]
# mid + search target tag
RewriteRule ^([a-zA-Z0-9_]+)/tag/(.*)$ ./index.php?mid=$1&search_target=tag&search_keyword=$2 [L]
# mid + search target writer
RewriteRule ^([a-zA-Z0-9_]+)/writer/(.*)$ ./index.php?mid=$1&search_target=nick_name&search_keyword=$2 [L]
# mid + document_Srl + page + act
RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/([[:digit:]]+)/page/([[:digit:]]+)$ ./index.php?mid=$1&document_srl=$3&page=$4&act=$2 [L]
# module link
RewriteRule ^([a-zA-Z0-9_]+)(/){0,1}$ ./index.php?mid=$1 [L]
# sid + mid + entry title
RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/entry/(.+)$ ./index.php?sid=$1&mid=$2&entry=$3 [L]

View file

@ -104,6 +104,8 @@
$oModuleModel = &getModel('module');
$site_module_info = $oModuleModel->getDefaultMid();
Context::set('site_module_info', $site_module_info);
if($site_module_info->site_srl && isSiteID($site_module_info->sid)) Context::set('sid', $site_module_info->sid);
}
// 사용자 설정 언어 타입이 없으면 기본 언어타입으로 지정
@ -766,14 +768,24 @@
$site_module_info = Context::get('site_module_info');
}
// SiteID 요청시 전처리
if($domain && isSiteID($domain)) {
$sid = $domain;
$domain = '';
}
// SiteID가 요청되지 않았다면 현재 site_module_info에서 SiteID 판별
if(!$sid && $site_module_info->domain && isSiteID($site_module_info->domain)) {
$sid = $site_module_info->domain;
}
if(!$domain) {
if($site_module_info->domain) $domain = $site_module_info->domain;
if($site_module_info->domain && !isSiteID($site_module_info->domain)) $domain = $site_module_info->domain;
else {
if($this->db_info->default_url) $domain = $this->db_info->default_url;
else if(!$domain) $domain = Context::getRequestUri();
}
}
$domain = preg_replace('/^(http|https):\/\//i','', trim($domain));
if(substr($domain,-1) != '/') $domain .= '/';
@ -796,6 +808,7 @@
}
$get_vars[$key] = $val;
}
unset($get_vars['sid']);
/* member module중의 쪽지함/친구 관리 기능이 communication 모듈로 이전하여 하위 호환성을 위한 act값 변경 */
if($get_vars['act'] == 'dispMemberFriend') $get_vars['act'] = 'dispCommunicationFriend';
@ -808,9 +821,16 @@
else $path = $this->getRequestUri(RELEASE_SSL, $domain);
$var_count = count($get_vars);
if(!$var_count) return $path;
if(!$var_count) {
if($sid) {
if($this->allow_rewrite) $path .= $sid;
else $path .= '?sid='.$sid;
}
return $path;
}
// rewrite모듈을 사용할때 getUrl()을 이용한 url 생성
// 2009. 4. 8 mid, document_srl, site id, entry 를 제외하고는 rewrite rule 사용하지 않도록 변경
if($this->allow_rewrite) {
if(count($get_vars)) foreach($get_vars as $key => $value) if(!isset($value) || $value === '') unset($get_vars[$key]);
@ -818,46 +838,23 @@
asort($var_keys);
$target = implode('.',$var_keys);
if($sid) $rpath = $path.$sid .'/';
else $rpath = $path;
switch($target) {
case 'mid' :
return $path.$get_vars['mid'];
return $rpath.$get_vars['mid'];
case 'document_srl' :
return $path.$get_vars['document_srl'];
case 'act.mid' :
return sprintf('%s%s/%s',$path,$get_vars['mid'],$get_vars['act']);
return $rpath.$get_vars['document_srl'];
case 'document_srl.mid' :
return sprintf('%s%s/%s',$path,$get_vars['mid'],$get_vars['document_srl']);
case 'act.document_srl' :
return sprintf('%s%s/%s',$path,$get_vars['document_srl'],$get_vars['act']);
case 'mid.page' :
return sprintf('%s%s/page/%s',$path,$get_vars['mid'],$get_vars['page']);
case 'category.mid' :
return sprintf('%s%s/category/%s',$path,$get_vars['mid'],$get_vars['category']);
case 'act.document_srl.key' :
return sprintf('%s%s/%s/%s',$path,$get_vars['document_srl'],$get_vars['key'],$get_vars['act']);
case 'document_srl.mid.page' :
return sprintf('%s%s/%s/page/%s',$path,$get_vars['mid'],$get_vars['document_srl'],$get_vars['page']);
case 'category.mid.page' :
return sprintf('%s%s/category/%s/page/%s',$path,$get_vars['mid'],$get_vars['category'],$get_vars['page']);
case 'mid.search_keyword.search_target' :
switch($get_vars['search_target']) {
case 'tag' :
return sprintf('%s%s/tag/%s',$path,$get_vars['mid'],str_replace(' ','+',$get_vars['search_keyword']));
case 'nick_name' :
return sprintf('%s%s/writer/%s',$path,$get_vars['mid'],str_replace(' ','+',$get_vars['search_keyword']));
case 'regdate' :
if(strlen($get_vars['search_keyword'])==8) return sprintf('%s%s/%04d/%02d/%02d',$path,$get_vars['mid'],substr($get_vars['search_keyword'],0,4),substr($get_vars['search_keyword'],4,2),substr($get_vars['search_keyword'],6,2));
elseif(strlen($get_vars['search_keyword'])==6) return sprintf('%s%s/%04d/%02d',$path,$get_vars['mid'],substr($get_vars['search_keyword'],0,4),substr($get_vars['search_keyword'],4,2));
}
break;
case 'act.document_srl.mid' :
return sprintf('%s%s/%s/%s',$path,$get_vars['mid'], $get_vars['act'],$get_vars['document_srl']);
return sprintf('%s%s/%s',$rpath,$get_vars['mid'],$get_vars['document_srl']);
case 'entry.mid' :
return sprintf('%s%s/entry/%s',$path,$get_vars['mid'],$get_vars['entry']);
return sprintf('%s%s/entry/%s',$rpath,$get_vars['mid'],$get_vars['entry']);
}
}
// rewrite 모듈을 사용하지 않고 인자의 값이 2개 이상이거나 rewrite모듈을 위한 인자로 적당하지 않을 경우
if($sid) $url = 'sid='.$sid;
foreach($get_vars as $key => $val) {
if(!isset($val)) continue;
if(is_array($val) && count($val)) {
@ -868,7 +865,6 @@
$url .= ($url?'&':'').$key.'='.urlencode($val);
}
}
return $path.'?'.htmlspecialchars($url);
}
@ -1361,13 +1357,9 @@
// body 내의 <style ..></style>를 header로 이동
$content = preg_replace_callback('!<style(.*?)<\/style>!is', array($this,'moveStyleToHeader'), $content);
// <img|br> 코드 변환
//$content = preg_replace('/<(img|br)([^>]*)(\/>|>)/i','<$1$2 />', $content);
$content = preg_replace('/<(img|br)([^>\/]*)(\/>|>)/i','<$1$2 />', $content);
// templateHandler의 이미지 경로로 인하여 생기는 절대경로 이미지등의 경로 중복 처리
//$content = preg_replace('/<(img|input)([^>]*)src=(["|\']?)http:\/\/([^ ]+)http:\/\//is','<$1$2src=$3http://', $content);
$content = preg_replace('/src=(["|\']?)http:\/\/([^ ]+)http:\/\//is','src=$1http://', $content);
$content = preg_replace('/src=(["|\']?)http:\/\/([^ ]+)http:\/\//is','src=$1http://', $content);
return $content;
}

View file

@ -18,6 +18,7 @@ function exec_xml(module, act, params, callback_func, response_tags, callback_fu
}
oXml.addParam("module", module);
oXml.addParam("act", act);
if(typeof(xeSid)!='undefined') oXml.addParam('sid', xeSid);
if(typeof(response_tags)=="undefined" || response_tags.length<1) response_tags = new Array('error','message');
@ -429,6 +430,7 @@ $.exec_json = function(action,data,func){
}
$.extend(data,{module:action[0],act:action[1]});
if(typeof(xeSid)!='undefined') $.extend(data,{sid:xeSid});
$.ajax({
type:"POST"
,dataType:"json"

View file

@ -124,6 +124,7 @@
$lang->file = 'file';
$lang->mid = 'Module Name';
$lang->sid = 'Site Name';
$lang->layout = 'Layout';
$lang->widget = 'Widget';
$lang->module = 'Module';

View file

@ -123,6 +123,7 @@
$lang->file = 'file';
$lang->mid = 'ID del Módulo';
$lang->sid = 'Site Name';
$lang->layout = 'Composición';
$lang->widget = 'Widget';
$lang->module = 'Módulo';

View file

@ -124,6 +124,7 @@
$lang->file = 'file';
$lang->mid = 'Nom';
$lang->sid = 'Site Name';
$lang->layout = 'Mise en Page';
$lang->widget = 'Gadget';
$lang->module = 'Module';

View file

@ -124,6 +124,7 @@
$lang->file = 'file';
$lang->mid = 'Module Name';
$lang->sid = 'Site Name';
$lang->layout = 'Layout';
$lang->widget = 'Widget';
$lang->module = 'Modul';

View file

@ -124,6 +124,7 @@
$lang->file = 'ファイル';
$lang->mid = 'モジュール名';
$lang->sid = 'Site Name';
$lang->layout = 'レイアウト';
$lang->widget = 'ウィジェット';
$lang->module = 'モジュール';

View file

@ -124,6 +124,7 @@
$lang->file = '파일';
$lang->mid = '모듈이름';
$lang->sid = '가상 사이트 이름';
$lang->layout = '레이아웃';
$lang->widget = '위젯 ';
$lang->module = '모듈';

View file

@ -122,6 +122,7 @@
$lang->order_desc = 'спустится';
$lang->mid = 'Имя Модуля';
$lang->sid = 'Site Name';
$lang->layout = 'Лейаут';
$lang->widget = 'Виджет';
$lang->module = 'Модуль';

View file

@ -124,6 +124,7 @@
$lang->file = '文件';
$lang->mid = '模块名称';
$lang->sid = 'Site Name';
$lang->layout = '布局';
$lang->widget = '控件 ';
$lang->module = '模块';

View file

@ -124,6 +124,7 @@
$lang->file = '檔案';
$lang->mid = '模組名稱';
$lang->sid = 'Site Name';
$lang->layout = '版面';
$lang->widget = '控件 ';
$lang->module = '模組';

View file

@ -52,6 +52,7 @@
<script type="text/javascript">//<![CDATA[
var current_url = "{$current_url}";
var request_uri = "{$request_uri}";
<!--@if($sid)-->var xeSid = "{$sid}";<!--@end-->
var current_mid = "{$mid}";
var waiting_message = "{$lang->msg_call_server}";
var ssl_actions = new Array(<!--@if(count($ssl_actions))-->"{implode('","',$ssl_actions)}"<!--@end-->);

View file

@ -238,6 +238,13 @@
return Context::getUrl($num_args, $args_list, $domain);
}
/**
* @brief 가상사이트의 Domain이 url형식인지 site id인지 return
**/
function isSiteID($domain) {
return preg_match('/^([a-z0-9\_]+)$/i', $domain);
}
/**
* @brief 주어진 문자를 주어진 크기로 자르고 잘라졌을 경우 주어진 꼬리를
* @param string 자를 문자열

View file

@ -12,7 +12,7 @@
* XE 오픈 프로젝트로 개발되는 오픈 소스입니다.\n
* 자세한 내용은 아래 링크를 참조하세요.
* - 공식홈페이지 : http://www.xpressengine.com
* - SVN Repository : http://svn.xpressengine.com/trunk
* - SVN Repository : http://svn.xpressengine.com/XpressEngine/trunk
* \n
* "XpressEngine (XE)" 자유 소프트웨어입니다. \n
* 소프트웨어의 피양도자는 자유 소프트웨어 재단이 공표한 GNU 일반 공중 사용 허가서 2 또는 \n
@ -48,7 +48,6 @@
* @brief SSO 인증 확인이 불필요할때 모듈 동작
**/
if($oContext->checkSSO()) {
/**
* @brief ModuleHandler 객체를 생성/ 실행
*
@ -63,8 +62,6 @@
$oModule = &$oModuleHandler->procModule();
$oModuleHandler->displayContent($oModule);
}
}
$oContext->close();
?>

View file

@ -76,6 +76,7 @@ function XEUploaderStart(obj) {
upload_complete_handler : uploadComplete,
queue_complete_handler :queueComplete
};
if(typeof(xeSid)!='undefined') settings["post_params"]["sid"] = xeSid;
settings["post_params"][obj["sessionName"]] = xGetCookie(obj["sessionName"]);
settings["editorSequence"] = obj["editorSequence"];
settings["uploadTargetSrl"] = editorRelKeys[obj["editorSequence"]]["primary"].value;

View file

@ -10,9 +10,19 @@
function init() {
}
/**
* @brief 접속 방법중 domain 이나 site id나 모두 sites 테이블의 domain 컬럼에 저장이
* site id보다 domain이 우선 순위를 가짐
**/
function procHomepageAdminInsertHomepage() {
$title = Context::get('title');
$domain = preg_replace('/^(http|https):\/\//i','',Context::get('domain'));
$domain = preg_replace('/^(http|https):\/\//i','', trim(Context::get('domain')));
$sid = trim(Context::get('site_id'));
if($domain && $sid) unset($sid);
if(!$domain && $sid) $domain = $sid;
if(!$title) return new Object(-1, 'msg_invalid_request');
if(!$domain) return new Object(-1, 'msg_invalid_request');
@ -41,12 +51,10 @@
}
$lang = null;
// 도메인 검사
$domain_info = $oModuleModel->getSiteInfoByDomain($domain);
if($domain_info) return new Object(-1,'msg_already_registed_domain');
// virtual site 생성하고 site_srl을 보관
$info->site_srl = $oModuleController->insertSite($domain, 0);
$output = $oModuleController->insertSite($domain, 0);
if(!$output->toBool()) return $output;
$info->site_srl = $output->get('site_srl');
// 언어 코드 등록 (홈, 공지사항, 등업신청, 자유게시판, 전체 글 보기, 한줄이야기, 카페앨범, 메뉴등)
foreach($defined_lang as $lang_code => $v) {
@ -84,7 +92,10 @@
$oLayoutModel = &getModel('layout');
$layout_args = $oLayoutModel->getLayout($info->layout_srl);
$layout->colorset = 'white';
if($domain) $layout->index_url = 'http://'.$domain; else $layout->index_url = Context::getRequestUri();
// sid 형식일 경우
if(isSiteID($domain)) $layout->index_url = getSiteUrl($domain, '');
else $layout->index_url = 'http://'.$domain;
$layout->main_menu = $info->menu_srl;
$layout_args->extra_vars = serialize($layout);
@ -255,21 +266,15 @@
}
function procHomepageAdminUpdateHomepage() {
$args = Context::gets('site_srl','title','domain','homepage_admin');
$args = Context::gets('site_srl','homepage_admin');
if(!$args->site_srl) return new Object(-1,'msg_invalid_request');
$oHomepageModel = &getModel('homepage');
$homepage_info = $oHomepageModel->getHomepageInfo($args->site_srl);
if(!$homepage_info->site_srl) return new Object(-1,'msg_invalid_request');
$output = executeQuery('homepage.updateHomepageTitle', $args);
if(!$output->toBool()) return $output;
$oModuleController = &getController('module');
$output = $oModuleController->updateSite($args);
if(!$output->toBool()) return $output;
$admin_list = explode(',',$args->homepage_admin);
$oModuleController = &getController('module');
$output = $oModuleController->insertSiteAdmin($args->site_srl, $admin_list);
if(!$output->toBool()) return $output;

View file

@ -16,6 +16,8 @@
$lang->cafe_admin = "CafeXE administrator";
$lang->do_selected_member = "Change the selected members into : ";
$lang->cmd_make_cafe = '카페 생성';
$lang->default_menus = array(
'home' => 'Home',
'notice' => 'Notice',
@ -61,7 +63,6 @@
);
$lang->about_cafe = "CafeXE package provides features to create cafes and to configure them conveniently";
$lang->about_cafe_title = "The title is only used for management, it would not be displayed.";
$lang->about_domain = "In order to create more than one cafe, each of them needs to have own domain name.<br />Sub-domain (e.g., aaa.bbb.com of bbb.com) also can be used. Input the address including the path installed xe. <br /> ex) www.xpressengine.com/zbxe";
$lang->about_menu_names = "You can set the title of the menu for each language displayed in the menus<br />If you input one of the titles, titles for other languages will be set as same.";
$lang->about_menu_option = "You can assign it to open a page in a new window when the menu clicked.<br />The option for menu expand may work depending on the layout.";
@ -76,5 +77,4 @@
$lang->confirm_change_layout = "If you change the layout, some information of the layout might be reset. Would you like to change it?";
$lang->confirm_delete_menu_item = "If you delete the menu item, the linked module(board or page) will be removed, too. Would you like to delete it?";
$lang->msg_already_registed_domain = "It is already registered domain name. Please use the different one.";
?>

View file

@ -16,6 +16,8 @@
$lang->cafe_admin = 'Gerente de café';
$lang->do_selected_member = 'Los miembros seleccionados: ';
$lang->cmd_make_cafe = '카페 생성';
$lang->default_menus = array(
'home' => 'Inicio',
'notice' => 'Anuncios',
@ -61,7 +63,6 @@
);
$lang->about_cafe = 'Cafe 서비스 관리자는 다수의 Cafe를 만들 수 있고 또 각 Cafe를 편하게 설정할 수 있도록 합니다.';
$lang->about_cafe_title = 'Cafe 이름은 관리를 위해서만 사용될 뿐 서비스에는 나타나지 않습니다';
$lang->about_domain = 'Para crear un dominio privado de la cafetería requiere. <br/> Independiente de dominio o subdominio, y XE está instalado, el camino que en su conjunto. <br /> Ej.) www.xpressengine.com / zbxe';
$lang->about_menu_names = 'Café en el nombre del idioma que aparezca en el menú para que usted pueda especificar. <br/> Puede entrar en un sólo aplica a todos ustedes ';
$lang->about_menu_option = 'selección de menú puede elegir para abrir saechangeuro. <br /> Menús desplegables se comportarán de acuerdo con el diseño';
$lang->about_group_grant = 'Cuando aparezca el menú, seleccionar un grupo de grupos seleccionados. <br/> Miembros no pueden ver cuando se apaga todas las';
@ -75,5 +76,4 @@
$lang->confirm_change_layout = 'Si cambia el diseño de algunas de la información relativa al diseño puede desaparecer. ¿Te gustaría cambiar?';
$lang->confirm_delete_menu_item = 'Eliminación de un elemento de menú o de la página, el módulo está conectado con el boletín se eliminarán. Si desea eliminar?';
$lang->msg_already_registed_domain = 'Ya es de dominio registrado. Por favor, use un dominio diferente';
?>

View file

@ -16,6 +16,8 @@
$lang->cafe_admin = "ホームページ管理者";
$lang->do_selected_member = "選択した会員を : ";
$lang->cmd_make_cafe = '카페 생성';
$lang->default_menus = array(
'home' => 'ホーム',
'notice' => 'お知らせ',
@ -61,7 +63,6 @@
);
$lang->about_cafe = "ホームページサービス管理者は複数のホームページ作成、および各ホームページを簡単に管理が出来ます。";
$lang->about_cafe_title = "ホームページ名は管理をするためだけに使われ、実サービスには表示されません。";
$lang->about_domain = "複数のホームページを作成するためには、「オリジナルドメイン」や「サブ ドメイン」のような専用のドメインが必要です。<br />また、 XEインストールパスも一緒に記入して下さい。<br />ex) www.xpressengine.com/xe";
$lang->about_menu_names = "ホームページに使うメニュー名を言語別に指定出来ます。<br/>一個だけ記入した場合、他言語に一括適用されます。";
$lang->about_menu_option = "メニューを選択するとき新しいウィンドウズに開けるかを選択します。<br />拡張メニューはレイアウトによって動作します。";
$lang->about_group_grant = "選択グループのみ、メニューが見えます。<br/>全てを解除すると非会員にも見えます。";
@ -75,5 +76,4 @@
$lang->confirm_change_layout = "レイアウトの変更時、一部のレイアウト情報が失われる可能性があります。 変更しますか?";
$lang->confirm_delete_menu_item = "メニューの削除時、リンクされている掲示板やページモジュールも一緒に削除されます。削除しますか?";
$lang->msg_already_registed_domain = "既に登録されているドメインです。異なるドメインを利用して下さい。";
?>

View file

@ -16,6 +16,8 @@
$lang->cafe_admin = 'Cafe 관리자';
$lang->do_selected_member = '선택된 회원을 : ';
$lang->cmd_make_cafe = '카페 생성';
$lang->default_menus = array(
'home' => '홈',
'notice' => '공지사항',
@ -61,7 +63,6 @@
);
$lang->about_cafe = 'Cafe 서비스 관리자는 다수의 Cafe를 만들 수 있고 또 각 Cafe를 편하게 설정할 수 있도록 합니다.';
$lang->about_cafe_title = 'Cafe 이름은 관리를 위해서만 사용될 뿐 서비스에는 나타나지 않습니다';
$lang->about_domain = '1개 이상의 Cafe를 만들기 위해서는 전용 도메인이 있어야 합니다.<br/>독립 도메인이나 서브 도메인이 있으면 되고 XE가 설치된 경로까지 같이 넣어주세요.<br />ex) www.xpressengine.com/zbxe';
$lang->about_menu_names = 'Cafe에 나타날 메뉴 이름을 언어에 따라서 지정할 수 있습니다.<br/>하나만 입력하셔도 모두 같이 적용됩니다';
$lang->about_menu_option = '메뉴를 선택시 새창으로 열지를 선택할 수 있습니다.<br />펼침 메뉴는 레이아웃에 따라 동작합니다';
$lang->about_group_grant = '그룹을 선택하면 선택된 그룹만 메뉴가 보입니다.<br/>모두 해제하면 비회원도 볼 수 있습니다';
@ -75,5 +76,4 @@
$lang->confirm_change_layout = '레이아웃을 변경할 경우 레이아웃 정보들 중 일부가 사라질 수가 있습니다. 변경하시겠습니까?';
$lang->confirm_delete_menu_item = '메뉴 항목 삭제시 연결되어 있는 게시판이나 페이지 모듈도 같이 삭제가 됩니다. 그래도 삭제하시겠습니까?';
$lang->msg_already_registed_domain = '이미 등록된 도메인입니다. 다른 도메인을 사용해주세요';
?>

View file

@ -16,6 +16,8 @@
$lang->cafe_admin = "管理员";
$lang->do_selected_member = "把所选用户 : ";
$lang->cmd_make_cafe = '카페 생성';
$lang->default_menus = array(
'home' => '首页',
'notice' => '站点公告',
@ -61,7 +63,6 @@
);
$lang->about_cafe = "站点工具不仅可以迅速建立多个站点,而且非常方便各项设置。";
$lang->about_cafe_title = "建议使用一个即简洁又直观的名称。此名称不会显示到用户页面当中。";
$lang->about_domain = "要创建一个站点必须有一个专用域名。<br/>一级域名或二级域名皆可。输入的时候请把XE安装路径也一起输入。<br />ex) www.xpressengine.com/zbxe";
$lang->about_menu_names = "在此可以指定多国语言菜单。<br/>如只输入一项,其他语言同时只应用此项语言。";
$lang->about_menu_option = "可以设置点击菜单时是否要在新窗口中打开。<br />展开选项随布局。";
$lang->about_group_grant = "如选择用户组,只有所属组用户才能看到此菜单。<br/>不选非用户也可以查看。";
@ -75,5 +76,4 @@
$lang->confirm_change_layout = "切换布局可能一些原有的信息将无法显示。你确定要切换吗?";
$lang->confirm_delete_menu_item = "删除菜单:即同时删除链接到此菜单的版面或页面模块。你确定要删除吗?";
$lang->msg_already_registed_domain = "对不起!已有相同的域名。请重新输入。";
?>

View file

@ -16,6 +16,8 @@
$lang->cafe_admin = "網站管理者";
$lang->do_selected_member = "選擇會員 : ";
$lang->cmd_make_cafe = '카페 생성';
$lang->default_menus = array(
'home' => '首頁',
'notice' => '公告事項',
@ -61,7 +63,6 @@
);
$lang->about_cafe = "虛擬網站模組可快速建立網站,且容易進行設定。";
$lang->about_cafe_title = "只有在管理時才看的到此標題。";
$lang->about_domain = "要建立網站必須要有個專屬域名。<br/>頂級域名或次級域名都可以。輸入時請將XE安裝路徑也一起輸入。<br />例) www.xpressengine.com/zbxe";
$lang->about_menu_names = "可指定語言。<br/>如果只輸入其中一項,其他語言將會顯示一樣。";
$lang->about_menu_option = "可設定案選單時,是否要以新視窗開啟。<br />選展開的話,是隨版面。";
@ -76,5 +77,4 @@
$lang->confirm_change_layout = "變換版面可能會使原來的資料無法顯示。確定要變換嗎?";
$lang->confirm_delete_menu_item = "刪除選單:刪除選單的同時,將會使連結到選單的討論板或頁面一起刪除。確定要刪除嗎?";
$lang->msg_already_registed_domain = "已註冊的域名。請使用其他的網域。";
?>

View file

@ -1,11 +1,13 @@
<filter name="insert_homepage" module="homepage" act="procHomepageAdminInsertHomepage" confirm_msg_code="confirm_submit">
<form>
<node target="homepage_title" required="true" maxlength="250" />
<node target="domain" required="true" maxlength="250" />
<node target="cafe_title" required="true" maxlength="250" />
<node target="domain" maxlength="250" />
<node target="sid" maxlength="250" filter="alpha_number" />
</form>
<parameter>
<param name="title" target="homepage_title" />
<param name="title" target="cafe_title" />
<param name="domain" target="domain" />
<param name="site_id" target="sid" />
</parameter>
<response callback_func="completeInsertHomepage">
<tag name="error" />

View file

@ -1,13 +1,9 @@
<filter name="update_homepage" module="homepage" act="procHomepageAdminUpdateHomepage" confirm_msg_code="confirm_submit">
<form>
<node target="site_srl" required="true" maxlength="250" />
<node target="homepage_title" required="true" maxlength="250" />
<node target="domain" required="true" maxlength="250" />
</form>
<parameter>
<param name="site_srl" target="site_srl" />
<param name="title" target="homepage_title" />
<param name="domain" target="domain" />
<param name="homepage_admin" target="homepage_admin" />
</parameter>
<response callback_func="completeUpdateHomepage">

View file

@ -12,7 +12,7 @@
<tr>
<th scope="col"><div>{$lang->no}</div></th>
<th scope="col" class="half_wide"><div>{$lang->title}</div></th>
<th scope="col" class="half_wide"><div>{$lang->domain}</div></th>
<th scope="col" class="half_wide"><div>{$lang->domain} / {$lang->sid}</div></th>
<th scope="col"><div>{$lang->regdate}</div></th>
<th scope="col" colspan="3"><div>&nbsp;</div></th>
</tr>
@ -22,7 +22,7 @@
<tr class="row{$cycle_idx}">
<td>{$no}</td>
<td><a href="{getSiteUrl($val->domain,'module','homepage','act','dispHomepageManage','site_srl',$val->site_srl)}">{htmlspecialchars($val->homepage_title)}</a></td>
<td>http://<a href="http://{$val->domain}" onclick="window.open(this.href);return false;">{$val->domain}</a></td>
<td><a href="{getSiteUrl($val->domain)}" onclick="window.open(this.href);return false;">{$val->domain}</a></td>
<td>{zdate($val->regdate,"Y-m-d")}</td>
<td><a href="{getUrl('act','dispHomepageAdminSetup','site_srl',$val->site_srl)}" class="buttonSet buttonSetting"><span>{$lang->cmd_setup}</span></a></td>
<td><a href="{getUrl('act','dispHomepageAdminDelete','site_srl',$val->site_srl)}" class="buttonSet buttonDelete"><span>{$lang->cmd_delete}</span></a></td>
@ -47,26 +47,31 @@
</div>
<div class="adminRightExtra">
<form action="./" method="post" onsubmit="return procFilter(this, insert_homepage)">
<table cellspacing="0" class="colTable">
<form action="./" method="post" onsubmit="return procFilter(this, insert_homepage)" id="cafeFo">
<h3 class="xeAdmin">{$lang->cmd_make_cafe}</h3>
<table cellspacing="0" class="rowTable">
<caption>&nbsp;</caption>
<tbody>
<tr>
<th scope="row"><div>{$lang->cafe_title}</div></th>
</tr>
<tr>
<td>
<input type="text" name="homepage_title" value="" class="inputTypeText w200" />
<input type="text" name="cafe_title" value="" class="inputTypeText w200" />
<p>{$lang->about_cafe_title}</p>
</td>
</tr>
<tr>
<th scope="row"><div>{$lang->domain}</div></th>
</tr>
<tr>
<tr>
<th scope="row"><div>{$lang->access_type}</div></th>
<td>
http://<input type="text" name="domain" value="" class="inputTypeText w200" />
<p>{$lang->about_domain}</p>
<label for="chkDomain"><input type="radio" id="chkDomain" name="access_type" value="domain" onclick="toggleAccessType('domain');" checked="checked" /> {$lang->access_domain}</label>
<label for="chkSid"><input type="radio" id="chkSid" name="access_type" value="sid" onclick="toggleAccessType('sid');" /> {$lang->access_sid}</label>
<div id="accessDomain" style="display:block; margin-top:10px;">
http://<input type="text" name="domain" value="" class="inputTypeText w200" />
<p>{$lang->about_domain}</p>
</div>
<div id="accessSid" style="display:none; margin-top:10px;">
<input type="text" name="sid" value="" class="inputTypeText w200" />
<p>{$lang->about_sid}</p>
</div>
</td>
</tr>
<tr class="row2">

View file

@ -395,3 +395,18 @@ function doCompleteRemoveMember(ret_obj) {
alert(ret_obj['message']);
location.reload();
}
function toggleAccessType(target) {
switch(target) {
case 'domain' :
xGetElementById('cafeFo').domain.value = '';
xGetElementById('accessDomain').style.display = 'block';
xGetElementById('accessSid').style.display = 'none';
break;
case 'sid' :
xGetElementById('cafeFo').sid.value = '';
xGetElementById('accessDomain').style.display = 'none';
xGetElementById('accessSid').style.display = 'block';
break;
}
}

View file

@ -18,17 +18,15 @@
<tr>
<th scope="row"><div>{$lang->cafe_title}</div></th>
<td>
<input type="text" name="homepage_title" value="{$homepage_info->title}" class="inputTypeText w200" />
{$homepage_info->title}
<a href="{getSiteUrl($homepage_info->domain,'', 'module','homepage','act','dispHomepageManage')}" onclick="window.open(this.href); return false;" class="button"><span>{$lang->cmd_management}</span></a>
<p>{$lang->about_cafe_title}</p>
</td>
</tr>
<tr>
<th scope="row"><div>{$lang->domain}</div></th>
<td>
http://<input type="text" name="domain" value="{$homepage_info->domain}" class="inputTypeText w200" />
{getSiteUrl($homepage_info->domain)}
<a href="{getSiteUrl($homepage_info->domain, '')}" onclick="window.open(this.href); return false;" class="button"><span>{$lang->cmd_move}</span></a>
<p>{$lang->about_domain}</p>
</td>
</tr>
<tr>

View file

@ -337,6 +337,12 @@
if(!$output->toBool() || !$output->data) return $output;
$site_srl = $output->data->site_srl;
if($site_srl) {
$oModuleModel = &getModel('module');
$site_info = $oModuleModel->getSiteInfo($site_srl);
$domain = $site_info->domain;
}
// DB에서 menu_srl에 해당하는 메뉴 아이템 목록을 listorder순으로 구해옴
$args->menu_srl = $menu_srl;
$args->sort_index = 'listorder';
@ -400,11 +406,11 @@
'?>'.
'<root>%s</root>',
$header_script,
$this->getXmlTree($tree[0], $tree, $site_srl)
$this->getXmlTree($tree[0], $tree, $site_srl, $domain)
);
// php 캐시 파일 생성
$php_output = $this->getPhpCacheCode($tree[0], $tree, $site_srl);
$php_output = $this->getPhpCacheCode($tree[0], $tree, $site_srl, $domain);
$php_buff = sprintf(
'<?php '.
'if(!defined("__ZBXE__")) exit(); '.
@ -428,7 +434,7 @@
* 메뉴 xml파일은 node라는 tag가 중첩으로 사용되며 xml doc으로 관리자 페이지에서 메뉴를 구성해줌\n
* (tree_menu.js 에서 xml파일을 바로 읽고 tree menu를 구현)
**/
function getXmlTree($source_node, $tree, $site_srl) {
function getXmlTree($source_node, $tree, $site_srl, $domain) {
if(!$source_node) return;
$oMenuAdminModel = &getAdminModel('menu');
@ -437,7 +443,7 @@
$child_buff = "";
// 자식 노드의 데이터 가져옴
if($menu_item_srl&&$tree[$menu_item_srl]) $child_buff = $this->getXmlTree($tree[$menu_item_srl], $tree, $site_srl);
if($menu_item_srl&&$tree[$menu_item_srl]) $child_buff = $this->getXmlTree($tree[$menu_item_srl], $tree, $site_srl, $domain);
// 변수 정리
$names = $oMenuAdminModel->getMenuItemNames($node->name, $site_srl);
@ -448,7 +454,7 @@
$url = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->url);
if(preg_match('/^([0-9a-zA-Z\_\-]+)$/', $node->url)) {
$href = getUrl('','mid',$node->url);
$href = getSiteUrl($domain, '','mid',$node->url);
$pos = strpos($href, $_SERVER['HTTP_HOST']);
if($pos !== false) $href = substr($href, $pos+strlen($_SERVER['HTTP_HOST']));
} else $href = $url;
@ -511,7 +517,7 @@
* php로 캐시파일을 만들어서 db이용없이 바로 메뉴 정보를 구할 있도록 한다
* 캐시는 ModuleHandler::displayContent() 에서 include하여 Context::set() 한다
**/
function getPhpCacheCode($source_node, $tree, $site_srl) {
function getPhpCacheCode($source_node, $tree, $site_srl, $domain) {
$output = array("buff"=>"", "url_list"=>array());
if(!$source_node) return $output;
@ -519,7 +525,7 @@
foreach($source_node as $menu_item_srl => $node) {
// 자식 노드가 있으면 자식 노드의 데이터를 먼저 얻어옴
if($menu_item_srl&&$tree[$menu_item_srl]) $child_output = $this->getPhpCacheCode($tree[$menu_item_srl], $tree, $site_srl);
if($menu_item_srl&&$tree[$menu_item_srl]) $child_output = $this->getPhpCacheCode($tree[$menu_item_srl], $tree, $site_srl, $domain);
else $child_output = array("buff"=>"", "url_list"=>array());
// 변수 정리
@ -541,7 +547,7 @@
$href = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->href);
$url = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->url);
if(preg_match('/^([0-9a-zA-Z\_\-]+)$/i', $node->url)) {
$href = getUrl('','mid',$node->url);
$href = getSiteUrl($domain, '','mid',$node->url);
$pos = strpos($href, $_SERVER['HTTP_HOST']);
if($pos !== false) $href = substr($href, $pos+strlen($_SERVER['HTTP_HOST']));
} else $href = $url;

View file

@ -34,6 +34,14 @@
$lang->lang_code = "언어 코드";
$lang->filebox = "파일박스";
$lang->access_type = '접속 방법';
$lang->access_domain = 'Doamin 접속';
$lang->access_sid = 'Site ID 접속';
$lang->about_domain = "In order to create more than one virtual site, each of them needs to have own domain name.<br />Sub-domain (e.g., aaa.bbb.com of bbb.com) also can be used. Input the address including the path installed xe. <br /> ex) www.xpressengine.com/xe";
$lang->about_sid = '별도의 도메인이 아닌 http://XE주소/ID 로 접속할 수 있습니다. 모듈명(mid)와 중복될 수 없습니다.<br/>첫글자는 영문으로 시작해야 하고 영문과 숫자 그리고 _ 만 사용할 수 있습니다';
$lang->msg_already_registed_sid = '이미 등록된 사이트 ID 입니다. 게시판등의 mid와도 중복이 되지 않습니다. 다른 ID를 입력해주세요.';
$lang->msg_already_registed_domain = "It is already registered domain name. Please use the different one.";
$lang->header_script = "Header Script";
$lang->about_header_script = "You can input the html script between &lt;header&gt; and &lt;/header&gt; by yourself.<br />You can use &lt;script, &lt;style or &lt;meta tag";

View file

@ -34,6 +34,14 @@
$lang->lang_code = "언어 코드";
$lang->filebox = "파일박스";
$lang->access_type = '접속 방법';
$lang->access_domain = 'Doamin 접속';
$lang->access_sid = 'Site ID 접속';
$lang->about_domain = 'Para crear un dominio privado de la site requiere. <br/> Independiente de dominio o subdominio, y XE está instalado, el camino que en su conjunto. <br /> Ej.) www.xpressengine.com / zbxe';
$lang->about_sid = '별도의 도메인이 아닌 http://XE주소/ID 로 접속할 수 있습니다. 모듈명(mid)와 중복될 수 없습니다.<br/>첫글자는 영문으로 시작해야 하고 영문과 숫자 그리고 _ 만 사용할 수 있습니다';
$lang->msg_already_registed_sid = '이미 등록된 사이트 ID 입니다. 게시판등의 mid와도 중복이 되지 않습니다. 다른 ID를 입력해주세요.';
$lang->msg_already_registed_domain = 'Ya es de dominio registrado. Por favor, use un dominio diferente';
$lang->header_script = "헤더 스크립트";
$lang->about_header_script = "html의 &lt;header&gt;와 &lt;/header&gt; 사이에 들어가는 코드를 직접 입력할 수 있습니다.<br />&lt;script, &lt;style 또는 &lt;meta 태그등을 이용하실 수 있습니다";

View file

@ -34,6 +34,13 @@
$lang->lang_code = "언어 코드";
$lang->filebox = "파일박스";
$lang->access_type = '접속 방법';
$lang->access_domain = 'Doamin 접속';
$lang->access_sid = 'Site ID 접속';
$lang->about_sid = '별도의 도메인이 아닌 http://XE주소/ID 로 접속할 수 있습니다. 모듈명(mid)와 중복될 수 없습니다.<br/>첫글자는 영문으로 시작해야 하고 영문과 숫자 그리고 _ 만 사용할 수 있습니다';
$lang->msg_already_registed_sid = '이미 등록된 사이트 ID 입니다. 게시판등의 mid와도 중복이 되지 않습니다. 다른 ID를 입력해주세요.';
$lang->msg_already_registed_domain = '이미 등록된 도메인입니다. 다른 도메인을 사용해주세요';
$lang->header_script = "Script en-tête";
$lang->about_header_script = "Vous pouvez entrer un script en html par vous-même entre &lt;header&gt; et &lt;/header&gt;.<br />Vous pouvez utiliser &lt;script, &lt;style ou &lt;meta tag";

View file

@ -34,6 +34,14 @@
$lang->lang_code = "言語コード";
$lang->filebox = "ファイルボックス";
$lang->access_type = '접속 방법';
$lang->access_domain = 'Doamin 접속';
$lang->access_sid = 'Site ID 접속';
$lang->about_domain = "複数のホームページを作成するためには、「オリジナルドメイン」や「サブ ドメイン」のような専用のドメインが必要です。<br />また、 XEインストールパスも一緒に記入して下さい。<br />ex) www.xpressengine.com/xe";
$lang->about_sid = '별도의 도메인이 아닌 http://XE주소/ID 로 접속할 수 있습니다. 모듈명(mid)와 중복될 수 없습니다.<br/>첫글자는 영문으로 시작해야 하고 영문과 숫자 그리고 _ 만 사용할 수 있습니다';
$lang->msg_already_registed_sid = '이미 등록된 사이트 ID 입니다. 게시판등의 mid와도 중복이 되지 않습니다. 다른 ID를 입력해주세요.';
$lang->msg_already_registed_domain = "既に登録されているドメインです。異なるドメインを利用して下さい。";
$lang->header_script = "ヘッダースクリプト";
$lang->about_header_script = "HTMLの&lt;header&gt;と&lt;/header&gt;の間に入れるコードを直接入力出来ます。<br />&lt;script、&lt;styleまたは&lt;metaタグなどが利用出来ます";

View file

@ -34,6 +34,14 @@
$lang->lang_code = '언어 코드';
$lang->filebox = '파일박스';
$lang->access_type = '접속 방법';
$lang->access_domain = 'Doamin 접속';
$lang->access_sid = 'Site ID 접속';
$lang->about_domain = '1개 이상의 사이트를 만들기 위해서는 전용 도메인이 있어야 합니다.<br/>독립 도메인이나 서브 도메인이 있으면 되고 XE가 설치된 경로까지 같이 넣어주세요.<br />ex) www.xpressengine.com/xe';
$lang->about_sid = '별도의 도메인이 아닌 http://XE주소/ID 로 접속할 수 있습니다. 모듈명(mid)와 중복될 수 없습니다.<br/>첫글자는 영문으로 시작해야 하고 영문과 숫자 그리고 _ 만 사용할 수 있습니다';
$lang->msg_already_registed_sid = '이미 등록된 사이트 ID 입니다. 게시판등의 mid와도 중복이 되지 않습니다. 다른 ID를 입력해주세요.';
$lang->msg_already_registed_domain = '이미 등록된 도메인입니다. 다른 도메인을 사용해주세요';
$lang->header_script = '헤더 스크립트';
$lang->about_header_script = 'html의 &lt;head&gt;와 &lt;/head&gt; 사이에 들어가는 코드를 직접 입력할 수 있습니다.<br />&lt;script, &lt;style 또는 &lt;meta 태그등을 이용하실 수 있습니다';

View file

@ -33,6 +33,13 @@
$lang->lang_code = "언어 코드";
$lang->filebox = "파일박스";
$lang->access_type = '접속 방법';
$lang->access_domain = 'Doamin 접속';
$lang->access_sid = 'Site ID 접속';
$lang->about_sid = '별도의 도메인이 아닌 http://XE주소/ID 로 접속할 수 있습니다. 모듈명(mid)와 중복될 수 없습니다.<br/>첫글자는 영문으로 시작해야 하고 영문과 숫자 그리고 _ 만 사용할 수 있습니다';
$lang->msg_already_registed_sid = '이미 등록된 사이트 ID 입니다. 게시판등의 mid와도 중복이 되지 않습니다. 다른 ID를 입력해주세요.';
$lang->msg_already_registed_domain = '이미 등록된 도메인입니다. 다른 도메인을 사용해주세요';
$lang->module_copy = "Копировать модуль";
$lang->header_script = "헤더 스크립트";

View file

@ -34,6 +34,14 @@
$lang->lang_code = "语言变量";
$lang->filebox = "文件管理";
$lang->access_type = '접속 방법';
$lang->access_domain = 'Doamin 접속';
$lang->access_sid = 'Site ID 접속';
$lang->about_domain = "要创建一个站点必须有一个专用域名。<br/>一级域名或二级域名皆可。输入的时候请把XE安装路径也一起输入。<br />ex) www.xpressengine.com/xe";
$lang->about_sid = '별도의 도메인이 아닌 http://XE주소/ID 로 접속할 수 있습니다. 모듈명(mid)와 중복될 수 없습니다.<br/>첫글자는 영문으로 시작해야 하고 영문과 숫자 그리고 _ 만 사용할 수 있습니다';
$lang->msg_already_registed_sid = '이미 등록된 사이트 ID 입니다. 게시판등의 mid와도 중복이 되지 않습니다. 다른 ID를 입력해주세요.';
$lang->msg_already_registed_domain = "对不起!已有相同的域名。请重新输入。";
$lang->header_script = "文件头部脚本";
$lang->about_header_script = "可以直接输入插入到html中&lt;head&gt;区的代码。<br />可使用&lt;script, &lt;style 或 &lt;meta 等标签。";

View file

@ -33,6 +33,13 @@
$lang->bundle_grant_setup = '批次設定-權限管理';
$lang->lang_code = '語言代碼';
$lang->filebox = '檔案管理';
$lang->access_type = '접속 방법';
$lang->access_domain = 'Doamin 접속';
$lang->access_sid = 'Site ID 접속';
$lang->about_domain = "要建立網站必須要有個專屬域名。<br/>頂級域名或次級域名都可以。輸入時請將XE安裝路徑也一起輸入。<br />例) www.xpressengine.com/xe";
$lang->about_sid = '별도의 도메인이 아닌 http://XE주소/ID 로 접속할 수 있습니다. 모듈명(mid)와 중복될 수 없습니다.<br/>첫글자는 영문으로 시작해야 하고 영문과 숫자 그리고 _ 만 사용할 수 있습니다';
$lang->msg_already_registed_sid = '이미 등록된 사이트 ID 입니다. 게시판등의 mid와도 중복이 되지 않습니다. 다른 ID를 입력해주세요.';
$lang->msg_already_registed_domain = "已註冊的域名。請使用其他的網域。";
$lang->header_script = "Header Script";
$lang->about_header_script = "可以直接輸入並插入到HTML的&lt;head&gt;之間。<br />可使用&lt;script&gt;,&lt;style&gt;或&lt;meta&gt;等標籤。";

View file

@ -113,20 +113,26 @@
* @brief virtual site 생성
**/
function insertSite($domain, $index_module_srl) {
if(isSiteID($domain)) {
$oModuleModel = &getModel('module');
if($oModuleModel->isIDExists($domain, 0)) return new Object(-1,'msg_already_registed_sid');
}
$args->site_srl = getNextSequence();
$args->domain = preg_replace('/\/$/','',$domain);
$args->index_module_srl = $index_module_srl;
$output = executeQuery('module.insertSite', $args);
if(!$output->toBool()) return null;
if(!$output->toBool()) return $output;
return $args->site_srl;
$output->add('site_srl', $args->site_srl);
return $output;
}
/**
* @brief virtual site 수정
**/
function updateSite($args) {
return executeQuery('module.updateSite', $args);
$output = executeQuery('module.updateSite', $args);
return $output;
}
/**
@ -170,18 +176,15 @@
$output = $this->arrangeModuleInfo($args, $extra_vars);
if(!$output->toBool()) return $output;
// 이미 존재하는 모듈 이름인지 체크
if(!$args->site_srl) $args->site_srl = 0;
$oModuleModel = &getModel('module');
if($oModuleModel->isIDExists($args->mid, $args->site_srl)) return new Object(-1, 'msg_module_name_exists');
// begin transaction
$oDB = &DB::getInstance();
$oDB->begin();
// 이미 존재하는 모듈 이름인지 체크
if(!$args->site_srl) $args->site_srl = 0;
$output = executeQuery('module.isExistsModuleName', $args);
if(!$output->toBool() || $output->data->count) {
$oDB->rollback();
return new Object(-1, 'msg_module_name_exists');
}
// is_default 의 값에 따라서 처리
if($args->site_srl!=0) $args->is_default = 'N';
else {
@ -190,7 +193,6 @@
}
// 선택된 스킨정보에서 colorset을 구함
$oModuleModel = &getModel('module');
$module_path = ModuleHandler::getModulePath($args->module);
$skin_info = $oModuleModel->loadSkinInfo($module_path, $args->skin);
$skin_vars->colorset = $skin_info->colorset[0]->name;

View file

@ -13,6 +13,33 @@
function init() {
}
/**
* @brief mid, sid 사용할 있는지 검사
**/
function isIDExists($id, $site_srl = 0) {
// directory 및 rss/atom/api 등 예약어 검사
$dirs = FileHandler::readDir(_XE_PATH_);
$dirs[] = 'rss';
$dirs[] = 'atom';
$dirs[] = 'api';
if(in_array($id, $dirs)) return true;
// mid 검사
$args->mid = $id;
$args->site_srl = $site_srl;
$output = executeQuery('module.isExistsModuleName', $args);
if($output->data->count) return true;
// sid 검사 (site_srl이 0일때 즉 가상사이트가 아닌 경우 mid != sid임을 체크)
if(!$site_srl) {
$site_args->domain = $id;
$output = executeQuery('module.isExistsSiteDomain', $site_args);
if($output->data->count) return true;
}
return false;
}
/**
* @brief site 정보를 구함
**/
@ -42,19 +69,35 @@
* @brief domain에 따른 기본 mid를 구함
**/
function getDefaultMid() {
// domain 으로 등록된 virtual site가 있는지 확인
$url_info = parse_url(Context::getRequestUri());
$hostname = $url_info['host'];
$path = preg_replace('/\/$/','',$url_info['path']);
$sites_args->domain = sprintf('%s%s%s', $hostname, $url_info['port']&&$url_info['port']!=80?':'.$url_info['port']:'',$path);
$default_url = preg_replace('/\/$/','',Context::getDefaultUrl());
$request_url = preg_replace('/\/$/','',Context::getRequestUri());
$sid = Context::get('sid');
$mid = Context::get('mid');
$output = executeQuery('module.getSiteDefaultInfo', $sites_args);
// 기본 URL이 설정되어 있고 이 기본 URL과 요청 URL이 다르면 가상 사이트 확인
if($default_url && $default_url != $request_url) {
$url_info = parse_url($request_url);
$hostname = $url_info['host'];
$path = preg_replace('/\/$/','',$url_info['path']);
$sites_args->domain = sprintf('%s%s%s', $hostname, $url_info['port']&&$url_info['port']!=80?':'.$url_info['port']:'',$path);
$output = executeQuery('module.getSiteDefaultInfo', $sites_args);
} else {
if(!$sid) $sid = $mid;
if($sid) {
$sid_args->domain = $sid;
$output = executeQuery('module.getSiteInfoByDomain', $sid_args);
if($output->toBool() && $output->data) {
Context::set('sid', $output->data->domain, true);
if($mid==$output->data->domain) Context::set('mid',$output->data->mid,true);
}
}
}
// virtual site를 못 찾으면 가장 기본 모듈 추출
if(!$output->toBool() || !$output->data) {
if(!$output->data) {
$args->site_srl = 0;
$output = executeQuery('module.getDefaultMidInfo', $args);
}
$module_info = $output->data;
if(!$module_info->module_srl) return;
if(is_array($module_info) && $module_info->data[0]) $module_info = $module_info[0];
@ -66,7 +109,7 @@
**/
function getModuleInfoByMid($mid, $site_srl = 0) {
$args->mid = $mid;
$args->site_srl = $site_srl;
$args->site_srl = (int)$site_srl;
$output = executeQuery('module.getMidInfo', $args);
$module_info = $output->data;
if(!$module_info->module_srl && $module_info->data[0]) $module_info = $module_info->data[0];

View file

@ -8,6 +8,6 @@
<conditions>
<condition operation="equal" column="mid" var="mid" />
<condition operation="equal" column="module_srl" var="module_srl" pipe="and" />
<condition operation="equal" column="site_srl" var="site_srl" default="0" pipe="and" />
<condition operation="equal" column="site_srl" var="site_srl" default="0" pipe="and" notnull="notnull" />
</conditions>
</query>