closes 289 : photo publique enlevee au lieu de photo point d'interrogation
authorPascal Corpet <pascal.corpet@m4x.org>
Thu, 24 Feb 2005 00:33:57 +0000 (00:33 +0000)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Thu, 26 Jun 2008 21:28:15 +0000 (23:28 +0200)
git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-493

htdocs/fiche.php
include/user.func.inc.php
templates/fiche.tpl

index ead3201..cf2e4f0 100644 (file)
@@ -73,7 +73,6 @@ if($user['x'] < 160){
     $user['y'] = (integer)($user['y']*160/$user['x']);
     $user['x'] = 160;
 }
-$page->assign('photo_url', $photo);
 
 // manage the public fiche
 $page->assign('logged', logged());
@@ -127,6 +126,9 @@ if (!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'] == ''
@@ -140,6 +142,7 @@ if (count($user['adr_pro']) == 0) unset($user['adr_pro']);
 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
index 7960b69..9d84c7c 100644 (file)
@@ -163,7 +163,7 @@ function &get_user_details($login, $from_uid = '')
                        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
index a72d1a3..3acb75d 100644 (file)
@@ -97,7 +97,7 @@ function chgMainWinLoc( strPage ) {
       </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}