mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-05 17:51:40 +09:00
Implement domain deletion
This commit is contained in:
parent
1feb506b3c
commit
e7c5d884e8
6 changed files with 62 additions and 4 deletions
|
|
@ -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.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@
|
|||
<action name="procAdminUpdateSEO" type="controller" />
|
||||
<action name="procAdminUpdateSitelock" type="controller" />
|
||||
<action name="procAdminInsertDomain" type="controller" />
|
||||
<action name="procAdminDeleteDomain" type="controller" />
|
||||
<action name="procAdminUpdateFTPInfo" type="controller" />
|
||||
<action name="procAdminRemoveFTPInfo" type="controller" />
|
||||
<action name="procAdminFaviconUpload" type="controller" />
|
||||
|
|
|
|||
|
|
@ -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.<br />Selecting \'Always\' is to use SSL for the entire pages, generated by Rhymix.<br>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.';
|
||||
|
|
|
|||
|
|
@ -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)을 사용합니다.<br>\'항상 사용\'은 사이트 전체에 HTTPS를 사용합니다.<br>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 = '이미 등록된 도메인입니다.';
|
||||
|
|
|
|||
|
|
@ -35,7 +35,12 @@
|
|||
<td class="nowr">
|
||||
<a href="{getUrl('', 'module', 'admin', 'act', 'dispAdminInsertDomain', 'domain_srl', $domain->domain_srl)}">{$lang->cmd_modify}</a>
|
||||
/
|
||||
<a href="{getUrl('', 'module', 'admin', 'act', 'dispAdminDeleteDomain', 'domain_srl', $domain->domain_srl)}">{$lang->cmd_delete}</a>
|
||||
<block cond="$domain->is_default_domain !== 'Y'">
|
||||
<a href="#" data-domain="{$domain->domain}" data-domain-srl="{$domain->domain_srl}" class="delete_domain">{$lang->cmd_delete}</a>
|
||||
</block>
|
||||
<block cond="$domain->is_default_domain === 'Y'">
|
||||
<span style="color:#aaa">{$lang->cmd_delete}</span>
|
||||
</block>
|
||||
</td>
|
||||
</tr>
|
||||
<tr cond="$page_navigation->total_count == 0">
|
||||
|
|
@ -102,3 +107,18 @@
|
|||
</div>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
$("a.delete_domain").on("click", function(event) {
|
||||
event.preventDefault();
|
||||
var domain = $(this).data("domain");
|
||||
var domain_srl = $(this).data("domain-srl");
|
||||
if (confirm({$lang->cmd_delete_domain|json} + "\n" + domain)) {
|
||||
exec_json('admin.procAdminDeleteDomain', { domain_srl: domain_srl }, function() {
|
||||
window.location.reload();
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue