mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-19 11:19:56 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/trunk@119 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
a347783ce9
commit
f0edc7f054
16 changed files with 156 additions and 66 deletions
|
|
@ -57,14 +57,14 @@
|
|||
}
|
||||
|
||||
// 해당 모듈의 conf/action.xml 을 분석하여 action 정보를 얻어옴
|
||||
$action_info = $oModuleModel->getActionInfo($module);
|
||||
$xml_info = $oModuleModel->getModuleXmlInfo($module);
|
||||
|
||||
// 현재 요청된 act가 있으면 $action_info에서 type을 찾음, 없다면 기본 action을 이용
|
||||
if(!$act || !$action_info->{$act}) $act = $action_info->default_action;
|
||||
// 현재 요청된 act가 있으면 $xml_info에서 type을 찾음, 없다면 기본 action을 이용
|
||||
if(!$act || !$xml_info->{$act}) $act = $xml_info->default_action;
|
||||
|
||||
// type, grant 값 구함
|
||||
$type = $action_info->{$act}->type;
|
||||
$grant = $action_info->{$act}->grant;
|
||||
$type = $xml_info->action->{$act}->type;
|
||||
$grant = $xml_info->action->{$act}->grant;
|
||||
|
||||
// act값을 Context에 세팅
|
||||
Context::set('act', $act, true);
|
||||
|
|
@ -73,7 +73,7 @@
|
|||
$oModule = &$this->getModuleInstance($module, $type);
|
||||
|
||||
// 모듈 정보 세팅
|
||||
$oModule->setModuleInfo($module_info);
|
||||
$oModule->setModuleInfo($module_info, $xml_info);
|
||||
|
||||
if(!is_object($oModule)) return;
|
||||
|
||||
|
|
|
|||
|
|
@ -42,7 +42,8 @@
|
|||
/**
|
||||
* @brief 모듈의 정보 세팅
|
||||
**/
|
||||
function setModuleInfo($module_info) {
|
||||
function setModuleInfo($module_info, $xml_info) {
|
||||
|
||||
// 기본 변수 설정
|
||||
$this->mid = $module_info->mid;
|
||||
$this->module = $module_info->module;
|
||||
|
|
@ -63,29 +64,43 @@
|
|||
}
|
||||
|
||||
// 권한 설정
|
||||
if($this->grant_list) {
|
||||
foreach($this->grant_list as $grant_name) {
|
||||
if($xml_info->grant) {
|
||||
foreach($xml_info->grant as $grant_name => $grant_item) {
|
||||
$title = $grant_item->title;
|
||||
$default = $grant_item->default;
|
||||
|
||||
$grant->{$grant_name} = false;
|
||||
|
||||
if($grant->is_admin || !$this->module_info->grant[$grant_name]) {
|
||||
if($grant->is_admin) {
|
||||
$grant->{$grant_name} = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
if(count($user_group)) {
|
||||
foreach($user_group as $group_srl) {
|
||||
if(in_array($group_srl, $this->module_info->grant[$grant_name])) {
|
||||
if(in_array($group_srl, $this->module_info->grants[$grant_name])) {
|
||||
$grant->{$grant_name} = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
switch($default) {
|
||||
case 'guest' :
|
||||
$grant->{$grant_name} = true;
|
||||
break;
|
||||
case 'member' :
|
||||
if($is_logged) $grant->{$grant_name} = true;
|
||||
break;
|
||||
case 'root' :
|
||||
if($grant->is_admin) $grant->{$grant_name} = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 권한변수 설정
|
||||
$this->grant = $grant;
|
||||
Context::set('grant',$this->grant);
|
||||
|
||||
// 모듈의 init method 실행
|
||||
$this->init();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue