Improve granularity of Context security check

정규식에 따라 모두 막을지, 관리자만 허용할지 구분할 수 있도록 하고
이를 참조하여 <script> 태그는 관리자만 허용, PHP 태그는 모두 막도록 변경.
This commit is contained in:
Kijin Sung 2018-10-13 16:42:19 +09:00
parent 06349cdd98
commit f8b0ca6a78
2 changed files with 30 additions and 14 deletions

View file

@ -42,11 +42,23 @@ class ModuleHandler extends Handler
return;
}
// Check security check status
$oContext = Context::getInstance();
if($oContext->isSuccessInit === false)
switch($oContext->security_check)
{
$this->error = 'msg_security_violation';
return;
case 'OK':
break;
case 'ALLOW ADMIN ONLY':
if(!Context::get('logged_info')->isAdmin())
{
$this->error = 'msg_security_violation';
return;
}
break;
case 'DENY ALL':
default:
$this->error = 'msg_security_violation';
return;
}
// Set variables from request arguments