mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 01:01:41 +09:00
시스템 에러 메세지를 출력할 경우 403 HTTP 코드로 설정
This commit is contained in:
parent
9e78008fe6
commit
f930ec74f8
10 changed files with 35 additions and 27 deletions
|
|
@ -632,7 +632,7 @@ class ModuleHandler extends Handler
|
|||
{
|
||||
self::_setInputErrorToContext();
|
||||
|
||||
$this->error = 'msg_is_not_administrator';
|
||||
$this->error = 'admin.msg_is_not_administrator';
|
||||
$oMessageObject = self::getModuleInstance('message', $display_mode);
|
||||
$oMessageObject->setError(-1);
|
||||
$oMessageObject->setMessage($this->error);
|
||||
|
|
@ -646,7 +646,7 @@ class ModuleHandler extends Handler
|
|||
if(!$grant->manager)
|
||||
{
|
||||
self::_setInputErrorToContext();
|
||||
$this->error = 'msg_is_not_administrator';
|
||||
$this->error = 'admin.msg_is_not_administrator';
|
||||
$oMessageObject = self::getModuleInstance('message', $display_mode);
|
||||
$oMessageObject->setError(-1);
|
||||
$oMessageObject->setMessage($this->error);
|
||||
|
|
@ -658,7 +658,7 @@ class ModuleHandler extends Handler
|
|||
if(!$grant->is_admin && $this->module != $this->orig_module->module && $xml_info->permission->{$this->act} != 'manager')
|
||||
{
|
||||
self::_setInputErrorToContext();
|
||||
$this->error = 'msg_is_not_administrator';
|
||||
$this->error = 'admin.msg_is_not_administrator';
|
||||
$oMessageObject = self::getModuleInstance('message', $display_mode);
|
||||
$oMessageObject->setError(-1);
|
||||
$oMessageObject->setMessage($this->error);
|
||||
|
|
@ -914,10 +914,13 @@ class ModuleHandler extends Handler
|
|||
$oMessageObject->setMessage($this->error);
|
||||
$oMessageObject->dispMessage();
|
||||
|
||||
if($oMessageObject->getHttpStatusCode() && $oMessageObject->getHttpStatusCode() != '200')
|
||||
if($oMessageObject->getHttpStatusCode() && $oMessageObject->getHttpStatusCode() !== '200')
|
||||
{
|
||||
self::_setHttpStatusMessage($oMessageObject->getHttpStatusCode());
|
||||
$oMessageObject->setTemplateFile('http_status_code');
|
||||
if($oMessageObject->getHttpStatusCode() !== '403')
|
||||
{
|
||||
$oMessageObject->setTemplateFile('http_status_code');
|
||||
}
|
||||
}
|
||||
|
||||
// If module was called normally, change the templates of the module into ones of the message view module
|
||||
|
|
@ -925,6 +928,7 @@ class ModuleHandler extends Handler
|
|||
{
|
||||
$oModule->setTemplatePath($oMessageObject->getTemplatePath());
|
||||
$oModule->setTemplateFile($oMessageObject->getTemplateFile());
|
||||
$oModule->setHttpStatusCode($oMessageObject->getHttpStatusCode());
|
||||
// Otherwise, set message instance as the target module
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -191,7 +191,7 @@ class ModuleObject extends Object
|
|||
{
|
||||
case 'root' :
|
||||
case 'manager' :
|
||||
$this->stop('msg_is_not_administrator');
|
||||
$this->stop('admin.msg_is_not_administrator');
|
||||
return;
|
||||
case 'member' :
|
||||
if(!$is_logged)
|
||||
|
|
|
|||
|
|
@ -203,7 +203,7 @@
|
|||
|
||||
// If the response contains an error, display the error message.
|
||||
if(data.error != "0" && data.error > -1000) {
|
||||
if(data.error == -1 && data.message == "msg_is_not_administrator") {
|
||||
if(data.error == -1 && data.message == "admin.msg_is_not_administrator") {
|
||||
alert("You are not logged in as an administrator.");
|
||||
if ($.isFunction(callback_error)) {
|
||||
callback_error(data);
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ class adminAdminController extends admin
|
|||
$logged_info = $oMemberModel->getLoggedInfo();
|
||||
if($logged_info->is_admin != 'Y')
|
||||
{
|
||||
return $this->stop("msg_is_not_administrator");
|
||||
return $this->stop("admin.msg_is_not_administrator");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ class adminAdminView extends admin
|
|||
$logged_info = $oMemberModel->getLoggedInfo();
|
||||
if($logged_info->is_admin != 'Y')
|
||||
{
|
||||
return $this->stop("msg_is_not_administrator");
|
||||
return $this->stop("admin.msg_is_not_administrator");
|
||||
}
|
||||
|
||||
// change into administration layout
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ class adminloggingController extends adminlogging
|
|||
$logged_info = $oMemberModel->getLoggedInfo();
|
||||
if($logged_info->is_admin != 'Y')
|
||||
{
|
||||
return $this->stop("msg_is_not_administrator");
|
||||
return $this->stop("admin.msg_is_not_administrator");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue