Fix installation error

This commit is contained in:
Kijin Sung 2017-03-13 14:14:59 +09:00
parent 2e3e969767
commit 139bb8ac84

View file

@ -131,24 +131,27 @@ class ModuleHandler extends Handler
if (!$site_module_info || !isset($site_module_info->domain_srl) || $site_module_info->is_default_replaced)
{
$site_module_info = getModel('module')->getDefaultDomainInfo();
$domain_action = config('url.unregistered_domain_action') ?: 'redirect_301';
switch ($domain_action)
if ($site_module_info)
{
case 'redirect_301':
header('Location: ' . Context::getDefaultUrl($site_module_info) . RX_REQUEST_URL, true, 301);
return false;
$domain_action = config('url.unregistered_domain_action') ?: 'redirect_301';
switch ($domain_action)
{
case 'redirect_301':
header('Location: ' . Context::getDefaultUrl($site_module_info) . RX_REQUEST_URL, true, 301);
return false;
case 'redirect_302':
header('Location: ' . Context::getDefaultUrl($site_module_info) . RX_REQUEST_URL, true, 302);
return false;
case 'redirect_302':
header('Location: ' . Context::getDefaultUrl($site_module_info) . RX_REQUEST_URL, true, 302);
return false;
case 'block':
$this->error = 'The site does not exist';
$this->httpStatusCode = 404;
return true;
case 'display':
// pass
case 'block':
$this->error = 'The site does not exist';
$this->httpStatusCode = 404;
return true;
case 'display':
// pass
}
}
}