mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-08 03:01:43 +09:00
#18702288 : fixed bugs in permission of editor component
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@7402 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
f4ec255afa
commit
7a0f0d64ea
2 changed files with 48 additions and 3 deletions
|
|
@ -359,7 +359,15 @@
|
|||
|
||||
if($component->extra_vars) {
|
||||
$extra_vars = unserialize($component->extra_vars);
|
||||
if($extra_vars->target_group) {
|
||||
$xml_info->target_group = $extra_vars->target_group;
|
||||
}
|
||||
|
||||
if($extra_vars->mid_list && count($extra_vars->mid_list))
|
||||
{
|
||||
$xml_info->mid_list = $extra_vars->mid_list;
|
||||
}
|
||||
/*
|
||||
// 사용권한이 있으면 권한 체크
|
||||
if($extra_vars->target_group) {
|
||||
// 사용권한이 체크되어 있는데 로그인이 되어 있지 않으면 무조건 사용 중지
|
||||
|
|
@ -382,7 +390,7 @@
|
|||
// 대상 모듈이 있으면 체크
|
||||
if($extra_vars->mid_list && count($extra_vars->mid_list) && Context::get('mid')) {
|
||||
if(!in_array(Context::get('mid'), $extra_vars->mid_list)) continue;
|
||||
}
|
||||
}*/
|
||||
|
||||
// 에디터 컴포넌트의 설정 정보를 체크
|
||||
if($xml_info->extra_vars) {
|
||||
|
|
|
|||
|
|
@ -556,14 +556,23 @@
|
|||
* @brief component 목록을 return (DB정보 보함)
|
||||
**/
|
||||
function getComponentList($filter_enabled = true, $site_srl=0) {
|
||||
$cache_file = $this->getCacheFile($filter_enabled, $site_srl);
|
||||
$cache_file = $this->getCacheFile(false, $site_srl);
|
||||
if(!file_exists($cache_file)) {
|
||||
$oEditorController = &getController('editor');
|
||||
$oEditorController->makeCache($filter_enabled, $site_srl);
|
||||
$oEditorController->makeCache(false, $site_srl);
|
||||
}
|
||||
|
||||
if(!file_exists($cache_file)) return;
|
||||
@include($cache_file);
|
||||
$logged_info = Context::get('logged_info');
|
||||
if($logged_info && is_array($logged_info->group_list))
|
||||
{
|
||||
$group_list = array_keys($logged_info->group_list);
|
||||
}
|
||||
else
|
||||
{
|
||||
$group_list = array();
|
||||
}
|
||||
|
||||
if(count($component_list)) {
|
||||
foreach($component_list as $key => $val) {
|
||||
|
|
@ -572,6 +581,34 @@
|
|||
FileHandler::removeFile($cache_file);
|
||||
return $this->getComponentList($filter_enabled, $site_srl);
|
||||
}
|
||||
if($val->enabled == "N") {
|
||||
unset($component_list->{$key});
|
||||
continue;
|
||||
}
|
||||
if($logged_info->is_admin == "Y" || $logged_info->is_site_admin == "Y") continue;
|
||||
if($val->target_group)
|
||||
{
|
||||
if(!$logged_info) {
|
||||
$val->enabled = "N";
|
||||
}
|
||||
else {
|
||||
$is_granted = false;
|
||||
foreach($group_list as $group_srl)
|
||||
{
|
||||
if(in_array($group_srl, $val->target_group)) $is_granted = true;
|
||||
}
|
||||
if(!$is_granted) $val->enabled = "N";
|
||||
}
|
||||
}
|
||||
if($val->enabled != "N" && $val->mid_list)
|
||||
{
|
||||
$mid = Context::get('mid');
|
||||
if(!in_array($mid, $val->mid_list)) $val->enabled = "N";
|
||||
}
|
||||
if($val->enabled == "N") {
|
||||
unset($component_list->{$key});
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue