mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-16 09:49:54 +09:00
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:
parent
40e1740839
commit
bb97446dfc
40 changed files with 313 additions and 189 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue