gforge-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gforge-devel] util_handle_message changes


From: Ryan T. Sammartino
Subject: [Gforge-devel] util_handle_message changes
Date: Sun, 26 Jan 2003 14:43:17 -0800
User-agent: Mutt/1.4i

I'd like to commit this change but would first like to see if there was
a compelling reason why things are the way they are currently... 


Index: common/include/utils.php
===================================================================
RCS file: /cvsroot/gforge/gforge/common/include/utils.php,v
retrieving revision 1.16
diff -u -r1.16 utils.php
--- common/include/utils.php    21 Jan 2003 08:41:23 -0000      1.16
+++ common/include/utils.php    26 Jan 2003 22:37:34 -0000
@@ -65,9 +65,6 @@
        if (!$from) {
                $from='noreply@'.$GLOBALS['sys_default_domain'];
        }
-       if (!$to) {
-               $to='noreply@'.$GLOBALS['sys_default_domain'];
-       }
        $body = "To: $to".
                "\nFrom: $from".
                "\nBCC: $BCC".
@@ -144,11 +141,15 @@
        if (count($id_arr) < 1) {
 
        } else {
-               $res=db_query("SELECT jabber_address,email,jabber_only
+               $res=db_query("SELECT user_id, jabber_address,email,jabber_only
                        FROM users WHERE user_id IN (". implode($id_arr,',') 
.")");
                $rows=db_numrows($res);
 
                for ($i=0; $i<$rows; $i++) {
+                       if (db_result($res, $i, 'user_id') == 100) {
+                               // Do not send e-mail to "Nobody"
+                               continue;
+                       }
                        //
                        //  Build arrays of the jabber address
                        //
@@ -169,7 +170,7 @@
                }
        }
        if ($extra_email1 || $extra_emails) {
-               
util_send_message('',$subject,$body,'',$extra_email1.$extra_emails);
+               
util_send_message($extra_email1,$subject,$body,'',$extra_emails);
        }
        if ($extra_jabber1 || $extra_jabbers) {
                util_send_jabber($extra_jabber1.$extra_jabbers,$subject,$body);



The first hunk removes some copy and pasted code.

The second hunk makes sure we don't send e-mail/jabber messages to the
"Nobody" user.  gforge3.sql set Nobody's e-mail address to
address@hidden, so they must be wondering why so much e-mail
is being sent there. :)

The third hunk properly sets the "To:" parameter for e-mail addresses...
this is the thing I'm wondering about... why was it left blank?  Why is
everyone on the BCC: list?  Also, why does util_send_message use BCC:
instead of CC:?  What's the big secret? :)

-- 
Ryan T. Sammartino
http://members.shaw.ca/ryants/
You can't judge a book by the way it wears its hair.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]