getphoto does not take uid anymore
authorPierre Habouzit (MadCoder <pierre.habouzit@m4x.org>
Mon, 10 Jan 2005 15:52:18 +0000 (15:52 +0000)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Thu, 26 Jun 2008 21:27:22 +0000 (23:27 +0200)
git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-264

htdocs/getphoto.php
templates/admin/admin_trombino.tpl
templates/include/form.valid.photos.tpl
templates/profil/general.tpl
templates/trombino.tpl

index 4cd6956..815b35f 100644 (file)
@@ -30,15 +30,11 @@ if (Env::has('x')) {
        Header('Content-type: image/'.$myphoto->mimetype);
        echo $myphoto->data;
     } else {
-       if(preg_match('/^\d*$/', Env::get('x'))) {
-           $res = $globals->xdb->query('SELECT attachmime, attach FROM photo WHERE uid = {?}', Env::getInt('x'));
-       } else {
-           $res = $globals->xdb->query(
-                    "SELECT  attachmime, attach
-                       FROM  photo   AS p
-                 INNER JOIN  aliases AS a ON p.uid=a.id
-                      WHERE  alias={?}", Env::get('x'));
-       }
+        $res = $globals->xdb->query(
+                "SELECT  attachmime, attach
+                   FROM  photo   AS p
+             INNER JOIN  aliases AS a ON p.uid=a.id
+                  WHERE  alias={?}", Env::get('x'));
 
        if( list($type,$data) = $res->fetchOneRow() ) {
            Header(  "Content-type: image/$type");
index ea6b7df..984cbd8 100644 (file)
 Photo actuelle de {$forlife}
 </p>
 
-<img src="../getphoto.php?x={$smarty.request.uid}" alt="[ PHOTO ]" />
+<img src="../getphoto.php?x={$forlife}" alt="[ PHOTO ]" />
 <br />
 
 <p>
-<a href="{$smarty.server.PHP_SELF}?uid={$smarty.request.uid}&amp;action=supprimer">Supprimer cette photo</a>
+<a href="?uid={$smarty.request.uid}&amp;action=supprimer">Supprimer cette photo</a>
 </p>
 
 <p>
-<a href="{$smarty.server.PHP_SELF}?uid={$smarty.request.uid}&amp;action=ecole">Voir sa photo de trombi récupérée à l'école (si disponible)</a>
+<a href="?uid={$smarty.request.uid}&amp;action=ecole">Voir sa photo de trombi récupérée à l'école (si disponible)</a>
 </p>
 
 <form action="{$smarty.server.PHP_SELF}" method="post" enctype="multipart/form-data">
index 06b6bc4..e6b1dfd 100644 (file)
@@ -21,9 +21,9 @@
 <tr class="pair">
   <td class="titre">Photos</td>
   <td>
-    <img src="{rel}/getphoto.php?x={$valid->uid}" style="width:110px;" alt=" [ PHOTO ] " />
+    <img src="{rel}/getphoto.php?x={$valid->forlife}" style="width:110px;" alt=" [ PHOTO ] " />
     &nbsp;&nbsp;&nbsp;&nbsp;
-    <img src="{rel}/getphoto.php?x={$valid->uid}&amp;req=true" style="width:110px;" alt=" [ PHOTO ] " />
+    <img src="{rel}/getphoto.php?x={$valid->forlife}&amp;req=true" style="width:110px;" alt=" [ PHOTO ] " />
   </td>
 </tr>
 
index d731365..a5ea19a 100644 (file)
               {/if}.
             </td>
             <td class="dcolg">
-              <img src="getphoto.php?x={$smarty.session.uid}{*{if $smarty.cookies|@count == 0}&amp;{php}echo SID;{/php}{/if}*}" alt=" [ PHOTO ] " />
+              <img src="getphoto.php?x={$smarty.session.forlife}" alt=" [ PHOTO ] " />
             </td>
           </tr>
         </table>
index 9f3db6b..e4ade73 100644 (file)
     </tr>
     <tr>
       <td class="center">
-        <img src="{rel}/getphoto.php?x={$smarty.session.uid}" width="200" alt=" [ PHOTO ] " />
+        <img src="{rel}/getphoto.php?x={$smarty.session.forlife}" width="200" alt=" [ PHOTO ] " />
       </td>
       <td class="center half">
         {if $submited}
-        <img src="{rel}/getphoto.php?x={$smarty.session.uid}&amp;req=true" width="200" alt=" [ PHOTO ] " />
+        <img src="{rel}/getphoto.php?x={$smarty.session.forlife}&amp;req=true" width="200" alt=" [ PHOTO ] " />
         {else}
         Pas d'image soumise
         {/if}