wibble
authorx2000habouzit <x2000habouzit>
Thu, 2 Sep 2004 23:55:56 +0000 (23:55 +0000)
committerx2000habouzit <x2000habouzit>
Thu, 2 Sep 2004 23:55:56 +0000 (23:55 +0000)
12 files changed:
htdocs/mescontacts_ldif.php
htdocs/recovery.php
htdocs/redirect/redirect.php
include/texify.inc.php
templates/acces_wap.tpl
templates/admin/newsletter_prep.tpl
templates/carva_redirect.tpl
templates/docs/doc_carva.tpl
templates/docs/doc_emails.tpl
templates/include/form.valid.ml.tpl
templates/mescontacts_ldif.tpl
templates/preferences.tpl

index dbb1ae6..8cde017 100644 (file)
@@ -18,7 +18,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: mescontacts_ldif.php,v 1.8 2004-08-31 19:48:46 x2000habouzit Exp $
+        $Id: mescontacts_ldif.php,v 1.9 2004-09-02 23:55:56 x2000habouzit Exp $
  ***************************************************************************/
 
 require("auto.prepend.inc.php");
@@ -47,11 +47,12 @@ $page->register_modifier('utf8', 'utf8_encode');
  * On construit la liste des contacts, et de l'entreprise à laquelle ils appartiennent
  */
 $contacts = Array();
