mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-19 19:29:56 +09:00
블로그/게시판등 모듈에 상관없이 문서의 출력을 위한 권한을 처리하기 위해 document.item.php의 isAccessible()추가 및 레이아웃 처리를 Context를 이용하여 보이지 않도록 수정
git-svn-id: http://xe-core.googlecode.com/svn/trunk@1913 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
d0c8f54ed8
commit
f4f44da48d
6 changed files with 39 additions and 18 deletions
|
|
@ -34,9 +34,11 @@
|
|||
if(__DEBUG__==3) $start = getMicroTime();
|
||||
$oTemplate = &TemplateHandler::getInstance();
|
||||
|
||||
$layout_path = $oModule->getLayoutPath();
|
||||
$layout_file = $oModule->getLayoutFile();
|
||||
$edited_layout_file = $oModule->getEditedLayoutFile();
|
||||
if(Context::get('layout') != 'none') {
|
||||
$layout_path = $oModule->getLayoutPath();
|
||||
$layout_file = $oModule->getLayoutFile();
|
||||
$edited_layout_file = $oModule->getEditedLayoutFile();
|
||||
}
|
||||
|
||||
if(!$layout_path) $layout_path = './common/tpl/';
|
||||
if(!$layout_file) $layout_file = 'default_layout.html';
|
||||
|
|
|
|||
|
|
@ -151,17 +151,22 @@ Jeong, Chan Myeong 070601~070630
|
|||
.boardRead .readFooter .fileAttached li { display:inline; margin-right:.75em; line-height:1.5em;}
|
||||
.boardRead .readFooter .fileAttached li a { font-size:.9em; padding:.1em 0 .1em 1.5em; white-space:nowrap; position:relative; color:#444444; background:url(../images/white/iconFile.gif) no-repeat left top;}
|
||||
.boardRead .readFooter .fileAttached li a:visited { color:#777777;}
|
||||
.boardRead .replyAndTrackback { position:relative; overflow:hidden; _width:100%; padding:.8em 0em; height:1em; background:url(../images/white/bgBoardListTh.gif) repeat-x left bottom; border-top:1px solid #e0e1db; border-bottom:2px solid #666760;}
|
||||
.boardRead .replyAndTrackback li { position:relative; left:1.5em; padding-left:1.4em; float:left; margin-right:1em;}
|
||||
|
||||
.boardRead .replyAndTrackback { position:relative; overflow:hidden; _width:100%; padding:.8em 0em; height:1.2em; background:url(../images/white/bgBoardListTh.gif) repeat-x left bottom; border-top:1px solid #e0e1db; border-bottom:2px solid #666760;}
|
||||
.boardRead .replyAndTrackback li { margin-left:1em; padding-left:1.4em; float:left; list-style:none;}
|
||||
|
||||
.boardRead .replyAndTrackback li.reply { background:url(../images/white/iconReply.gif) no-repeat left top;}
|
||||
.boardRead .replyAndTrackback li.reply a { _position:relative; _top:-.5em;}
|
||||
.boardRead .replyAndTrackback li.reply a { position:relative; top:-.3em; _top:-.6em;}
|
||||
|
||||
.boardRead .replyAndTrackback li.trackback { background:url(../images/white/iconTrackback.gif) no-repeat left top;}
|
||||
.boardRead .replyAndTrackback a { display:block; float:left; color:#333333; height:1em; padding:.1em 1.5em .1em 0; white-space:nowrap;}
|
||||
.boardRead .replyAndTrackback li.trackback a { position:relative; top:-.3em; _top:0em;}
|
||||
|
||||
.boardRead .replyAndTrackback a { color:#333333; white-space:nowrap; text-decoration:none;}
|
||||
.boardRead .replyAndTrackback a strong { color:#ff6600;}
|
||||
.boardRead .replyAndTrackback a#toggleReply { background:url(../images/white/buttonToggleReply.gif) no-repeat right top;}
|
||||
.boardRead .replyAndTrackback a#toggleTrackback { background:url(../images/white/buttonToggleReply.gif) no-repeat right -13px;}
|
||||
.boardRead .replyAndTrackback li.button { float:right; }
|
||||
.boardRead .replyAndTrackback li.button a { display:inline; padding:0; margin:0 1em 0 1em;}
|
||||
.boardRead .replyAndTrackback .listButton { float:right; margin:0 1em 0 0; position:relative; top:-5px; _top:-7px;}
|
||||
|
||||
|
||||
#trackbacks { padding:.6em .6em; color:#666666; border:1px solid #e0e1db;;margin-top:.5em;}
|
||||
#trackbacks li { padding:.6em .8em .6em .6em; line-height:1.25em; border-bottom:1px dotted #EEEEEE; list-style:none;}
|
||||
|
|
|
|||
|
|
@ -68,15 +68,16 @@
|
|||
</div>
|
||||
|
||||
<ul class="replyAndTrackback">
|
||||
<a href="{getUrl('','act','dispDocumentPrint','document_srl',$oDocument->document_srl)}" onclick="winopen(this.href);return false;" class="button"><span>{$lang->cmd_print}</span></a>
|
||||
|
||||
<!--@if($grant->write_comment && $oDocument->allowComment()) -->
|
||||
<li class="reply"><a href="#trackback_{$oDocument->document_srl}">{$lang->comment} <strong>{$oDocument->getCommentCount()}</strong></a></li>
|
||||
<li class="reply"><a href="#comment_top_{$oDocument->document_srl}">{$lang->comment} <strong>{$oDocument->getCommentCount()}</strong></a></li>
|
||||
<!--@end-->
|
||||
|
||||
<!--@if($oDocument->allowTrackback())-->
|
||||
<li class="trackback"><a href="#comment_top_{$oDocument->document_srl}">{$lang->trackback} <strong>{$oDocument->getTrackbackCount()}</strong></a></li>
|
||||
<li class="trackback"><a href="#trackback_{$oDocument->document_srl}">{$lang->trackback} <strong>{$oDocument->getTrackbackCount()}</strong></a></li>
|
||||
<!--@end-->
|
||||
|
||||
<li class="listButton"><a href="{getUrl('','act','dispDocumentPrint','document_srl',$oDocument->document_srl)}" onclick="winopen(this.href);return false;" class="button"><span>{$lang->cmd_print}</span></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -67,6 +67,10 @@
|
|||
$_SESSION['own_document'][$this->document_srl] = true;
|
||||
}
|
||||
|
||||
function isAccessible() {
|
||||
return $_SESSION['accessible'][$this->document_srl]==true?true:false;
|
||||
}
|
||||
|
||||
function allowComment() {
|
||||
return $this->get('allow_comment') == 'Y' || !$this->isExists() ? true : false;
|
||||
}
|
||||
|
|
@ -119,12 +123,14 @@
|
|||
function getContentText() {
|
||||
if($this->isSecret() && !$this->isGranted()) return Context::getLang('msg_is_secret');
|
||||
|
||||
$_SESSION['accessible'][$this->document_srl] = true;
|
||||
return htmlspecialchars($this->get('content'));
|
||||
}
|
||||
|
||||
function getContent() {
|
||||
if($this->isSecret() && !$this->isGranted()) return Context::getLang('msg_is_secret');
|
||||
|
||||
$_SESSION['accessible'][$this->document_srl] = true;
|
||||
return sprintf('<!--BeforeDocument(%d,%d)-->%s<!--AfterDocument(%d,%d)-->', $this->document_srl, $this->get('member_srl'), $this->get('content'), $this->document_srl, $this->get('member_srl'));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,9 +18,6 @@
|
|||
* 해당 글만 찾아서 그냥 출력해버린다;;
|
||||
**/
|
||||
function dispDocumentPrint() {
|
||||
// 권한 체크
|
||||
if(!$this->grant->view) return new Object(-1,'msg_not_permitted');
|
||||
|
||||
// 목록 구현에 필요한 변수들을 가져온다
|
||||
$document_srl = Context::get('document_srl');
|
||||
|
||||
|
|
@ -31,12 +28,15 @@
|
|||
$oDocument = $oDocumentModel->getDocument($document_srl, $this->grant->manager);
|
||||
if(!$oDocument->isExists()) return new Object(-1,'msg_invalid_request');
|
||||
|
||||
// 권한 체크
|
||||
if(!$oDocument->isAccessible()) return new Object(-1,'msg_not_permitted');
|
||||
|
||||
// 브라우저 타이틀 설정
|
||||
Context::setBrowserTitle($oDocument->getTitleText());
|
||||
|
||||
Context::set('oDocument', $oDocument);
|
||||
|
||||
$this->module_info->layout_srl = null;
|
||||
Context::set('layout','none');
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('print_page');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,15 @@
|
|||
<!--%import("./css/document.css")-->
|
||||
<!--%import("./css/document.css")-->
|
||||
|
||||
<h1>{$oDocument->getTitleText()}</h1><br />
|
||||
{$oDocument->getContent()}
|
||||
<div><h1>{$oDocument->getTitleText()}</h1></div>
|
||||
|
||||
<div class="member_{$oDocument->get('member_srl')} gap1 fl">{$oDocument->get('nick_name')}</div>
|
||||
<div class="gap1 fr">{$oDocument->getRegdate()}</div>
|
||||
|
||||
<div class="clear"></div>
|
||||
|
||||
<div class="gap1">{$oDocument->getContent()}</div>
|
||||
|
||||
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
xAddEventListener(window,'load',function() { window.print(); } );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue