diff --git a/modules/board/board.controller.php b/modules/board/board.controller.php index 1fe00a2f2..77f9b5e71 100644 --- a/modules/board/board.controller.php +++ b/modules/board/board.controller.php @@ -196,7 +196,7 @@ class boardController extends board // if the document is not existed if(!$document_srl) { - return $this->doError('msg_invalid_document'); + return new Object(-1, 'msg_invalid_document'); } $oDocumentModel = &getModel('document'); @@ -302,8 +302,18 @@ class boardController extends board if(!$obj->comment_srl) { $obj->comment_srl = getNextSequence(); - } else { + } + else + { $comment = $oCommentModel->getComment($obj->comment_srl, $this->grant->manager); + if($this->module_info->protect_comment === 'Y' && $this->grant->manager == false) + { + $childs = $oCommentModel->getChildComments($obj->comment_srl); + if (count($childs) > 0) + { + return new Object(-1, 'msg_board_protect_comment'); + } + } } $oMemberModel = getModel('member'); @@ -330,11 +340,15 @@ class boardController extends board $output = $oCommentController->insertComment($obj, $bAnonymous); // parent_srl is not existed - } else { + } + else + { $output = $oCommentController->insertComment($obj, $bAnonymous); } // update the comment if it is not existed - } else { + } + else + { // check the grant if(!$comment->isGranted()) { @@ -343,7 +357,6 @@ class boardController extends board $obj->parent_srl = $comment->parent_srl; $output = $oCommentController->updateComment($obj, $this->grant->manager); - $comment_srl = $obj->comment_srl; } if(!$output->toBool()) @@ -366,7 +379,18 @@ class boardController extends board $comment_srl = Context::get('comment_srl'); if(!$comment_srl) { - return $this->doError('msg_invalid_request'); + return new Object(-1, 'msg_invalid_request'); + } + + $oCommentModel = getModel('comment'); + + if($this->module_info->protect_comment === 'Y' && $this->grant->manager==false) + { + $childs = $oCommentModel->getChildComments($comment_srl); + if(count($childs) > 0) + { + return new Object(-1, 'msg_board_protect_comment'); + } } // generate comment controller object diff --git a/modules/board/lang/ko.php b/modules/board/lang/ko.php index 1babb1c7c..e6fc59258 100644 --- a/modules/board/lang/ko.php +++ b/modules/board/lang/ko.php @@ -30,6 +30,7 @@ $lang->about_secret = '게시판 및 댓글의 비밀글 기능을 사용할 수 $lang->about_admin_mail = '글이나 댓글이 등록될때 등록된 메일주소로 메일이 발송됩니다. 콤마(,)로 연결시 다수의 메일주소로 발송할 수 있습니다.'; $lang->about_list_config = '게시판의 목록형식 사용시 원하는 항목들로 배치를 할 수 있습니다. 단 스킨에서 지원하지 않는 경우 불가능합니다. 대상항목/ 표시항목의 항목을 더블클릭하면 추가/ 제거가 됩니다.'; $lang->about_use_status = '글 작성 시 선택할 수 있는 상태를 지정해주세요.'; +$lang->about_protect_comment = '댓글의 댓글이 있을경우 해당댓글을 삭제 및 수정을 할 수 없도록 합니다.'; $lang->msg_not_enough_point = '포인트가 부족합니다'; $lang->write_comment = '댓글 쓰기'; $lang->msg_not_allow_comment = '해당 글의 댓글 쓰기가 잠겨있습니다.'; @@ -40,7 +41,9 @@ $lang->category_settings = '분류 설정'; $lang->hide_category = '분류 숨기기'; $lang->about_hide_category = '임시로 분류를 사용하지 않으려면 체크하세요.'; $lang->protect_content = '글 보호 기능'; +$lang->protect_comment = '댓글 보호 기능'; $lang->about_protect_content = '작성된 글에 댓글이 작성된 경우 글 작성자는 해당 글을 수정하거나 삭제 할 수 없습니다. '; $lang->msg_protect_content = '댓글이 작성된 게시물의 글을 수정 또는 삭제 할 수 없습니다.'; $lang->msg_admin_document_no_modify = '최고관리자의 게시물을 수정할 권한이 없습니다.'; $lang->msg_admin_comment_no_modify = '최고관리자의 댓글을 수정할 권한이 없습니다.'; +$lang->msg_board_protect_comment = '댓글이 작성된 댓글의 글을 수정 또는 삭제할 수 없습니다.'; diff --git a/modules/board/tpl/board_insert.html b/modules/board/tpl/board_insert.html index f1649a3ce..c941f9974 100644 --- a/modules/board/tpl/board_insert.html +++ b/modules/board/tpl/board_insert.html @@ -68,7 +68,7 @@
{$lang->about_page_count}
- +{$lang->about_mobile_page_count}
{$lang->about_no_point_date}
+