git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-493
     $user['y'] = (integer)($user['y']*160/$user['x']);
     $user['x'] = 160;
 }
-$page->assign('photo_url', $photo);
 
 // manage the public fiche
 $page->assign('logged', logged());
     if ($user['medals_pub'] != 'public') {
         unset($user['medals']);
     }
+    if ($user['photo_pub'] != 'public') {
+        $photo = "";
+    }
 }
 foreach($user['adr_pro'] as $i=>$pro) {
     if ($pro['entreprise'] == '' && $pro['fonction'] == ''
 if (count($user['adr']) == 0) unset($user['adr']);
 $page->assign_by_ref('x', $user);
 
+$page->assign('photo_url', $photo);
 // alias virtual
 $res = $globals->xdb->query(
        "SELECT alias
 
                        IF(gp.nat='',gp.pays,gp.nat) AS nationalite, gp.a2 AS iso3166,
                        a.alias AS forlife, a2.alias AS bestalias,
                        c.uid IS NOT NULL AS is_contact,
-                       s.text AS section, p.x, p.y,
+                       s.text AS section, p.x, p.y, p.pub AS photo_pub,
                        m.expertise != '' AS is_referent
                        
                  FROM  auth_user_md5   AS u
 
       </div>
     </td>
     <td rowspan="4" id='photo'>
-      <img alt="Photo de {$x.forlife}" src="{$photo_url}" width="{$x.x}" height="{$x.y}" />
+      {if $photo_url}<img alt="Photo de {$x.forlife}" src="{$photo_url}" width="{$x.x}" height="{$x.y}" />{/if}
       {min_auth level="cookie"}
       {if $x.section}<em class="intitule">Section : </em><span>{$x.section}</span><br />{/if}
       {if $x.binets_join}<em class="intitule">Binet(s) : </em><span>{$x.binets_join}</span><br />{/if}