From 56aed1fb7bafa09082d3bd6290cd15c096d373b8 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Mon, 12 Apr 2021 23:26:53 +0900 Subject: [PATCH] =?UTF-8?q?Fix=20#1685=20=EB=B3=B4=EC=99=84:=20=EC=9D=B5?= =?UTF-8?q?=EB=AA=85=20=EC=B6=94=EC=B2=9C=20=EB=B0=8F=20=EC=8A=A4=ED=81=AC?= =?UTF-8?q?=EB=9E=A9=EC=8B=9C=20=ED=9A=8C=EC=9B=90=EC=A0=95=EB=B3=B4?= =?UTF-8?q?=EB=A5=BC=20=EC=B2=98=EC=9D=8C=EB=B6=80=ED=84=B0=20DB=EC=97=90?= =?UTF-8?q?=20=EC=A0=80=EC=9E=A5=ED=95=98=EC=A7=80=20=EC=95=8A=EB=8F=84?= =?UTF-8?q?=EB=A1=9D=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/ncenterlite/ncenterlite.controller.php | 6 +++--- modules/ncenterlite/ncenterlite.model.php | 12 ++++++++---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/modules/ncenterlite/ncenterlite.controller.php b/modules/ncenterlite/ncenterlite.controller.php index eaf70b213..9e331f5ca 100644 --- a/modules/ncenterlite/ncenterlite.controller.php +++ b/modules/ncenterlite/ncenterlite.controller.php @@ -695,7 +695,7 @@ class ncenterliteController extends ncenterlite $args->regdate = date('YmdHis'); $args->notify = $this->_getNotifyId($args); $args->target_url = getNotEncodedUrl('', 'mid', $module_info->mid, 'document_srl', $obj->document_srl); - $output = $this->_insertNotify($args); + $output = $this->_insertNotify($args, $config->anonymous_scrap !== 'N'); if(!$output->toBool()) { return $output; @@ -740,7 +740,7 @@ class ncenterliteController extends ncenterlite $args->notify = $this->_getNotifyId($args); $args->target_url = getNotEncodedUrl('', 'mid', $module_info->mid, 'document_srl', $obj->document_srl); $args->module_srl = $obj->module_srl; - $this->_insertNotify($args); + $this->_insertNotify($args, $config->anonymous_voter !== 'N'); } function triggerAfterDocumentVotedCancel($obj) @@ -813,7 +813,7 @@ class ncenterliteController extends ncenterlite $args->module_srl = $obj->module_srl; $args->notify = $this->_getNotifyId($args); $args->target_url = getNotEncodedUrl('', 'mid', $module_info->mid, 'document_srl', $document_srl, 'comment_srl', $obj->comment_srl) . '#comment_' . $obj->comment_srl; - $this->_insertNotify($args); + $this->_insertNotify($args, $config->anonymous_voter !== 'N'); } function triggerAfterCommentVotedCancel($obj) diff --git a/modules/ncenterlite/ncenterlite.model.php b/modules/ncenterlite/ncenterlite.model.php index 729bab8b4..dfa317644 100644 --- a/modules/ncenterlite/ncenterlite.model.php +++ b/modules/ncenterlite/ncenterlite.model.php @@ -71,6 +71,10 @@ class ncenterliteModel extends ncenterlite { $config->anonymous_voter = 'N'; } + if(!$config->anonymous_scrap) + { + $config->anonymous_scrap = 'N'; + } if(!$config->highlight_effect) { $config->highlight_effect = 'Y'; @@ -284,11 +288,11 @@ class ncenterliteModel extends ncenterlite $v->url = getUrl('','act','procNcenterliteRedirect', 'notify', $v->notify); if(($v->target_type === $this->_TYPE_VOTED && $config->anonymous_voter === 'Y') || ($v->target_type === $this->_TYPE_SCRAPPED && $config->anonymous_scrap === 'Y')) { - $v->target_member_srl = $member_srl; + $v->target_member_srl = 0; $v->target_nick_name = lang('anonymous'); $v->target_user_id = $v->target_email_address = 'anonymous'; } - if($v->target_member_srl && ($v->target_type !== $this->_TYPE_VOTED || $v->target_type !== $this->_TYPE_SCRAPPED)) + if($v->target_member_srl) { $profileImage = $oMemberModel->getProfileImage($v->target_member_srl); $v->profileImage = $profileImage->src; @@ -639,7 +643,7 @@ class ncenterliteModel extends ncenterlite // Voted. case 'V': - if($config->anonymous_voter !== 'N') + if($config->anonymous_voter !== 'N' || $notification->target_member_srl == 0) { $str = sprintf(lang('ncenterlite_vote_anonymous'), $notification->target_summary, $type); } @@ -651,7 +655,7 @@ class ncenterliteModel extends ncenterlite // Scrapped. case 'R': - if($config->anonymous_scrap !== 'N') + if($config->anonymous_scrap !== 'N' || $notification->target_member_srl == 0) { $str = sprintf(lang('ncenterlite_scrap_anonymous'), $notification->target_summary, $type); }