mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-05 09:41:40 +09:00
Merge pull request #558 from bjrambo/pr/develop-document-mail
관리자 이메일 제목 수정 및 관리자메일으로 발신자 조작에 걸리지 않도록 고침.
This commit is contained in:
commit
a3df00fc9f
6 changed files with 29 additions and 24 deletions
|
|
@ -177,26 +177,27 @@ class boardController extends board
|
|||
{
|
||||
$oModuleModel = getModel('module');
|
||||
$member_config = $oModuleModel->getModuleConfig('member');
|
||||
$is_logged = Context::get('is_logged');
|
||||
|
||||
if(!$is_logged && !$member_config->webmaster_email)
|
||||
if($member_config->webmaster_email)
|
||||
{
|
||||
$obj->email_address = $this->module_info->admin_mail;
|
||||
$mail_title = sprintf(lang('msg_document_notify_mail'), $this->module_info->browser_title, cut_str($obj->title, 20, '...'));
|
||||
|
||||
$oMail = new Mail();
|
||||
$oMail->setTitle($mail_title);
|
||||
$oMail->setContent( sprintf("From : <a href=\"%s\">%s</a><br/>\r\n%s", getFullUrl('','document_srl',$obj->document_srl), getFullUrl('','document_srl',$obj->document_srl), $obj->content));
|
||||
$oMail->setSender($member_config->webmaster_name ?: null, $member_config->webmaster_email);
|
||||
|
||||
$target_mail = explode(',',$this->module_info->admin_mail);
|
||||
for($i=0;$i<count($target_mail);$i++)
|
||||
{
|
||||
$email_address = trim($target_mail[$i]);
|
||||
if(!$email_address) continue;
|
||||
$oMail->setReceiptor($email_address, $email_address);
|
||||
$oMail->send();
|
||||
}
|
||||
}
|
||||
|
||||
$oMail = new Mail();
|
||||
$oMail->setTitle($obj->title);
|
||||
$oMail->setContent( sprintf("From : <a href=\"%s\">%s</a><br/>\r\n%s", getFullUrl('','document_srl',$obj->document_srl), getFullUrl('','document_srl',$obj->document_srl), $obj->content));
|
||||
$oMail->setSender($obj->user_name ?: null, $obj->email_address ? $obj->email_address : $member_config->webmaster_email);
|
||||
|
||||
$target_mail = explode(',',$this->module_info->admin_mail);
|
||||
for($i=0;$i<count($target_mail);$i++)
|
||||
{
|
||||
$email_address = trim($target_mail[$i]);
|
||||
if(!$email_address) continue;
|
||||
$oMail->setReceiptor($email_address, $email_address);
|
||||
$oMail->send();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -48,3 +48,4 @@ $lang->cmd_only_p_comment = 'Only if there are replies';
|
|||
$lang->cmd_all_comment_message = 'Always';
|
||||
$lang->cmd_do_not_message = 'Never';
|
||||
$lang->delete_placeholder = 'Delete Placeholder';
|
||||
$lang->msg_document_notify_mail = '[%s] The new post : %s';
|
||||
|
|
|
|||
|
|
@ -77,3 +77,4 @@ $lang->cmd_only_p_comment = '대댓글이 있는 경우에만 남김';
|
|||
$lang->cmd_all_comment_message = '모든 댓글에 남김';
|
||||
$lang->cmd_do_not_message = '남기지 않음';
|
||||
$lang->delete_placeholder = '완전 삭제';
|
||||
$lang->msg_document_notify_mail = '[%s] 새로운 게시글이 등록되었습니다 : %s';
|
||||
|
|
|
|||
|
|
@ -642,12 +642,17 @@ class commentController extends comment
|
|||
{
|
||||
$oMail = new Mail();
|
||||
|
||||
if($is_logged)
|
||||
// 메일 발신자 조작으로 취급하여 스팸으로 직행할 수 있기때문에 회원설정에서 입력된 웹마스터 메일주소를 이용하도록 함
|
||||
$member_config = $oMemberModel->getMemberConfig();
|
||||
$admin_email_adress = $member_config->webmaster_email;
|
||||
// 관리자 메일을 입력하지 않으면 메일을 보내지 않음.
|
||||
if(!$admin_email_adress)
|
||||
{
|
||||
$oMail->setSender($obj->email_address, $obj->email_address);
|
||||
return;
|
||||
}
|
||||
|
||||
$mail_title = "[Rhymix - " . Context::get('mid') . "] A new comment was posted on document: \"" . $oDocument->getTitleText() . "\"";
|
||||
// 매일 보내는 이를 관리자 계정으로 설정한다.
|
||||
$oMail->setSender($member_config->webmaster_name, $member_config->webmaster_email);
|
||||
$mail_title = sprintf(lang('msg_comment_notify_mail'), Context::get('mid'), cut_str($oDocument->getTitleText(), 20, '...'));
|
||||
$oMail->setTitle($mail_title);
|
||||
$url_comment = getFullUrl('','document_srl',$obj->document_srl).'#comment_'.$obj->comment_srl;
|
||||
if($using_validation)
|
||||
|
|
@ -710,7 +715,6 @@ class commentController extends comment
|
|||
// get all admins emails
|
||||
$admins_emails = $module_info->admin_mail;
|
||||
$target_mail = explode(',', $admins_emails);
|
||||
|
||||
// send email to all admins - START
|
||||
for($i = 0; $i < count($target_mail); $i++)
|
||||
{
|
||||
|
|
@ -719,10 +723,6 @@ class commentController extends comment
|
|||
{
|
||||
continue;
|
||||
}
|
||||
if(!$is_logged)
|
||||
{
|
||||
$oMail->setSender($email_address, $email_address);
|
||||
}
|
||||
$oMail->setReceiptor($email_address, $email_address);
|
||||
$oMail->send();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,3 +49,4 @@ $lang->improper_comment_reasons['others'] = 'Others (Write your own)';
|
|||
$lang->about_improper_comment_declare = 'Write here why you report this comment as an improper thing.';
|
||||
$lang->msg_deleted_comment = 'This comment has been deleted.';
|
||||
$lang->msg_admin_deleted_comment = 'This comment has been deleted by an administrator.';
|
||||
$lang->msg_comment_notify_mail = "[%s] A new comment was posted on document: \" %s \"";
|
||||
|
|
|
|||
|
|
@ -53,3 +53,4 @@ $lang->improper_comment_reasons['others'] = '기타(직접작성)';
|
|||
$lang->about_improper_comment_declare = '댓글을 신고하신 이유를 간단히 적어서 제출해주시면 관리자 검토 후 조치하겠습니다.';
|
||||
$lang->msg_deleted_comment = '삭제된 댓글입니다.';
|
||||
$lang->msg_admin_deleted_comment = '관리자가 삭제한 댓글입니다.';
|
||||
$lang->msg_comment_notify_mail = '[%s] 새로운 댓글이 등록되었습니다 : %s';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue