diff --git a/modules/board/board.controller.php b/modules/board/board.controller.php index 12f873ef0..36875a087 100644 --- a/modules/board/board.controller.php +++ b/modules/board/board.controller.php @@ -597,11 +597,11 @@ class BoardController extends Board { if($this->module_info->protect_comment_regdate > 0 && $this->grant->manager == false) { - if($comment->get('regdate') < date('YmdHis', strtotime('-'.$this->module_info->protect_document_regdate.' day'))) + if($comment->get('regdate') < date('YmdHis', strtotime('-'.$this->module_info->protect_comment_regdate.' day'))) { $format = lang('msg_protect_regdate_comment'); - $massage = sprintf($format, $this->module_info->protect_document_regdate); - throw new Rhymix\Framework\Exception($massage); + $message = sprintf($format, $this->module_info->protect_comment_regdate); + throw new Rhymix\Framework\Exception($message); } } // check the grant @@ -678,11 +678,11 @@ class BoardController extends Board if($this->module_info->protect_comment_regdate > 0 && $this->grant->manager == false) { - if($comment->get('regdate') < date('YmdHis', strtotime('-'.$this->module_info->protect_document_regdate.' day'))) + if($comment->get('regdate') < date('YmdHis', strtotime('-'.$this->module_info->protect_comment_regdate.' day'))) { $format = lang('msg_protect_regdate_comment'); - $massage = sprintf($format, $this->module_info->protect_document_regdate); - throw new Rhymix\Framework\Exception($massage); + $message = sprintf($format, $this->module_info->protect_comment_regdate); + throw new Rhymix\Framework\Exception($message); } } // generate comment controller object diff --git a/modules/board/board.view.php b/modules/board/board.view.php index e9f19b1e9..117ff0219 100644 --- a/modules/board/board.view.php +++ b/modules/board/board.view.php @@ -872,8 +872,8 @@ class BoardView extends Board if($oDocument->get('regdate') < date('YmdHis', strtotime('-'.$this->module_info->protect_document_regdate.' day'))) { $format = lang('msg_protect_regdate_document'); - $massage = sprintf($format, $this->module_info->protect_document_regdate); - throw new Rhymix\Framework\Exception($massage); + $message = sprintf($format, $this->module_info->protect_document_regdate); + throw new Rhymix\Framework\Exception($message); } } if ($this->module_info->protect_content === 'Y' || $this->module_info->protect_update_content === 'Y') @@ -1096,18 +1096,18 @@ class BoardView extends Board { if($oDocument->get('regdate') < date('YmdHis', strtotime('-'.$this->module_info->protect_document_regdate.' day'))) { - $format = lang('msg_protect_regdate_document'); - $massage = sprintf($format, $this->module_info->protect_document_regdate); - throw new Rhymix\Framework\Exception($massage); + $format = lang('msg_protect_regdate_document'); + $message = sprintf($format, $this->module_info->protect_document_regdate); + throw new Rhymix\Framework\Exception($message); } } if($this->module_info->protect_content == "Y" || $this->module_info->protect_delete_content == 'Y') { $comment_limit = $this->module_info->protect_delete_content_limit ?? 1; - if($oDocument->get('comment_count')>0 && $this->grant->manager == false) + if($oDocument->get('comment_count') >= $comment_limit && $this->grant->manager == false) { - throw new Rhymix\Framework\Exception(sprintf(lang('msg_protect_delete_content'), $comment_limit)); + return $this->dispBoardMessage(sprintf(lang('msg_protect_delete_content'), $comment_limit)); } } @@ -1292,11 +1292,11 @@ class BoardView extends Board if($this->module_info->protect_comment_regdate > 0 && $this->grant->manager == false) { - if($oComment->get('regdate') < date('YmdHis', strtotime('-'.$this->module_info->protect_document_regdate.' day'))) + if($oComment->get('regdate') < date('YmdHis', strtotime('-'.$this->module_info->protect_comment_regdate.' day'))) { - $format = lang('msg_protect_regdate_comment'); - $massage = sprintf($format, $this->module_info->protect_document_regdate); - throw new Rhymix\Framework\Exception($massage); + $format = lang('msg_protect_regdate_comment'); + $message = sprintf($format, $this->module_info->protect_comment_regdate); + throw new Rhymix\Framework\Exception($message); } } if($this->module_info->protect_update_comment === 'Y' && $this->grant->manager == false) @@ -1380,11 +1380,11 @@ class BoardView extends Board if($this->module_info->protect_comment_regdate > 0 && $this->grant->manager == false) { - if($oComment->get('regdate') < date('YmdHis', strtotime('-'.$this->module_info->protect_document_regdate.' day'))) + if($oComment->get('regdate') < date('YmdHis', strtotime('-'.$this->module_info->protect_comment_regdate.' day'))) { $format = lang('msg_protect_regdate_comment'); - $massage = sprintf($format, $this->module_info->protect_document_regdate); - throw new Rhymix\Framework\Exception($massage); + $message = sprintf($format, $this->module_info->protect_comment_regdate); + throw new Rhymix\Framework\Exception($message); } }