mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-02 01:52:10 +09:00
Improve granularity of Context security check
정규식에 따라 모두 막을지, 관리자만 허용할지 구분할 수 있도록 하고 이를 참조하여 <script> 태그는 관리자만 허용, PHP 태그는 모두 막도록 변경.
This commit is contained in:
parent
06349cdd98
commit
f8b0ca6a78
2 changed files with 30 additions and 14 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue