5 * Copyright 1999-2000, Tim Perdue/Sourceforge
6 * Copyright 2002, Tim Perdue/GForge, LLC
7 * Copyright 2009, Roland Mas
9 * This file is part of FusionForge.
11 * FusionForge is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published
13 * by the Free Software Foundation; either version 2 of the License,
14 * or (at your option) any later version.
16 * FusionForge is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with FusionForge; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
27 require_once $gfcommon.'include/Error.class.php';
28 include_once $gfcommon.'include/TextSanitizer.class.php'; // for parsing the mail body
29 include_once $gfcommon.'include/User.class.php';
31 class ForumMessage extends Error {
33 var $awaits_moderation;//boolean -> true if the message was inserted for approval (pending), false if not
35 * Associative array of data from db.
37 * @var array $data_array.
51 * @param object The Forum object to which this ForumMessage is associated.
52 * @param int The message_id.
53 * @param array The associative array of data.
54 * @param boolean Whether the message is a pending one.
55 * @return boolean success.
57 function ForumMessage(&$Forum, $msg_id=false, $arr=false, $pending=false) {
59 if (!$Forum || !is_object($Forum)) {
60 $this->setError(_('ForumMessage:: No Valid Forum Object'));
63 if ($Forum->isError()) {
64 $this->setError('ForumMessage:: '.$Forum->getErrorMessage());
67 $this->Forum =& $Forum;
71 //we are going to create the pending message to show it to the admin for moderation
72 if (!$this->fetchModeratedData($msg_id)) {
75 $this->awaits_moderation = true;
77 $this->awaits_moderation = false;
78 if (!$arr || !is_array($arr)) {
79 if (!$this->fetchData($msg_id)) {
83 $this->data_array =& $arr;
85 // Verify this message truly belongs to this Forum
87 if ($this->data_array['group_forum_id'] != $this->Forum->getID()) {
88 $this->setError(_('Group_forum_id in db result does not match Forum Object'));
89 $this->data_array=null;
99 * insertmoderated - inserts the message into the table for moderation (forum_pending_messages)
100 * @param string The subject of the message.
101 * @param string The body of the message.
102 * @param int The thread_id of the message, if known.
103 * @param int The message_id of the parent message, if any.
104 * @param int The id of the user that is posting the message
105 * @return boolean success.
108 function insertmoderated($subject, $body, $thread_id='', $is_followup_to='',$user_id) {
110 $thread_id=$this->Forum->getNextThreadID();
113 $this->setError('ForumMessage::create() '._('Getting next thread_id failed'));
119 $result = db_query_params ('INSERT INTO forum_pending_messages (group_forum_id,posted_by,subject,
120 body,post_date,is_followup_to,thread_id,most_recent_date) VALUES ($1,$2,$3,$4,$5,$6,$7,$8)',
121 array ($this->Forum->getID(),
123 htmlspecialchars($subject),
129 if (!$result || db_affected_rows($result) < 1) {
130 $this->setError(_('ForumMessage::create() Posting Failed').' '.db_error());
134 $msg_id=db_insertid($result,'forum_pending_messages','msg_id');
135 if (!$this->fetchModeratedData($msg_id)) {
141 $this->setError(_('ForumMessage::create() Unable to get new message id'));
144 if (!$this->sendNewModeratedMsgNotice()) {
149 $this->awaits_moderation = true;
157 * insertreleasedmsg - inserts the released message into the main table (forum)
158 * @param string The Forum id
159 * @param string The subject of the message.
160 * @param string The body of the message.
161 * @param string The post date
162 * @param int The thread_id of the message
163 * @param int The message_id of the parent message, if any.
164 * @param int The id of the user that is posting the message
165 * @param int has followups?
166 * @param int most recent date
167 * @return boolean success.
170 function insertreleasedmsg($group_forum_id,$subject, $body,$post_date, $thread_id, $is_followup_to,$posted_by,$has_followups,$most_recent_date) {
171 if ($is_followup_to != 0) {
173 //was posted in reply to another thread
174 //we must check whether that thread still exists. if it does, post the message. else, set the error
176 // increment the parent's followup count if necessary
179 $res4 = db_query_params ('UPDATE forum SET most_recent_date=$1 WHERE thread_id=$2 AND is_followup_to=0',
182 if (!$res4 || db_affected_rows($res4) < 1) {
183 $this->setError(_('Couldn\'t Update Master Thread parent with current time'));
188 // mark the parent with followups as an optimization later
190 $res3 = db_query_params ('UPDATE forum SET has_followups=1,most_recent_date=$1 WHERE msg_id=$2',
194 $this->setError(_('Could Not Update Parent'));
204 $result = db_query_params ('INSERT INTO forum (group_forum_id,posted_by,subject,body,post_date,is_followup_to,thread_id,most_recent_date) VALUES ($1,$2,$3,$4,$5,$6,$7,$8)',
205 array ($group_forum_id,
207 htmlspecialchars($subject),
212 $most_recent_date)) ;
214 if (!$result || db_affected_rows($result) < 1) {
215 $this->setError(_('ForumMessage::create() Posting Failed').' '.db_error());
219 $msg_id=db_insertid($result,'forum','msg_id');
220 if (!$this->fetchData($msg_id)) {
221 $this->setError(_('ForumMessage::create() Posting Failed').' '.db_error());
226 $this->setError(_('ForumMessage::create() Unable to get new message id'));
230 if (!$this->sendNotice()) {
235 $this->awaits_moderation = false;
244 * insertmsg - inserts the message into the main table (forum)
245 * @param string The subject of the message.
246 * @param string The body of the message.
247 * @param int The thread_id of the message, if known.
248 * @param int The message_id of the parent message, if any.
249 * @param int The id of the user that is posting the message
250 * @param boolean Whether the message has an attach associated. Defaults to false
251 * @return boolean success.
254 function insertmsg($subject, $body, $thread_id='', $is_followup_to='',$user_id,$has_attach=false) {
256 $thread_id=$this->Forum->getNextThreadID();
259 $this->setError('ForumMessage::create() '._('Getting next thread_id failed'));
265 // increment the parent's followup count if necessary
267 $res4 = db_query_params ('UPDATE forum SET most_recent_date=$1 WHERE thread_id=$2 AND is_followup_to=0',
270 if (!$res4 || db_affected_rows($res4) < 1) {
271 $this->setError(_('Couldn\'t Update Master Thread parent with current time'));
276 // mark the parent with followups as an optimization later
278 $res3 = db_query_params ('UPDATE forum SET has_followups=1,most_recent_date=$1 WHERE msg_id=$2',
282 $this->setError(_('Could Not Update Parent'));
289 $result = db_query_params ('INSERT INTO forum (group_forum_id,posted_by,subject,body,post_date,is_followup_to,thread_id,most_recent_date) VALUES ($1,$2,$3,$4,$5,$6,$7,$8)',
290 array ($this->Forum->getID(),
292 htmlspecialchars($subject),
298 if (!$result || db_affected_rows($result) < 1) {
299 $this->setError(_('ForumMessage::create() Posting Failed').' '.db_error());
304 $msg_id=db_insertid($result,'forum','msg_id');
305 if (!$this->fetchData($msg_id)) {
311 $this->setError(_('ForumMessage::create() Unable to get new message id'));
316 if (!$this->sendNotice($has_attach)) {
322 //echo "db_error()".db_error();
323 $this->awaits_moderation = false;
329 * create - use this function to create a new message in the database.
331 * @param string The subject of the message.
332 * @param string The body of the message.
333 * @param int The thread_id of the message, if known.
334 * @param int The message_id of the parent message, if any.
335 * @param boolean Whether the message has an attach associated. Defaults to false
336 * @return boolean success.
338 function create($subject, $body, $thread_id='', $is_followup_to='',$has_attach=false) {
339 if (!$body || !$subject) {
340 $this->setError(_('Must Include A Message Body And Subject'));
343 if (!forge_check_perm ('forum', $this->Forum->getID(), 'post')) {
344 $this->setPermissionDeniedError();
347 if (!session_loggedin()) {
350 $user_id=user_getid();
353 if ($is_followup_to) {
354 $ParentMessage=new ForumMessage($this->Forum,$is_followup_to);
355 if (!$ParentMessage || !is_object($ParentMessage)) {
356 $this->setError("ForumMessage::create()"._('ForumMessage::create() No Valid ParentMessage Object'));
359 if ($ParentMessage->isError()) {
360 $this->setError('ForumMessage::create() '.$ParentMessage->getErrorMessage());
364 if (!$is_followup_to) {
370 //now we check the moderation status of the forum and act accordingly
371 if (forge_check_perm ('forum', $this->Forum->getID(), 'unmoderated_post')) {
373 return $this->insertmsg($subject, $body, $thread_id, $is_followup_to,$user_id,$has_attach);
375 return $this->insertmoderated($subject, $body, $thread_id, $is_followup_to,$user_id);
380 * fetchData - re-fetch the data for this forum_message from the database.
382 * @param int The message ID.
383 * @return boolean success.
385 function fetchData($msg_id) {
386 $res = db_query_params ('SELECT * FROM forum_user_vw WHERE msg_id=$1 AND group_forum_id=$2',
388 $this->Forum->getID())) ;
389 if (!$res || db_numrows($res) < 1) {
390 $this->setError(_('ForumMessage::fetchData() Invalid MessageID').db_error());
393 $this->data_array = db_fetch_array($res);
394 db_free_result($res);
399 * fetchModeratedData - re-fetch the data for this forum_message from the database, for pending messages
401 * @param int The message ID.
402 * @return boolean success.
404 function fetchModeratedData($msg_id) {
405 $res = db_query_params ('SELECT * FROM forum_pending_user_vw WHERE msg_id=$1 AND group_forum_id=$2',
407 $this->Forum->getID())) ;
408 if (!$res || db_numrows($res) < 1) {
409 $this->setError(_('ForumMessage::fetchData() Invalid MessageID').db_error());
412 $this->data_array = db_fetch_array($res);
413 db_free_result($res);
418 * getForum - get the Forum object this ForumMessage is associated with.
420 * @return object The Forum object.
422 function &getForum() {
427 * getID - get this message_id.
429 * @return int The message_id.
432 return $this->data_array['msg_id'];
436 * getPosterName - get the unix user_name of this message's poster.
438 * @return string The poster's unix name.
440 function getPosterName() {
441 return $this->data_array['user_name'];
445 * getPosterID - get this user_id of this message's poster.
447 * @return int The user_id.
449 function getPosterID() {
450 return $this->data_array['posted_by'];
454 * getPosterRealName - get the real name of this message's poster.
456 * @return string The real name.
458 function getPosterRealName() {
459 return $this->data_array['realname'];
463 * getSubject - get the subject of this message.
465 * @return string The subject.
467 function getSubject() {
468 return $this->data_array['subject'];
472 * getBody - get the body of this message.
474 * @return String The body.
477 return $this->data_array['body'];
481 * getPostDate - get the post date of this message.
483 * @return int The post date.
485 function getPostDate() {
486 return $this->data_array['post_date'];
490 * getParentID - get the id of the parent message, if this is a followup.
492 * @return int The parent id.
494 function getParentID() {
495 return $this->data_array['is_followup_to'];
499 * isPending - is the message pending, awaiting moderation?
501 * @return int awaits_moderation
503 function isPending() {
504 return $this->awaits_moderation;
508 * getThreadID - get the thread_id of the message.
510 * @return int The thread_id.
512 function getThreadID() {
513 return $this->data_array['thread_id'];
517 * getMostRecentDate - get the date of the most recent followup.
519 * @return int The date of the most recent followup.
521 function getMostRecentDate() {
522 return $this->data_array['most_recent_date'];
526 * hasFollowups - whether this message has any followups.
528 * @return boolean has_followups.
530 function hasFollowups() {
531 return $this->data_array['has_followups'];
535 * hasAttach - whether this message has an attachment.
537 * @return boolean has_attach.
540 function hasAttach() {
541 if ($this->isPending()) {
542 $res = db_query_params ('SELECT attachmentid FROM forum_pending_attachment WHERE msg_id=$1',
543 array ($this->getID())) ;
545 $res = db_query_params ('SELECT attachmentid FROM forum_attachment WHERE msg_id=$1',
546 array ($this->getID())) ;
548 if (db_numrows($res) > 0) {
555 * delete - Delete this message and its followups.
557 * @return int The count of deleted messages.
560 $msg_id=$this->getID();
562 $this->setError(_('Invalid Message ID'));
566 if (!forge_check_perm ('forum_admin', $this->Forum->Group->getID())) {
567 $this->setPermissionDeniedError();
571 $result = db_query_params ('SELECT msg_id FROM forum
572 WHERE is_followup_to=$1
573 AND group_forum_id=$2',
575 $this->Forum->getID())) ;
576 $rows=db_numrows($result);
579 for ($i=0;$i<$rows;$i++) {
580 $msg = new ForumMessage($this->Forum,db_result($result,$i,'msg_id'));
581 $count += $msg->delete();
583 $toss = db_query_params ('DELETE FROM forum
585 AND group_forum_id=$2',
587 $this->Forum->getID())) ;
589 $res = db_query_params ('DELETE FROM forum_attachment where msg_id=$1',
596 * removebbcode - workaround to remove bbcode tags.
598 * @return string converted text
600 function removebbcode($text) {
601 //$replaced = preg_replace("/\[[_a-zA-Z]:.+\](.+)\[\/[_a-zA-Z]:.*\]/","$1",$text);
602 $replaced = preg_replace("/\[.+\](.+)\[\/.+\]/","$1",$text);
607 * sendNotice - contains the logic to send out email followups when a message is posted.
609 * @param boolean Whether the message has an attach associated. Defaults to false
611 * @return boolean success.
613 function sendNotice($has_attach=false) {
614 $ids = $this->Forum->getMonitoringIDs();
616 $recipients = array ();
617 foreach ($ids as $id) {
618 $recipient = user_get_object ($id) ;
619 if ($recipient->isActive()) {
620 $recipients[] = $recipient ;
623 if ($this->Forum->getSendAllPostsTo()) {
624 $sapt = explode (',', $this->Forum->getSendAllPostsTo()) ;
625 foreach ($sapt as $r) {
630 if (count ($recipients) == 0) {
634 foreach ($recipients as $recipient) {
635 if (is_a ($recipient, 'GFUser')) {
636 setup_gettext_for_user ($recipient) ;
637 $dest_email = $recipient->getEmail ();
639 setup_gettext_from_sys_lang ();
640 $dest_email = $recipient ;
643 $body = sprintf(_("\nRead and respond to this message at: \n%s"), util_make_url ('/forum/message.php?msg_id='.$this->getID()));
644 if (forge_get_config('use_mail')) {
645 $body .= stripcslashes(sprintf(_('
646 Or reply to this e-mail entering your response between the following markers:
648 (enter your response here)
649 %1$s'), FORUM_MAIL_MARKER));
651 $body .= sprintf(_("\n\n\nBy: %s\n"), $this->getPosterRealName());
654 //if there's an attachment for the message, make it note.
655 //Note: We can't give a link for the attachment here because it hasn't been created yet (first the message needs to be created
656 $body .= _("A file has been uploaded with this message.")."\n\n";
660 $sanitizer = new TextSanitizer();
661 $text = $this->getBody();
662 $text = $sanitizer->convertNeededTagsForEmail($text);
663 $text= strip_tags($this->removebbcode(util_line_wrap($text)));
664 $text = $sanitizer->convertExtendedCharsForEmail($text);
666 "%s\n\n______________________________________________________________________\n".
667 _("You are receiving this email because you elected to monitor this forum.".
668 "\nTo stop monitoring this forum, login to %s and visit: \n%s\n"),
670 forge_get_config ('forge_name'),
671 util_make_url('/forum/monitor.php?forum_id='.$this->Forum->getID().
672 '&group_id='.$this->Forum->Group->getID().'&stop=1')
675 $extra_headers = "Return-Path: <noreply@".forge_get_config('web_host').">\n";
676 $extra_headers .= "Errors-To: <noreply@".forge_get_config('web_host').">\n";
677 $extra_headers .= "Sender: <noreply@".forge_get_config('web_host').">\n";
678 $extra_headers .= "Reply-To: ".$this->Forum->getReturnEmailAddress()."\n";
679 $extra_headers .= "Precedence: Bulk\n"
680 ."List-Id: ".$this->Forum->getName()." <forum".$this->Forum->getId()."@".forge_get_config('web_host').">\n"
681 ."List-Help: ".util_make_url ('/forum/forum.php?id='.$this->Forum->getId())."\n"
682 ."Message-Id: <forumpost".$this->getId()."@".forge_get_config('web_host').">";
683 $parentid = $this->getParentId();
684 if (!empty($parentid)) {
685 $extra_headers .= "\nIn-Reply-To: ".$this->Forum->getReturnEmailAddress()."\n"
686 ."References: <forumpost".$this->getParentId()."@".forge_get_config('web_host').">";
689 $subject="[" . $this->Forum->getUnixName() ."][".$this->getID()."] ".util_unconvert_htmlspecialchars($this->getSubject());
691 util_send_message($dest_email,$subject,$body,"noreply@".forge_get_config('web_host'),'','Forum',$extra_headers);
694 // Switch back to the user language settings
695 setup_gettext_from_context();
700 * sendNewModeratedMsgNotice - contains the logic to send out email notifications to the forum admins when a new moderated message is posted
702 * @return boolean success.
704 function sendNewModeratedMsgNotice() {
706 $engine = RBACEngine::getInstance () ;
707 $moderators = $engine->getUsersByAllowedAction ('forum', $this->Forum->getID(), 'moderate') ;
709 foreach ($moderators as $m) {
710 $ids[] = $m->getID () ;
714 // See if there is anyone to send messages to
716 if (!count($ids) > 0 && !$this->Forum->getSendAllPostsTo()) {
720 $f =& $this->getForum();
721 $g =& $f->getGroup();
723 $body = "\nRead to this message and approve/reject it at: ".
724 "\n".util_make_url('/forum/admin/pending.php?action=view_pending&group_id='. $g->getID() . "&forum_id=" . $f->getID()) .
725 "\nBy: " . $this->getPosterRealName() . "\n\n";
727 $text = $this->getBody();
728 $sanitizer = new TextSanitizer();
729 $text = $sanitizer->convertNeededTagsForEmail($text);
730 $text= strip_tags($this->removebbcode(util_line_wrap($text)));
731 $text = $sanitizer->convertExtendedCharsForEmail($text);
733 "\n\n______________________________________________________________________".
734 "\nYou are receiving this email because the forum you administrate has a new moderated message awaiting your approval.";
736 //$extra_headers = 'Reply-to: '.$this->Forum->getUnixName().'@'.forge_get_config('web_host');
737 $extra_headers = "Return-Path: <noreply@".forge_get_config('web_host').">\n";
738 $extra_headers .= "Errors-To: <noreply@".forge_get_config('web_host').">\n";
739 $extra_headers .= "Sender: <noreply@".forge_get_config('web_host').">\n";
740 $extra_headers .= "Reply-To: ".$this->Forum->getReturnEmailAddress()."\n";
741 $extra_headers .= "Precedence: Bulk\n"
742 ."List-Id: ".$this->Forum->getName()." <forum".$this->Forum->getId()."@".forge_get_config('web_host').">\n"
743 ."List-Help: ".util_make_url('/forum/forum.php?id='.$this->Forum->getId())."\n"
744 ."Message-Id: <forumpost".$this->getId()."@".forge_get_config('web_host').">";
745 $parentid = $this->getParentId();
746 if (!empty($parentid)) {
747 $extra_headers .= "\nIn-Reply-To: ".$this->Forum->getReturnEmailAddress()."\n"
748 ."References: <forumpost".$this->getParentId()."@".forge_get_config('web_host').">";
751 $subject="[" . $this->Forum->getUnixName() ."][".$this->getID()."] ".util_unconvert_htmlspecialchars($this->getSubject());
752 if (count($ids) != 0) {
753 $bccres = db_query_params ('SELECT email FROM users WHERE status=$1 AND user_id = ANY ($2)',
755 db_int_array_to_any_clause ($ids))) ;
758 $BCC = implode(util_result_column_to_array($bccres),',').','.$this->Forum->getSendAllPostsTo();
759 $User = user_get_object($this->getPosterID());
760 //util_send_message('',$subject,$body,$User->getEmail(),$BCC,$this->getPosterRealName(),$extra_headers);
761 util_send_message('',$subject,$body,"noreply@".forge_get_config('web_host'),$BCC,'Forum',$extra_headers);
762 // util_handle_message(array_unique($ids),$subject,$body,$this->Forum->getSendAllPostsTo(),'','forumgateway@'.forge_get_config('web_host'));
767 * updatemsg - impacts in the DB the new content of the message
769 * @param string The forum ID
770 * @param int The id of the user that is posting the message
771 * @param string The subject of the message.
772 * @param string The body of the message.
773 * @param string The post date
774 * @param int The message_id of the parent message, if any.
775 * @param int The thread_id of the message, if known.
776 * @param int has followups?
777 * @param string The most recent date.
779 * @return boolean success.
781 function updatemsg($group_forum_id,$posted_by,$subject,$body,$post_date,$is_followup_to,$thread_id,$has_followups,$most_recent_date) {
782 $subject = htmlspecialchars($subject);
784 $msg_id = $this->getID();
785 $res = db_query_params ('UPDATE forum
786 SET group_forum_id=$1, posted_by=$2, subject=$3,
787 body=$4, post_date=$5, is_followup_to=$6,
788 thread_id=$7, most_recent_date=$8
790 array ($group_forum_id,
800 $this->setError(db_error());
803 if (db_affected_rows($res)<1) {
804 $this->setError("Message not found");
812 * sendAttachNotice - contains the logic to send out email attachement followups when a message is posted.
814 * @param int attach_id - The id of the file that has been attached
816 * @return boolean success.
818 function sendAttachNotice($attach_id) {
820 $ids = $this->Forum->getMonitoringIDs();
823 // See if there is anyone to send messages to
825 if (!count($ids) > 0 && !$this->Forum->getSendAllPostsTo()) {
829 $body = "\nRead and respond to this message at: ".
830 "\n".util_make_url('/forum/message.php?msg_id='.$this->getID()).
831 "\nBy: " . $this->getPosterRealName() . "\n\n";
833 $body .= "A file has been uploaded to this message, you can download it at: ".
834 "\n".util_make_url('/forum/attachment.php?attachid='. $attach_id . "&group_id=" . $this->Forum->Group->getID() . "&forum_id=" . $this->Forum->getID()) . "\n\n";
837 "\n\n______________________________________________________________________".
838 "\nYou are receiving this email because you elected to monitor this forum.".
839 "\nTo stop monitoring this forum, login to ".forge_get_config ('forge_name')." and visit: ".
840 "\n".util_make_url ('/forum/monitor.php?forum_id='.$this->Forum->getID() .'&group_id='.$this->Forum->Group->getID().'&stop=1');
842 $extra_headers = "Return-Path: <noreply@".forge_get_config('web_host').">\n";
843 $extra_headers .= "Errors-To: <noreply@".forge_get_config('web_host').">\n";
844 $extra_headers .= "Sender: <noreply@".forge_get_config('web_host').">\n";
845 $extra_headers .= "Reply-To: ".$this->Forum->getReturnEmailAddress()."\n";
846 $extra_headers .= "Precedence: Bulk\n"
847 ."List-Id: ".$this->Forum->getName()." <forum".$this->Forum->getId()."@".forge_get_config('web_host').">\n"
848 ."List-Help: ".util_make_url('/forum/forum.php?id='.$this->Forum->getId())."\n"
849 ."Message-Id: <forumpost".$this->getId()."@".forge_get_config('web_host').">";
850 $parentid = $this->getParentId();
851 if (!empty($parentid)) {
852 $extra_headers .= "\nIn-Reply-To: ".$this->Forum->getReturnEmailAddress()."\n"
853 ."References: <forumpost".$this->getParentId()."@".forge_get_config('web_host').">";
856 $subject="[" . $this->Forum->getUnixName() ."][".$this->getID()."] ".util_unconvert_htmlspecialchars($this->getSubject());
857 if (count($ids) != 0) {
858 $bccres = db_query_params ('SELECT email FROM users WHERE status=$1 AND user_id = ANY ($2)',
860 db_int_array_to_any_clause ($ids))) ;
862 $BCC =& implode(util_result_column_to_array($bccres),',').','.$this->Forum->getSendAllPostsTo();
863 $User = user_get_object($this->getPosterID());
864 util_send_message('',$subject,$body,"noreply@".forge_get_config('web_host'),$BCC,'Forum',$extra_headers);
874 // c-file-style: "bsd"