diff --git a/modules/ncenterlite/ncenterlite.class.php b/modules/ncenterlite/ncenterlite.class.php index d71c58a77..be5713ad2 100644 --- a/modules/ncenterlite/ncenterlite.class.php +++ b/modules/ncenterlite/ncenterlite.class.php @@ -31,6 +31,7 @@ class ncenterlite extends ModuleObject var $_TYPE_TEST = 'T'; // Test Notify create. var $_TYPE_ADMIN_DOCUMENT = 'B'; // Admin Document Alert var $_TYPE_CUSTOM = 'U'; //Updated alert(uses type table) + var $_TYPE_INSERT_MEMBER = 'I'; // Insert Member var $triggers = array( array('comment.insertComment', 'ncenterlite', 'controller', 'triggerAfterInsertComment', 'after'), @@ -44,7 +45,9 @@ class ncenterlite extends ModuleObject array('document.updateVotedCount', 'ncenterlite', 'controller', 'triggerAfterVotedupdate', 'after'), array('moduleHandler.init', 'ncenterlite', 'controller', 'triggerAddMemberMenu', 'after'), array('document.moveDocumentToTrash', 'ncenterlite', 'controller', 'triggerAfterMoveToTrash', 'after'), + array('member.insertMember', 'ncenterlite', 'controller', 'triggerAfterMemberInsert', 'after'), ); + private $delete_triggers = array( array('moduleObject.proc', 'ncenterlite', 'controller', 'triggerBeforeModuleObjectProc', 'before') ); diff --git a/modules/ncenterlite/ncenterlite.controller.php b/modules/ncenterlite/ncenterlite.controller.php index 26df01fbb..3a125e10c 100644 --- a/modules/ncenterlite/ncenterlite.controller.php +++ b/modules/ncenterlite/ncenterlite.controller.php @@ -496,6 +496,31 @@ class ncenterliteController extends ncenterlite return new Object(); } + function triggerAfterMemberInsert(&$obj) + { + // 관리자가 회원을 추가하는 경우 알림을 발송하지 않는다. + if($obj->is_admin || $obj->member_srl !== $obj->target_member_srl) + { + return new Object(); + } + + $args = new stdClass(); + $args->member_srl = $obj->member_srl; + $args->srl = $obj->member_srl; + $args->target_p_srl = '1'; + $args->target_srl = $obj->member_srl; + $args->target_member_srl = $obj->member_srl; + $args->type = $this->_TYPE_INSERT_MEMBER; + $args->target_type = $this->_TYPE_INSERT_MEMBER; + $args->target_summary = lang('cmd_signup'); + $args->regdate = date('YmdHis'); + $args->notify = $this->_getNotifyId($args); + $args->target_url = getNotEncodedFullUrl('', 'act', 'dispMemberInfo'); + $this->_insertNotify($args); + + return new Object(); + } + function triggerAfterModuleHandlerProc(&$oModule) { $vars = Context::getRequestVars(); diff --git a/modules/ncenterlite/ncenterlite.model.php b/modules/ncenterlite/ncenterlite.model.php index 7c09a67f5..eec9fd314 100644 --- a/modules/ncenterlite/ncenterlite.model.php +++ b/modules/ncenterlite/ncenterlite.model.php @@ -305,7 +305,7 @@ class ncenterliteModel extends ncenterlite public function getNotificationText($notification) { global $lang; - + // Get the type of notification. switch ($notification->type) { @@ -313,30 +313,35 @@ class ncenterliteModel extends ncenterlite case 'D': $type = $lang->ncenterlite_document; break; - + // Comment. case 'C': $type = $lang->ncenterlite_comment; break; - + // Message. case 'E': $type = $lang->ncenterlite_type_message; break; - + // Test. case 'T': $type = $lang->ncenterlite_type_test; break; - + // Custom string. case 'X': return $notification->target_body; - + + // Insert member + case 'I': + $type = $lang->cmd_signup; + break; + // Custom language. case 'Y': return $lang->{$notification->target_body}; - + // Custom language with string interpolation. case 'Z': return vsprintf($lang->{$notification->target_body}, array( @@ -354,7 +359,7 @@ class ncenterliteModel extends ncenterlite default: return $this->getNotifyTypeString($notification->notify_type, unserialize($notification->target_body)) ?: $lang->ncenterlite; } - + // Get the notification text. switch ($notification->target_type) { @@ -362,32 +367,32 @@ class ncenterliteModel extends ncenterlite case 'C': $str = sprintf($lang->ncenterlite_commented, $notification->target_nick_name, $type, $notification->target_summary); break; - + // Comment on a board. case 'A': $str = sprintf($lang->ncenterlite_commented_board, $notification->target_nick_name, $notification->target_browser, $notification->target_summary); break; - + // Mentioned. case 'M': $str = sprintf($lang->ncenterlite_mentioned, $notification->target_nick_name, $notification->target_browser, $notification->target_summary, $type); break; - + // Message arrived. case 'E': $str = sprintf($lang->ncenterlite_message_mention, $notification->target_nick_name, $notification->target_summary); break; - + // Test notification. case 'T': $str = sprintf($lang->ncenterlite_test_noti, $notification->target_nick_name); break; - + // New document on a board. case 'P': $str = sprintf($lang->ncenterlite_board, $notification->target_nick_name, $notification->target_browser, $notification->target_summary); break; - + // New document. case 'S': if($notification->target_browser) @@ -399,22 +404,26 @@ class ncenterliteModel extends ncenterlite $str = sprintf($lang->ncenterlite_article, $notification->target_nick_name, $notification->target_summary); } break; - + // Voted. case 'V': $str = sprintf($lang->ncenterlite_vote, $notification->target_nick_name, $notification->target_summary, $type); break; - + // Admin notification. case 'B': $str = sprintf($lang->ncenterlite_admin_content_message, $notification->target_nick_name, $notification->target_browser, $notification->target_summary); break; - + + case 'I': + $str = sprintf($lang->ncenterlite_insert_member_message, $notification->target_nick_name); + break; + // Other. default: $str = $lang->ncenterlite; } - + return $str; }