시스템 에러 메세지를 출력할 경우 403 HTTP 코드로 설정

This commit is contained in:
conory 2016-04-18 23:43:04 +09:00
parent 9e78008fe6
commit f930ec74f8
10 changed files with 35 additions and 27 deletions

View file

@ -20,12 +20,15 @@ class messageMobile extends messageView
$config = $oModuleModel->getModuleConfig('message');
if(!is_object($config)) $config = new stdClass;
if(!$config->mskin) $config->mskin = 'default';
// Set the template path
$template_path = sprintf('%sm.skins/%s', $this->module_path, $config->mskin);
// Get the member configuration
$oModuleModel = getModel('module');
$member_config = $oModuleModel->getModuleConfig('member');
Context::set('member_config', $member_config);
// Set a flag to check if the https connection is made when using SSL and create https url
$ssl_mode = false;
if($member_config->enable_ssl == 'Y')
@ -41,6 +44,12 @@ class messageMobile extends messageView
$this->setTemplatePath($template_path);
$this->setTemplateFile('system_message');
// Default 403 Error
if(!$this->getHttpStatusCode() || $this->getHttpStatusCode() === '200')
{
$this->setHttpStatusCode('403');
}
}
}
/* End of file message.mobile.php */

View file

@ -31,27 +31,16 @@ class messageView extends message
if(!$config->skin)
{
$config->skin = 'xedition';
$template_path = sprintf('%sskins/%s', $this->module_path, $config->skin);
}
else
{
//check theme
$config_parse = explode('|@|', $config->skin);
if (count($config_parse) > 1)
{
$template_path = sprintf('./themes/%s/modules/message/', $config_parse[0]);
}
else
{
$template_path = sprintf('%sskins/%s', $this->module_path, $config->skin);
}
}
$template_path = sprintf('%sskins/%s', $this->module_path, $config->skin);
// Template path
$this->setTemplatePath($template_path);
// Get the member configuration
$member_config = $oModuleModel->getModuleConfig('member');
Context::set('member_config', $member_config);
// Set a flag to check if the https connection is made when using SSL and create https url
$ssl_mode = false;
if($member_config->enable_ssl == 'Y')
@ -64,6 +53,12 @@ class messageView extends message
Context::set('system_message_detail', nl2br($detail));
$this->setTemplateFile('system_message');
// Default 403 Error
if(!$this->getHttpStatusCode() || $this->getHttpStatusCode() === '200')
{
$this->setHttpStatusCode('403');
}
}
}
/* End of file message.view.php */

View file

@ -11,7 +11,7 @@ section{margin-top:20px}
</style>
<section>
<div>
<h1>404 Not Found</h1>
<h1>{$http_status_code} {$http_status_message}</h1>
<p>{$lang->msg_module_is_not_exists}</p>
</div>
</section>

View file

@ -30,7 +30,7 @@
<!--// BODY -->
<section class="xedition-error">
<h1>404</h1>
<p>Oops, Sorry.<br>Page is not found!</p>
<h1>{$http_status_code}</h1>
<p>Oops, Sorry.<br>Page is {$http_status_message}!</p>
<img src="./img/error.png" width="340" height="400" />
</section>