[evolvis-commits] r8363: remove duplicated code; do not send messages to Nobody↵

mirabilos at evolvis.org mirabilos at evolvis.org
Thu Feb 24 16:40:47 CET 2011


Author: mirabilos
Date: 2011-02-24 16:40:46 +0100 (Thu, 24 Feb 2011)
New Revision: 8363

Modified:
   trunk/gforge_base/evolvisforge-5.1/gforge/ChangeLog
   trunk/gforge_base/evolvisforge-5.1/gforge/common/include/utils.php
Log:
remove duplicated code; do not send messages to Nobody


Modified: trunk/gforge_base/evolvisforge-5.1/gforge/ChangeLog
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/ChangeLog	2011-02-24 15:40:44 UTC (rev 8362)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/ChangeLog	2011-02-24 15:40:46 UTC (rev 8363)
@@ -1,3 +1,9 @@
+2003-01-26  Ryan T. Sammartino  <ryants at shaw.ca>
+
+	* common/include/utils.php(util_send_message): remove duplicated
+	code.
+	(util_handle_message): do not send messages to "Nobody".
+
 2003-01-25  Ryan T. Sammartino  <ryants at shaw.ca>
 
 	* cronjobs/mail/mailing_lists_create.php: lowercase all list names,

Modified: trunk/gforge_base/evolvisforge-5.1/gforge/common/include/utils.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/common/include/utils.php	2011-02-24 15:40:44 UTC (rev 8362)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/common/include/utils.php	2011-02-24 15:40:46 UTC (rev 8363)
@@ -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 messages to "Nobody"
+				continue;
+			}
 			//
 			//  Build arrays of the jabber address
 			//



More information about the evolvis-commits mailing list