-$req = $globals->db->query("SELECT contact AS id, date, prenom, nom, epouse, username, mobile, web, libre, promo, alias,
+$req = $globals->db->query("SELECT contact AS id, date, prenom, nom, epouse, l.alias AS forlife, mobile, web, libre, promo,
                            entreprise, adr1, adr2, adr3, cp, ville, gp.pays, gr.name, tel, fax,
                            poste, f.label AS fonction
                     FROM      contacts      AS c 
                     LEFT JOIN auth_user_md5 AS a  ON(a.user_id = c.contact)
+                   INNER JOIN aliases       AS l  ON(a.user_id = l.id AND type='a_vie')
                     LEFT JOIN entreprises   AS e  ON(a.user_id = e.uid)
                     LEFT JOIN emploi_naf    AS f  ON(e.fonction = f.id)
                     LEFT JOIN geoloc_pays   AS gp ON(e.pays = gp.a2)
@@ -60,9 +61,18 @@ $req = $globals->db->query("SELECT contact AS id, date, prenom, nom, epouse, use
                     ORDER BY contact");
 while($line = mysql_fetch_assoc($req)) {
     $contacts[$line['id']] = ensure_adr($line);
+    $contacts[$line['id']]['aliases'] = Array();
 }
 mysql_free_result($req);
 
+$req = $globals->db->query("SELECT  a.id,a.alias
+                              FROM  aliases  AS a
+                       INNER JOIN  contacts AS c ON a.id=c.contact
+                            WHERE  c.uid='{$_SESSION['uid']}' AND a.type!='a_vie'");
+while(list($id,$alias) = mysql_fetch_row($req)) {
+    $contacts[$id]['aliases'][] = $alias;
+}
+mysql_free_result($req);
 /*
  * On y ajoute les infos d'adresses
  */
index 0334ab3..ba21bf3 100644 (file)
@@ -18,7 +18,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: recovery.php,v 1.2 2004-08-31 10:03:28 x2000habouzit Exp $
+        $Id: recovery.php,v 1.3 2004-09-02 23:55:56 x2000habouzit Exp $
  ***************************************************************************/
 
 require("auto.prepend.inc.php");
@@ -37,7 +37,10 @@ if (isset($_REQUEST['login']) and isset($_REQUEST['birth']))  {
     // paragraphe rajouté : si la date de naissance dans la base n'existe pas, on l'update
     // avec celle fournie ici en espérant que c'est la bonne
 
-    $sql="SELECT user_id, naissance FROM auth_user_md5 WHERE username='$mailorg'";
+    $sql="SELECT  user_id, naissance
+           FROM  auth_user_md5 AS u
+      INNER JOIN  aliases       AS a ON u.user_id=a.id
+           WHERE a.alias='$mailorg'";
     $result=$globals->db->query($sql);
     if (list($uid,$naissance)=mysql_fetch_array($result)) {
         if((strlen($naissance))<5) {
index a665a47..ca2a0c6 100644 (file)
@@ -18,7 +18,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: redirect.php,v 1.3 2004-08-31 10:03:31 x2000habouzit Exp $
+        $Id: redirect.php,v 1.4 2004-09-02 23:55:57 x2000habouzit Exp $
  ***************************************************************************/
 
 
@@ -32,9 +32,13 @@ echo "</pre>";*/
 // le premier non vide et éventuellement le second
 // la config d'apache impose la forme suivante pour REQUEST_URI :
 // REQUEST_URI = /prenom.nom(/path/fichier.hmtl)?
-list($username, $path) = preg_split('/\//', $_SERVER["REQUEST_URI"], 2, PREG_SPLIT_NO_EMPTY);
+list($user, $path) = preg_split('/\//', $_SERVER["REQUEST_URI"], 2, PREG_SPLIT_NO_EMPTY);
 
-$result = $globals->db->query("select redirecturl from auth_user_md5 where username= '$username' or alias = '$username'");
+$result = $globals->db->query("
+    SELECT  redirecturl
+      FROM  auth_user_md5 AS u
+INNER JOIN  aliases       AS a ON u.user_id=a.id
+     WHERE  a.alias='$user'");
 if ($result and list($url) = mysql_fetch_row($result) and $url != '') {
        // on envoie un redirect (PHP met automatiquement le code de retour 302
        if (!empty($path)) {
index 3aab0ef..5d2fe1a 100644 (file)
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: texify.inc.php,v 1.2 2004-08-31 11:16:48 x2000habouzit Exp $
+        $Id: texify.inc.php,v 1.3 2004-09-02 23:55:57 x2000habouzit Exp $
  ***************************************************************************/
 
 /*
  * Fonctions de générations de tex pour les pages de .org
  * Auteur original : Pierre HABOUZIT
  *
- * $Id: texify.inc.php,v 1.2 2004-08-31 11:16:48 x2000habouzit Exp $
+ * $Id: texify.inc.php,v 1.3 2004-09-02 23:55:57 x2000habouzit Exp $
  */
 
 /** Fonction qui gère les pdflatexisations :)
@@ -36,7 +36,7 @@ function tex_to_pdf($texte) {
     global $pdf_tmp_dir;
     set_time_limit(300); // timeout de 5 minutes au cas où le texte serait gros
                          // et pdflatex lent
-    $pdf_tmp_dir=('/tmp/mescontacts_'.$_SESSION['username']);
+    $pdf_tmp_dir=('/tmp/mescontacts_'.$_SESSION['forlife']);
     // fonction pour effacer le rep temporaire
     function clean_tmp_dir() {
         global $pdf_tmp_dir;
index 00e6b2a..115dc88 100644 (file)
@@ -17,7 +17,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: acces_wap.tpl,v 1.5 2004-08-31 11:25:38 x2000habouzit Exp $
+        $Id: acces_wap.tpl,v 1.6 2004-09-02 23:55:57 x2000habouzit Exp $
  ***************************************************************************}
 
 
       <td>
        <select name="fromaddr">
           <option value="m4x" {if $wap.fromaddr eq "m4x"}selected="selected"{/if}>
-          {$smarty.session.username}@m4x.org
+          {$smarty.session.forlife}@m4x.org
           </option>
           <option value="polytechnique" {if $wap.fromaddr eq "polytechnique"}selected="selected"{/if}>
-          {$smarty.session.username}@polytechnique.org
+          {$smarty.session.forlife}@polytechnique.org
           </option>
           <option value="autre" {if $wap.fromaddr eq "autre"}selected="selected"{/if}>
           Autre...
index 8c702b6..c13efc5 100644 (file)
@@ -17,7 +17,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: newsletter_prep.tpl,v 1.7 2004-08-31 11:25:39 x2000habouzit Exp $
+        $Id: newsletter_prep.tpl,v 1.8 2004-09-02 23:59:26 x2000habouzit Exp $
  ***************************************************************************}
 
 
@@ -82,7 +82,7 @@
     envoyer la newsletter tel qu'elle.
   </div>
   <div class="center">
-    <input type="text" name="test_to" size="40" value="{$smarty.session.username}@m4x.org" />
+    <input type="text" name="test_to" size="40" value="{$smarty.session.forlife}@m4x.org" />
     <input type="submit" name="submit" value="Envoi Test" />
     <br />
     <input type="submit" name="submit" value="Envoi Definitif" style="color:red;" />
index 1af32f6..defe5a4 100644 (file)
@@ -17,7 +17,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: carva_redirect.tpl,v 1.6 2004-08-31 11:25:38 x2000habouzit Exp $
+        $Id: carva_redirect.tpl,v 1.7 2004-09-02 23:56:54 x2000habouzit Exp $
  ***************************************************************************}
 
 
   il est possible de faire pointer
 {dynamic}
 {if $alias}
-  les adresses <strong>http://www.carva.org/{$smarty.session.username}</strong>
+  les adresses <strong>http://www.carva.org/{$smarty.session.forlife}</strong>
   et <strong>http://www.carva.org/{$alias}</strong>
 {else}
-  l'adresse <strong>http://www.carva.org/{$smarty.session.username}</strong>
+  l'adresse <strong>http://www.carva.org/{$smarty.session.forlife}</strong>
 {/if}
 {/dynamic}
   vers la page WEB de ton choix. Pour de plus amples détails, consulte
@@ -66,7 +66,7 @@
 <p>
 {dynamic}
 {if $carva}
-  Actuellement, l'adresse <a href="http://www.carva.org/{$smarty.session.username}">http://www.carva.org/{$smarty.session.username}</a>
+  Actuellement, l'adresse <a href="http://www.carva.org/{$smarty.session.forlife}">http://www.carva.org/{$smarty.session.forlife}</a>
   {if $alias}
   ainsi que l'adresse <a href="http://www.carva.org/{$alias}">http://www.carva.org/{$alias}</a>
   sont redirigées
index f49b1b6..cb839b2 100644 (file)
@@ -17,7 +17,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: doc_carva.tpl,v 1.6 2004-09-02 22:33:58 x2000bedo Exp $
+        $Id: doc_carva.tpl,v 1.7 2004-09-02 23:55:58 x2000habouzit Exp $
  ***************************************************************************}
 
 
@@ -33,9 +33,9 @@
   Dans la lignée du service de redirection d'emails de <strong>Polytechnique.org</strong>, 
   il est possible de faire pointer 
 {if $smarty.session.alias}
-  l'adresse <strong>http://www.carva.org/{dyn s=$smarty.session.username}</strong>
+  l'adresse <strong>http://www.carva.org/{dyn s=$smarty.session.forlife}</strong>
 {else}
-  les adresses <strong>http://www.carva.org/{dyn s=$smarty.session.username}</strong>
+  les adresses <strong>http://www.carva.org/{dyn s=$smarty.session.forlife}</strong>
   et <strong>http://www.carva.org/{$smarty.session.alias}</strong> ";
 {/if}
   vers la page WEB de ton choix.
index d2b2d5f..4d7f443 100644 (file)
@@ -17,7 +17,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: doc_emails.tpl,v 1.4 2004-08-31 11:25:39 x2000habouzit Exp $
+        $Id: doc_emails.tpl,v 1.5 2004-09-02 23:55:58 x2000habouzit Exp $
  ***************************************************************************}
 
 
@@ -29,7 +29,7 @@
 </div>
 <p>
     Polytechnique.org te fournit un service de redirection de tes mails à vie. Toute ta vie, tu auras
-    l'adresse <strong>{dyn s=$smarty.session.username}@polytechnique.org</strong>
+    l'adresse <strong>{dyn s=$smarty.session.forlife}@polytechnique.org</strong>
     à ta disposition. Cependant, il s'agit d'une redirection, il faut donc que tu aies une boite au
     lettres fonctionnelles pour recevoir ton courrier (il en existe des
     <a href="{"docs/doc_gratuits.php"|url}">gratuites</a>).
@@ -37,8 +37,8 @@
 <p>
     Ainsi, durant toute ta vie, et malgré d'eventuels nombreux changements d'adresses réelles, tous
     tes correspondants pourront toujours te contacter sur
-    <strong>{dyn s=$smarty.session.username}@polytechnique.org</strong> et 
-    <strong>{dyn s=$smarty.session.username}@m4x.org</strong>.
+    <strong>{dyn s=$smarty.session.forlife}@polytechnique.org</strong> et 
+    <strong>{dyn s=$smarty.session.forlife}@m4x.org</strong>.
 </p>
 <p>
     L'utilisation de ce service est très simple. Sur <a href="{"emails.php"|url}">cette
index 2658b33..aad24db 100644 (file)
@@ -17,7 +17,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: form.valid.ml.tpl,v 1.7 2004-08-31 11:25:40 x2000habouzit Exp $
+        $Id: form.valid.ml.tpl,v 1.8 2004-09-03 00:00:22 x2000habouzit Exp $
  ***************************************************************************}
 
 
@@ -26,7 +26,7 @@
     <tr>
       <td>Demandeur&nbsp;:</td>
       <td>
-        <a href="javascript:x()" onclick="popWin('/fiche.php?user={$valid->username}')">
+        <a href="javascript:x()" onclick="popWin('/fiche.php?user={$valid->forlife}')">
           {$valid->prenom} {$valid->nom}
         </a>
       </td>
index 1041e5a..b78e51d 100644 (file)
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: mescontacts_ldif.tpl,v 1.3 2004-08-31 11:25:39 x2000habouzit Exp $
+        $Id: mescontacts_ldif.tpl,v 1.4 2004-09-02 23:55:57 x2000habouzit Exp $
  ***************************************************************************}
 
 {foreach item=c from=$contacts}
 {******************************************************************************}
 {******************************************************************************}
 {if $c.epouse}
-dn: cn={"`$c.prenom` `c.epouse` (`$c.nom`)"|utf8},mail={$c.username}@polytechnique.org
+dn: cn={"`$c.prenom` `c.epouse` (`$c.nom`)"|utf8},mail={$c.forlife}@polytechnique.org
 cn: {"`$c.prenom` `c.epouse`"|utf8}
 {else}
-dn: cn={"`$c.prenom` `$c.nom`"|utf8},mail={$c.username}@polytechnique.org
+dn: cn={"`$c.prenom` `$c.nom`"|utf8},mail={$c.forlife}@polytechnique.org
 cn: {"`$c.prenom` `$c.nom`"|utf8}
 {/if}
 sn: {$c.nom}
 givenname: {$c.prenom|utf8}
-uid: {$c.username}
-mail: {$c.username}@polytechnique.org
-{if $c.alias}
-mailalternateaddress: {$c.alias}@polytechnique.org
-mozillasecondemail: {$c.alias}@polytechnique.org
-{/if}
+uid: {$c.forlife}
+mail: {$c.forlife}@polytechnique.org
+{foreach from=$c.aliases item=alias}
+mailalternateaddress: {$alias}@polytechnique.org
+mozillasecondemail: {$alias}@polytechnique.org
+{/foreach}
 {if $c.mobile}
 mobile: {$c.mobile|utf8}
 cellphone: {$c.mobile|utf8}
index c9ccc6e..0504911 100644 (file)
@@ -17,7 +17,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: preferences.tpl,v 1.6 2004-08-31 11:25:39 x2000habouzit Exp $
+        $Id: preferences.tpl,v 1.7 2004-09-02 23:56:17 x2000habouzit Exp $
  ***************************************************************************}
 
 <div class="rubrique">
@@ -50,7 +50,7 @@
         <a href="{"carva_redirect.php"|url}">Ma redirection de page WEB</a>
       </div>
       <div class="explication">
-        Tu peux configurer ta redirection WEB http://www.carva.org/{dyn s=$smarty.session.username}
+        Tu peux configurer ta redirection WEB http://www.carva.org/{dyn s=$smarty.session.forlife}
       </div>
     </td>
     <td><div class="question">