git-svn-id: http://xe-core.googlecode.com/svn/trunk@141 201d5d3c-b55e-5fd7-737f-ddc643e51545

This commit is contained in:
zero 2007-02-20 15:27:46 +00:00
parent ba268e8f1d
commit a35379d3a6
6 changed files with 28 additions and 114 deletions

View file

@ -11,42 +11,32 @@
* @brief 초기화
**/
function init() {
// 관리자 모듈 목록을 세팅
$oModuleModel = &getModel('module');
$module_list = $oModuleModel->getAdminModuleList();
Context::set('module_list', $module_list);
// template path 지정
$this->setTemplatePath($this->module_path.'tpl');
// 접속 사용자에 대한 체크
$oMemberModel = &getModel('member');
$logged_info = $oMemberModel->getLoggedInfo();
// 로그인 하지 않았다면 로그인 폼 출력
if(!$oMemberModel->isLogged()) return $this->act = 'dispLogin';
if(!$oMemberModel->isLogged()) return Context::set('act','dispLogin');
// 로그인되었는데 관리자(member->is_admin!=1)가 아니면 오류 표시
if($logged_info->is_admin != 'Y') {
Context::set('msg_code', 'msg_is_not_administrator');
return $this->act = 'dispError';
Context::set('act','dispError');
return;
}
// 관리자 모듈 목록을 세팅
$oModuleModel = &getModel('module');
$module_list = $oModuleModel->getModuleList();
Context::set('module_list', $module_list);
// 관리자용 레이아웃으로 변경
//$this->setLayoutPath($this->getLayoutPath());
//$this->setLayoutTpl($this->getLayoutTpl());
// 로그인/로그아웃 act의 경우는 패스~
if(in_array($this->act, array('procLogin', 'procLogout'))) return true;
// 접속 사용자에 대한 체크
$logged_info = $oMemberModel->getLoggedInfo();
// 로그인되었는데 관리자(member->is_admin!=1)가 아니면 오류 표시
if($logged_info->is_admin != 'Y') {
$this->setError(-1);
$this->setMessage('msg_is_not_administrator');
return false;
}
return true;
$this->setLayoutPath($this->getTemplatePath());
$this->setLayoutFile('layout.html');
}
/**

View file

@ -2,5 +2,8 @@
<module default_action="dispAdminIndex" management_action="">
<actions>
<action name="dispAdminIndex" type="view" grant="root" />
<actions>
<action name="dispLogin" type="view" grant="guest" />
<action name="dispLogout" type="view" grant="root" />
<action name="dispError" type="view" grant="guest" />
</actions>
</module>

View file

@ -32,7 +32,7 @@
<a href="{getUrl('act','dispLogin')}">[{$lang->cmd_login}]</a>
<!--@end-->
<!--@if($logged_info->is_admin=='Y')-->
<a href="./admin.php?sid=board&amp;act=dispModuleInfo&amp;module_srl={$module_srl}" target="_blank">[{$lang->cmd_management}]</a>
<a href="{getUrl('module','admin','sid',$module,'act','dispModuleInfo','module_srl',$module_srl,'mid','')}" target="_blank">[{$lang->cmd_management}]</a>
<!--@end-->
</div>