Bug 459251 - Implement new donor list page

Signed-off-by: droy <denis.roy@eclipse.org>
diff --git a/functions.php b/functions.php
index 88a1b0c..ea33750 100644
--- a/functions.php
+++ b/functions.php
@@ -1,6 +1,6 @@
 <?php
 /*******************************************************************************
- * Copyright (c) 2014 Eclipse Foundation and others.
+ * Copyright (c) 2014-2015 Eclipse Foundation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -179,14 +179,13 @@
         $f = $contributions->getFriendObject();
         $name = ucfirst(strtolower($f->getFirstName())) . ' ' . ucfirst(strtolower($f->getLastName()));
         $uid = $f->getLDAPUID();
-        $email = '';
-        if ($uid) {
+        if ($uid && $f->getEmail() != "") {
             $dn = $ldap->getDNFromUID($uid);
-            $email = $ldap->getLDAPAttribute($dn, 'mail');
+            $f->setEmail($ldap->getLDAPAttribute($dn, 'mail'));
         }
         $content .= '<div class="col-md-6 col-sm-8, col-xs-12">';
         $content .= '  <div class="user-picture">';
-        $content .= '    <img class="col-xm-24" typeof="foaf:Image" src="' . getGravatarURL($email) . '" alt="' . $name . '" title="' . $name . '" />';
+        $content .= '    <img class="col-xm-24" typeof="foaf:Image" src="' . getGravatarURL($f->getEmail()) . '" alt="' . $name . '" title="' . $name . '" />';
         $content .= '    <span class="col-xs-24 donor-name">' . $name . '</span>';
         $content .= '  </div>';
         $content .= '</div>';
@@ -204,4 +203,4 @@
     if (!$get_expired) $sql .= " AND FC.date_expired > NOW()";
     $result = $App->eclipse_sql($sql);
     return mysql_fetch_row($result)[0];
-}
+}
\ No newline at end of file