게시판/블로그/방명록등의 추가설정/권한설정/레이아웃편집등에서 관리자지정이 되거나 관리그룹으로 되면 정상적으로 관리를 할 수 있도록 기능 수정

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@3493 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
zero 2008-01-08 04:23:45 +00:00
parent b73c48ecbc
commit 19e8df6405
9 changed files with 241 additions and 26 deletions

View file

@ -165,5 +165,39 @@
$oPointAdminController->cacheActList();
}
/**
* @brief 권한 체크를 실행하는 method
* 모듈 객체가 생성된 경우는 직접 권한을 체크하지만 기능성 모듈등 스스로 객체를 생성하지 않는 모듈들의 경우에는
* ModuleObject에서 직접 method를 호출하여 권한을 확인함
*
* isAdminGrant는 관리권한 이양시에만 사용되도록 하고 기본은 false로 return 되도록 하여 잘못된 권한 취약점이 생기지 않도록 주의하여야
**/
function isAdmin() {
// 로그인이 되어 있지 않으면 무조건 return false
$is_logged = Context::get('is_logged');
if(!$is_logged) return false;
// 사용자 아이디를 구함
$logged_info = Context::get('logged_info');
// 모듈 요청에 사용된 변수들을 가져옴
$args = Context::getRequestVars();
// act의 값에 따라서 관리 권한 체크
switch($args->act) {
case 'procPointAdminInsertPointModuleConfig' :
if(!$args->target_module_srl) return false;
$oModuleModel = &getModel('module');
$module_info = $oModuleModel->getModuleInfoByModuleSrl($args->target_module_srl);
if(!$module_info) return false;
if($oModuleModel->isModuleAdmin($module_info, $logged_info)) return true;
break;
}
return false;
}
}
?>