diff --git a/modules/admin/admin.admin.controller.php b/modules/admin/admin.admin.controller.php index cad2d977c..6b7970ed8 100644 --- a/modules/admin/admin.admin.controller.php +++ b/modules/admin/admin.admin.controller.php @@ -1152,6 +1152,41 @@ class adminAdminController extends admin $this->setRedirectUrl(Context::get('success_return_url') ?: getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAdminConfigGeneral')); } + /** + * Delete domain + * @return void + */ + function procAdminDeleteDomain() + { + // Get selected domain. + $domain_srl = strval(Context::get('domain_srl')); + if ($domain_srl === '') + { + return new Object(-1, 'msg_domain_not_found'); + } + $domain_info = getModel('module')->getSiteInfo($domain_srl); + if ($domain_info->domain_srl != $domain_srl) + { + return new Object(-1, 'msg_domain_not_found'); + } + if ($domain_info->is_default_domain === 'Y') + { + return new Object(-1, 'msg_cannot_delete_default_domain'); + } + + // Delete the domain. + $args = new stdClass(); + $args->domain_srl = $domain_srl; + $output = executeQuery('module.deleteDomain', $args); + if (!$output->toBool()) + { + return $output; + } + + // Clear cache. + Rhymix\Framework\Cache::clearGroup('site_and_module'); + } + /** * Update FTP configuration. */ diff --git a/modules/admin/admin.admin.view.php b/modules/admin/admin.admin.view.php index ceaebc594..629aef1ed 100644 --- a/modules/admin/admin.admin.view.php +++ b/modules/admin/admin.admin.view.php @@ -660,13 +660,12 @@ class adminAdminView extends admin $domain_info = getModel('module')->getSiteInfo($domain_srl); if ($domain_info->domain_srl != $domain_srl) { - $domain_info = null; + return new Object(-1, 'msg_domain_not_found'); } } Context::set('domain_info', $domain_info); // Get modules. - $module_list = getModel('module')->getMidList(); if ($domain_info && $domain_info->index_module_srl) { $index_module_srl = $domain_info->index_module_srl; @@ -675,7 +674,6 @@ class adminAdminView extends admin { $index_module_srl = ''; } - Context::set('module_list', $module_list); Context::set('index_module_srl', $index_module_srl); // Get language list. diff --git a/modules/admin/conf/module.xml b/modules/admin/conf/module.xml index 3e37647ff..3efb17ca9 100644 --- a/modules/admin/conf/module.xml +++ b/modules/admin/conf/module.xml @@ -33,6 +33,7 @@ + diff --git a/modules/admin/lang/en.php b/modules/admin/lang/en.php index 86c92adca..3bd52af71 100644 --- a/modules/admin/lang/en.php +++ b/modules/admin/lang/en.php @@ -125,6 +125,7 @@ $lang->cmd_unregistered_domain_redirect_301 = '301 Redirect to Default Domain (R $lang->cmd_unregistered_domain_redirect_302 = '302 Redirect to Default Domain'; $lang->cmd_unregistered_domain_display = 'Display Main Screen as Usual'; $lang->cmd_unregistered_domain_block = '404 Not Found'; +$lang->cmd_delete_domain = 'Would you like to delete this domain?'; $lang->about_use_ssl = 'Selecting \'Optional\' is to use SSL for the specified actions such as signing up and changing information.
Selecting \'Always\' is to use SSL for the entire pages, generated by Rhymix.
Please be careful! You may not be able to access to the site, before installing SSL certificate.'; $lang->server_ports = 'Server Port'; $lang->about_server_ports = 'If your web server does not use 80 for HTTP or 443 for HTTPS port, you should specify server ports.'; diff --git a/modules/admin/lang/ko.php b/modules/admin/lang/ko.php index 46f020d02..4d15b47d9 100644 --- a/modules/admin/lang/ko.php +++ b/modules/admin/lang/ko.php @@ -124,9 +124,12 @@ $lang->cmd_unregistered_domain_redirect_301 = '기본 도메인으로 301 Redire $lang->cmd_unregistered_domain_redirect_302 = '기본 도메인으로 302 Redirect'; $lang->cmd_unregistered_domain_display = '메인 화면 표시'; $lang->cmd_unregistered_domain_block = '404 Not Found 오류 표시'; +$lang->cmd_delete_domain = '이 도메인을 삭제하시겠습니까?'; $lang->about_use_ssl = '\'선택적으로 사용\'은 회원가입, 정보수정 등의 지정된 동작(action)에서만 보안접속(HTTPS)을 사용합니다.
\'항상 사용\'은 사이트 전체에 HTTPS를 사용합니다.
SSL 인증서가 설치되지 않은 상태에서 HTTPS 사용을 시도하면 접속이 되지 않을 수 있으니 주의하시기 바랍니다.'; $lang->server_ports = '포트'; $lang->about_server_ports = 'HTTP는 80, HTTPS는 443 이 아닌, 다른 포트를 사용할 경우에 포트를 지정해 주어야 합니다.'; +$lang->msg_domain_not_found = '도메인을 찾을 수 없습니다.'; +$lang->msg_cannot_delete_default_domain = '기본 도메인은 삭제할 수 없습니다.'; $lang->msg_site_title_is_empty = '사이트 제목을 입력해 주십시오.'; $lang->msg_invalid_domain = '올바르지 않은 도메인입니다.'; $lang->msg_domain_already_exists = '이미 등록된 도메인입니다.'; diff --git a/modules/admin/tpl/config_domains.html b/modules/admin/tpl/config_domains.html index a7b3ffb19..463746771 100644 --- a/modules/admin/tpl/config_domains.html +++ b/modules/admin/tpl/config_domains.html @@ -35,7 +35,12 @@ {$lang->cmd_modify} / - {$lang->cmd_delete} + + {$lang->cmd_delete} + + + {$lang->cmd_delete} + @@ -102,3 +107,18 @@ + +