hop hop hop, more fixes
authorx2000habouzit <x2000habouzit>
Thu, 2 Sep 2004 23:06:10 +0000 (23:06 +0000)
committerx2000habouzit <x2000habouzit>
Thu, 2 Sep 2004 23:06:10 +0000 (23:06 +0000)
htdocs/admin/utilisateurs.php
htdocs/epouse.php
htdocs/login.php
htdocs/mescontacts.php
templates/admin/utilisateurs.tpl
templates/include/x_inscrit.tpl
templates/login.tpl

index 9390243..3beeb5b 100644 (file)
@@ -18,7 +18,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: utilisateurs.php,v 1.16 2004-09-02 19:39:20 x2000habouzit Exp $
+        $Id: utilisateurs.php,v 1.17 2004-09-02 23:06:11 x2000habouzit Exp $
  ***************************************************************************/
 
 require("auto.prepend.inc.php");
@@ -163,6 +163,10 @@ if (!empty($_REQUEST['user_id'])) {
 }
     
 if(isset($mr)) {
+    $r=$globals->db->query("SELECT alias FROM aliases WHERE ( id = {$mr['user_id']} AND tpe='a_vie' )");
+    list($forlife) = mysql_fetch_row($r);
+    mysql_free_result($r);
+    $mr['forlife'] = $forlife;
     $page->assign('mr',$mr);
 
     $result=$globals->db->query("SELECT  UNIX_TIMESTAMP(s.start), s.host
index bedd433..1a1b3d1 100644 (file)
@@ -18,7 +18,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: epouse.php,v 1.6 2004-09-01 22:15:54 x2000habouzit Exp $
+        $Id: epouse.php,v 1.7 2004-09-02 23:06:10 x2000habouzit Exp $
  ***************************************************************************/
 
 require("auto.prepend.inc.php");
@@ -44,8 +44,8 @@ if (!empty($_REQUEST['submit']) && ($epouse != $epouse_old)) {
         $page->assign('same',true);
     } else { // le nom de mariage est distinct du nom à l'X
         // on calcule l'alias pour l'afficher
-        $myepouse = new EpouseReq($_SESSION['uid'], $_SESSION['username'], $epouse);
-        list($prenom_username,) = explode('.',$_SESSION['username']);
+        $myepouse = new EpouseReq($_SESSION['uid'], $_SESSION['forlife'], $epouse);
+        list($prenom_username,) = explode('.',$_SESSION['forlife']);
         $alias_old=make_username($prenom_username,$epouse_old);
         $myepouse->submit();
 
index 0dae491..1e70909 100644 (file)
@@ -18,7 +18,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: login.php,v 1.13 2004-09-02 18:30:34 x2000habouzit Exp $
+        $Id: login.php,v 1.14 2004-09-02 23:06:10 x2000habouzit Exp $
  ***************************************************************************/
 
 require("auto.prepend.inc.php");
@@ -75,13 +75,14 @@ $page->assign_by_ref('publicite', $publicite);
 // affichage des evenements
 // annonces promos triées par présence d'une limite sur les promos
 // puis par dates croissantes d'expiration
-$sql = "SELECT e.id,e.titre,e.texte,a.user_id,a.nom,a.prenom,a.promo
-        FROM evenements AS e INNER JOIN auth_user_md5 AS a
-        ON e.user_id=a.user_id
-        WHERE FIND_IN_SET(flags, 'valide') AND peremption >= NOW()
-        AND (e.promo_min = 0 || e.promo_min <= {$_SESSION['promo']})
-        AND (e.promo_max = 0 || e.promo_max >= {$_SESSION['promo']})
-        ORDER BY (e.promo_min != 0 AND  e.promo_max != 0) DESC,  e.peremption";
+$sql = "SELECT  e.id,e.titre,e.texte,a.user_id,a.nom,a.prenom,a.promo,l.alias AS forlife
+          FROM  evenements    AS e
+    INNER JOIN  auth_user_md5 AS a ON e.user_id=a.user_id
+    INNER JOIN  aliases       AS l ON ( a.user_id=l.id AND l.type='a_vie' )
+         WHERE  FIND_IN_SET(flags, 'valide') AND peremption >= NOW()
+               AND (e.promo_min = 0 || e.promo_min <= {$_SESSION['promo']})
+               AND (e.promo_max = 0 || e.promo_max >= {$_SESSION['promo']})
+      ORDER BY  (e.promo_min != 0 AND  e.promo_max != 0) DESC,  e.peremption";
 $page->mysql_assign($sql, 'evenement');
 
 $page->assign('toto',"");
index adf86b1..1fba971 100644 (file)
@@ -18,7 +18,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: mescontacts.php,v 1.7 2004-09-02 19:51:22 x2000habouzit Exp $
+        $Id: mescontacts.php,v 1.8 2004-09-02 23:06:10 x2000habouzit Exp $
  ***************************************************************************/
 
 require("auto.prepend.inc.php");
@@ -49,7 +49,7 @@ if (isset($_REQUEST['action'])) {
 }
 
 $sql = "SELECT contact AS id,
-               a.*,
+               a.*, l.alias AS forlife
                i.deces != 0 AS dcd, i.matricule_ax,
                e.entreprise, es.label AS secteur, ef.label AS fonction,
                n.text AS nat,
@@ -59,6 +59,7 @@ $sql = "SELECT contact AS id,
         FROM       contacts       AS c
         INNER JOIN auth_user_md5  AS a   ON (a.user_id = c.contact)
         INNER JOIN identification AS i   ON (a.matricule = i.matricule)
+       INNER JOIN aliases        AS l   ON (a.user_id = l.id AND l.type='a_vie')
         LEFT  JOIN entreprises    AS e   ON (e.entrid = 1 AND e.uid = a.user_id)
         LEFT  JOIN emploi_secteur AS es  ON (e.secteur = es.id)
         LEFT  JOIN emploi_naf     AS ef  ON (e.fonction = ef.id)
index 9733e03..2fb93ca 100644 (file)
@@ -17,7 +17,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: utilisateurs.tpl,v 1.12 2004-09-02 17:43:14 x2000habouzit Exp $
+        $Id: utilisateurs.tpl,v 1.13 2004-09-02 23:06:11 x2000habouzit Exp $
  ***************************************************************************}
 
 
@@ -165,7 +165,7 @@ function del_fwd(fwd) {
     </tr>
     <tr class="center">
       <td>
-        <a href="javascript:x()" onclick="popWin('{"fiche.php?id=`$mr.user_id`"|url}')">[Voir fiche]</a>
+        <a href="javascript:x()" onclick="popWin('{"fiche.php?user=`$mr.forlife`"|url}')">[Voir fiche]</a>
       </td>
       <td>
         <input onclick="doEditUser(); return true;" type="submit" name="u_edit" value="UPDATE" />
index f64e970..efcef0d 100644 (file)
@@ -17,7 +17,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: x_inscrit.tpl,v 1.7 2004-09-02 19:51:23 x2000habouzit Exp $
+        $Id: x_inscrit.tpl,v 1.8 2004-09-02 23:06:11 x2000habouzit Exp $
  ***************************************************************************}
 
 
@@ -39,7 +39,7 @@
     {/strip}
   </div>
   <div class="bits">
-    <a href="javascript:x()" onclick="popWin('fiche.php?user={$c.user_id}')">
+    <a href="javascript:x()" onclick="popWin('fiche.php?user={$c.forlife}')">
       <img src="images/loupe.gif" alt="Afficher les détails" />
     </a>
     <a href="vcard.php/{$c.prenom}{$c.nom}..{$c.promo}.vcf?x={$c.user_id}">
index 9b3c6d6..6719bcd 100644 (file)
@@ -17,7 +17,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: login.tpl,v 1.10 2004-09-02 18:30:34 x2000habouzit Exp $
+        $Id: login.tpl,v 1.11 2004-09-02 23:06:11 x2000habouzit Exp $
  ***************************************************************************}
 
 
@@ -49,7 +49,7 @@
   
 {dynamic on="0$fiche_incitation"}
   <p>La dernière mise à jour de ta
-  <a href="javascript:x()" onclick="popWin('fiche.php?uid={$smarty.session.user_id}">fiche</a>
+  <a href="javascript:x()" onclick="popWin('fiche.php?user={$smarty.session.forlife}">fiche</a>
   date du {$fiche_incitation|date_format:"%x"}.
   Il est possible qu'elle ne soit pas à jour.
   Si tu souhaites la modifier, <a href=\"profil.php\">clique ici !</a>
@@ -91,7 +91,7 @@
         {$ev.texte|smarty:nodefaults|nl2br}
         <br />
         <p class="smaller">Annonce proposée par
-        <a href="javascript:x()" onclick="popWin('fiche.php?uid={$ev.user_id}')">
+        <a href="javascript:x()" onclick="popWin('fiche.php?user={$ev.forlife}')">
           {$ev.prenom} {$ev.nom} X{$ev.promo}
         </a>
         </p>