Clear mentor entry of the user when is expertise is empty.
[platal.git] / modules / marketing.php
index 997865e..a272c31 100644 (file)
@@ -79,6 +79,7 @@ class MarketingModule extends PLModule
     function handler_private(&$page, $uid = null,
                              $action = null, $value = null)
     {
+        global $globals;
         $page->changeTpl('marketing/private.tpl');
 
         if (is_null($uid)) {
@@ -179,7 +180,7 @@ class MarketingModule extends PLModule
 
         $res = Xdb::query("SELECT  u.nom, u.prenom, u.promo, FIND_IN_SET('femme', u.flags) AS sexe,
                                    u.deces = '0000-00-00' AS alive, a.alias AS forlife, b.alias AS bestalias,
-                                   e.email, e.last
+                                   IF(e.email IS NOT NULL, e.email, IF(FIND_IN_SET('googleapps', u.mail_storage), 'googleapps', NULL)) AS email, e.last
                              FROM  auth_user_md5 AS u
                        INNER JOIN  aliases       AS a ON (a.id = u.user_id AND a.type = 'a_vie')
                        INNER JOIN  aliases       AS b ON (b.id = u.user_id AND FIND_IN_SET('bestalias', b.flags))