appdb/include user.php

WineHQ wineowner at wine.codeweavers.com
Fri Mar 9 21:37:15 CST 2007


ChangeSet ID:	30948
CVSROOT:	/opt/cvs-commit
Module name:	appdb
Changes by:	wineowner at winehq.org	2007/03/09 21:37:15

Modified files:
	include        : user.php 

Log message:
	Alexander Nicolaysen Sørnes <alex at thehandofagony.com>
	Don't try to email admins multiple times

Patch: http://cvs.winehq.org/patch.py?id=30948

Old revision  New revision  Changes     Path
 1.82          1.83          +8 -19      appdb/include/user.php

Index: appdb/include/user.php
diff -u -p appdb/include/user.php:1.82 appdb/include/user.php:1.83
--- appdb/include/user.php:1.82	10 Mar 2007  3:37:15 -0000
+++ appdb/include/user.php	10 Mar 2007  3:37:15 -0000
@@ -682,8 +682,6 @@ class User {
      function get_notify_email_address_list($iAppId = null, $iVersionId = null)
      {
          $aUserId = array();
-         $c = 0;
-         $retval = "";
 
          /*
           * Retrieve version maintainers.
@@ -695,10 +693,7 @@ class User {
              if(mysql_num_rows($hResult) > 0)
              {
                  while($oRow = mysql_fetch_object($hResult))
-                 {
-                     $aUserId[$c] = array($oRow->userId);
-                     $c++;
-                 }
+                     $aUserId[] = $oRow->userId;
              }
          }
 
@@ -731,10 +726,7 @@ class User {
              if(mysql_num_rows($hResult) > 0)
              {
                  while($oRow = mysql_fetch_object($hResult))
-                 {
-                     $aUserId[$c] = array($oRow->userId);
-                     $c++;
-                 }
+                     $aUserId[] = $oRow->userId;
              }
          }
 
@@ -751,26 +743,23 @@ class User {
                  // if we didn't find this entry in the $aUserId
                  // array then we should add it
                  if($i === false)
-                 {
-                     $aUserId[$c] = array($oRow->userid);
-                     $c++;
-                 }
+                     $aUserId[] = $oRow->userid;
              }
          }
 
          // go through the email entries and only add the emails for the users
          // that want to receive it
-         if ($c > 0)
+         if (sizeof($aUserId) > 0)
          {
-             while(list($index, list($userIdValue)) = each($aUserId))
+             foreach($aUserId as $iUserId)
              {
-                 $oUser = new User($userIdValue);
+                 $oUser = new User($iUserId);
                  if ($oUser->wantsEmail())
-                     $retval .= $oUser->sEmail." ";
+                     $sRetval .= $oUser->sEmail." ";
              }
          }
 
-         return $retval;
+         return $sRetval;
      }
 
 



More information about the wine-cvs mailing list