mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-05 09:41:40 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/trunk@5 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
3bf018c5fa
commit
299ee5fecb
6 changed files with 108 additions and 53 deletions
|
|
@ -47,6 +47,47 @@
|
|||
$template_path = $this->module_path.'skins/'.$this->skin;
|
||||
$this->setTemplatePath($template_path);
|
||||
}
|
||||
|
||||
$oMember = getModule('member');
|
||||
$user_id = $oMember->getUserID();
|
||||
$logged_info = $oMember->getLoggedInfo();
|
||||
$user_group = $logged_info->group_list;
|
||||
$user_group_count = count($user_group);
|
||||
|
||||
// 로그인되어 있다면 admin 체크
|
||||
if($oMember->isLogged() && ($logged_info->is_admin == 'Y' || in_array($user_id, $this->module_info->admin_id) )) {
|
||||
$grant->is_admin = true;
|
||||
} else {
|
||||
$grant->is_admin = false;
|
||||
}
|
||||
|
||||
// 권한 설정
|
||||
if($this->grant_list) {
|
||||
|
||||
foreach($this->grant_list as $grant_name) {
|
||||
$grant->{$grant_name} = false;
|
||||
|
||||
if($grant->is_admin || !$this->module_info->grant[$grant_name]) {
|
||||
$grant->{$grant_name} = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
if($user_group_count) {
|
||||
foreach($user_group as $group_srl) {
|
||||
if(in_array($group_srl, $this->module_info->grant[$grant_name])) {
|
||||
$grant->{$grant_name} = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 권한변수 설정
|
||||
Context::set('grant',$grant);
|
||||
|
||||
// 모듈의 init method 실행
|
||||
$this->init();
|
||||
}/*}}}*/
|
||||
|
||||
// public boolean isExistsAct($act)/*{{{*/
|
||||
|
|
|
|||
|
|
@ -381,7 +381,8 @@
|
|||
|
||||
if(count($grant_list)) {
|
||||
foreach($grant_list as $grant) {
|
||||
$arr_grant[$grant] = explode(',',Context::get($grant));
|
||||
$group_srls = Context::get($grant);
|
||||
if($group_srls) $arr_grant[$grant] = explode(',',Context::get($grant));
|
||||
}
|
||||
$grant = serialize($arr_grant);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,12 +52,12 @@
|
|||
|
||||
// 초기화
|
||||
function init() {/*{{{*/
|
||||
// lang
|
||||
Context::loadLang($this->template_path.'lang/');
|
||||
}/*}}}*/
|
||||
|
||||
// disp 초기화
|
||||
function dispInit() {/*{{{*/
|
||||
// lang
|
||||
Context::loadLang($this->template_path.'lang/');
|
||||
|
||||
// 카테고리를 사용한다면 카테고리 목록을 구해옴
|
||||
if($this->module_info->use_category=='Y') {
|
||||
|
|
@ -77,9 +77,6 @@
|
|||
|
||||
// proc 초기화
|
||||
function procInit() {/*{{{*/
|
||||
// lang
|
||||
Context::loadLang($this->template_path.'lang/');
|
||||
|
||||
// 파일 업로드일 경우 $act값을 procUploadFile() 로 변경
|
||||
if(Context::isUploaded()) $this->act = 'procUploadFile';
|
||||
|
||||
|
|
|
|||
|
|
@ -64,7 +64,9 @@
|
|||
<th>{$lang->content}</th>
|
||||
<td>
|
||||
<!--#include("$editor_path/editor.html")-->
|
||||
<!--@if($grant->fileupload)-->
|
||||
<!--#include("$editor_path/editor_uploader.html")-->
|
||||
<!--@end-->
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
|
|
|||
|
|
@ -111,6 +111,60 @@
|
|||
return new Output();
|
||||
}/*}}}*/
|
||||
|
||||
// 사용자 정보
|
||||
// public object getLoggedInfo()/*{{{*/
|
||||
// user_id에 해당하는 사용자 정보 return
|
||||
function getLoggedInfo() {
|
||||
// 로그인 되어 있고 세션 정보를 요청하면 세션 정보를 return
|
||||
if($this->isLogged()) return $_SESSION['logged_info'];
|
||||
}/*}}}*/
|
||||
|
||||
// public object getMemberInfo($user_id)/*{{{*/
|
||||
// user_id에 해당하는 사용자 정보 return
|
||||
function getMemberInfo($user_id) {
|
||||
// DB에서 가져오기
|
||||
$oDB = &DB::getInstance();
|
||||
$args->user_id = $user_id;
|
||||
$output = $oDB->executeQuery('member.getMemberInfo', $args);
|
||||
if(!$output) return $output;
|
||||
|
||||
$member_info = $output->data;
|
||||
$member_info->group_list = $this->getMemberGroups($member_info->member_srl);
|
||||
|
||||
return $member_info;
|
||||
}/*}}}*/
|
||||
|
||||
// public object getMemberInfoByMemberSrl($member_srl)/*{{{*/
|
||||
// user_id에 해당하는 사용자 정보 return
|
||||
function getMemberInfoByMemberSrl($member_srl) {
|
||||
// DB에서 가져오기
|
||||
$oDB = &DB::getInstance();
|
||||
$args->member_srl = $member_srl;
|
||||
$output = $oDB->executeQuery('member.getMemberInfoByMemberSrl', $args);
|
||||
if(!$output) return $output;
|
||||
|
||||
$member_info = $output->data;
|
||||
$member_info->group_list = $this->getMemberGroups($member_info->member_srl);
|
||||
|
||||
return $member_info;
|
||||
}/*}}}*/
|
||||
|
||||
// public int getMemberSrl() /*{{{*/
|
||||
// 현재 접속자의 member_srl을 return
|
||||
function getMemberSrl() {
|
||||
if(!$this->isLogged()) return;
|
||||
return $_SESSION['member_srl'];
|
||||
}/*}}}*/
|
||||
|
||||
// public int getUserID() /*{{{*/
|
||||
// 현재 접속자의 user_id을 return
|
||||
function getUserID() {
|
||||
if(!$this->isLogged()) return;
|
||||
$logged_info = $_SESSION['logged_info'];
|
||||
return $logged_info->user_id;
|
||||
}/*}}}*/
|
||||
|
||||
|
||||
// member 정보 입출력 관련
|
||||
// public void insertAdmin($args)/*{{{*/
|
||||
// 관리자를 추가한다
|
||||
|
|
@ -234,50 +288,6 @@
|
|||
return false;
|
||||
}/*}}}*/
|
||||
|
||||
// public object getLoggedInfo()/*{{{*/
|
||||
// user_id에 해당하는 사용자 정보 return
|
||||
function getLoggedInfo() {
|
||||
// 로그인 되어 있고 세션 정보를 요청하면 세션 정보를 return
|
||||
if($this->isLogged()) return $_SESSION['logged_info'];
|
||||
}/*}}}*/
|
||||
|
||||
// public object getMemberInfo($user_id)/*{{{*/
|
||||
// user_id에 해당하는 사용자 정보 return
|
||||
function getMemberInfo($user_id) {
|
||||
// DB에서 가져오기
|
||||
$oDB = &DB::getInstance();
|
||||
$args->user_id = $user_id;
|
||||
$output = $oDB->executeQuery('member.getMemberInfo', $args);
|
||||
if(!$output) return $output;
|
||||
|
||||
$member_info = $output->data;
|
||||
$member_info->group_list = $this->getMemberGroups($member_info->member_srl);
|
||||
|
||||
return $member_info;
|
||||
}/*}}}*/
|
||||
|
||||
// public object getMemberInfoByMemberSrl($member_srl)/*{{{*/
|
||||
// user_id에 해당하는 사용자 정보 return
|
||||
function getMemberInfoByMemberSrl($member_srl) {
|
||||
// DB에서 가져오기
|
||||
$oDB = &DB::getInstance();
|
||||
$args->member_srl = $member_srl;
|
||||
$output = $oDB->executeQuery('member.getMemberInfoByMemberSrl', $args);
|
||||
if(!$output) return $output;
|
||||
|
||||
$member_info = $output->data;
|
||||
$member_info->group_list = $this->getMemberGroups($member_info->member_srl);
|
||||
|
||||
return $member_info;
|
||||
}/*}}}*/
|
||||
|
||||
// public int getMemberSrl() /*{{{*/
|
||||
// 현재 접속자의 member_srl을 return
|
||||
function getMemberSrl() {
|
||||
if(!$this->isLogged()) return;
|
||||
return $_SESSION['member_srl'];
|
||||
}/*}}}*/
|
||||
|
||||
// group 관련
|
||||
// public object addMemberToGroup($member_srl, $group_srl) /*{{{*/
|
||||
// member_srl에 gruop_srl을 추가
|
||||
|
|
|
|||
|
|
@ -92,9 +92,9 @@
|
|||
$output = $oDB->executeQuery('module_manager.getMidInfo', $args);
|
||||
if(!$output->data) return;
|
||||
return module_manager::arrangeModuleInfo($output->data);
|
||||
}
|
||||
}/*}}}*/
|
||||
|
||||
// public object arrangeModuleInfo($source_module_info)
|
||||
// public object arrangeModuleInfo($source_module_info)/*{{{*/
|
||||
// grant, extraVar등의 정리
|
||||
function arrangeModuleInfo($source_module_info) {
|
||||
if(!$source_module_info) return;
|
||||
|
|
@ -119,6 +119,11 @@
|
|||
// 권한의 정리
|
||||
if($grant) $module_info->grant = unserialize($grant);
|
||||
|
||||
// 관리자 아이디의 정리
|
||||
if($module_info->admin_id) {
|
||||
$module_info->admin_id = explode(',',$module_info->admin_id);
|
||||
}
|
||||
|
||||
return $module_info;
|
||||
}/*}}}*/
|
||||
|
||||
|
|
@ -143,7 +148,6 @@
|
|||
$eval_str = sprintf('$oModule = new %s();', $module);
|
||||
eval($eval_str);
|
||||
$oModule->setModulePath($class_path);
|
||||
$oModule->init();
|
||||
|
||||
// 언어파일 읽기
|
||||
Context::loadLang($class_path.'lang');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue