get rid of more usernames
authorx2000habouzit <x2000habouzit>
Thu, 2 Sep 2004 21:22:18 +0000 (21:22 +0000)
committerx2000habouzit <x2000habouzit>
Thu, 2 Sep 2004 21:22:18 +0000 (21:22 +0000)
yahoooooo

madness is near

htdocs/paiement/cyberpaiement_retour.php
htdocs/paiement/index.php
htdocs/sendmail.php
templates/sendmail.tpl

index 82dca5c..497ccc9 100644 (file)
@@ -18,7 +18,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: cyberpaiement_retour.php,v 1.3 2004-08-31 13:59:43 x2000habouzit Exp $
+        $Id: cyberpaiement_retour.php,v 1.4 2004-09-02 21:22:19 x2000habouzit Exp $
  ***************************************************************************/
 
 require("auto.prepend.inc.php");
@@ -92,8 +92,13 @@ $champ202 = clean_request('CHAMP202');
 $montant = "$champ201 $champ202";
 
 /* on extrait les informations sur l'utilisateur */
-$res = $globals->db->query("select a.prenom,a.nom,a.promo,a.username,FIND_IN_SET(i.flags,'femme') from auth_user_md5 as a inner join identification as i on a.matricule=i.matricule where a.user_id='$uid'");
-if (!list($prenom,$nom,$promo,$username,$femme) = mysql_fetch_row($res))
+$res = $globals->db->query("
+    SELECT  a.prenom,a.nom,a.promo,l.alias,FIND_IN_SET(i.flags,'femme')
+      FROM  auth_user_md5  AS a
+INNER JOIN  aliases        AS l ON a.user_id=l.id
+INNER JOIN  identification AS i ON a.matricule=i.matricule
+     WHERE  a.user_id='$uid'");
+if (!list($prenom,$nom,$promo,$forlife,$femme) = mysql_fetch_row($res))
   erreur("uid invalide");
 
 /* on extrait la reference de la commande */
@@ -124,14 +129,14 @@ $conf_text = str_replace("<promo>",$promo,$conf_text);
 $conf_text = str_replace("<montant>",$montant,$conf_text);
 $conf_text = str_replace("<salutation>",$femme ? "Chère" : "Cher",$conf_text);
 
-$mymail = new DiogenesMailer($conf_mail,$username,$conf_title,false,$conf_mail);
+$mymail = new DiogenesMailer($conf_mail,$forlife,$conf_title,false,$conf_mail);
 $mymail->setBody($conf_text);
 $mymail->send();
 
 /* on envoie les details de la transaction à telepaiement@ */
 $mymail = new DiogenesMailer("webmaster","telepaiement",$conf_title,false);
 $msg = "utilisateur : $prenom $nom ($uid)\n".
-       "mail : $username@polytechnique.org\n\n".
+       "mail : $forlife@polytechnique.org\n\n".
        "paiement : $conf_title ($conf_mail)\n".
        "reference : $champ200\n".
        "montant : $montant\n\n".
index 4b53528..e13aa94 100644 (file)
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: index.php,v 1.2 2004-08-31 10:03:30 x2000habouzit Exp $
+        $Id: index.php,v 1.3 2004-09-02 21:22:19 x2000habouzit Exp $
  ***************************************************************************/
 
 require("auto.prepend.inc.php");
 new_skinned_page('paiment/index.tpl', AUTH_MDP);
-require('profil.inc.php');
+require_once('profil.func.inc.php');
 setlocale(LC_NUMERIC,'fr_FR');
 
 
index fe0a887..5106b28 100644 (file)
@@ -18,7 +18,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: sendmail.php,v 1.5 2004-08-31 10:03:28 x2000habouzit Exp $
+        $Id: sendmail.php,v 1.6 2004-09-02 21:22:18 x2000habouzit Exp $
  ***************************************************************************/
 
 require("auto.prepend.inc.php");
@@ -49,7 +49,7 @@ if (isset($_REQUEST['submit']) and $_REQUEST['submit'] == 'Envoyer'
         $FROM = "From: {$_REQUEST['from']}";
         //$_REQUEST['contenu'] = chunk_split($_REQUEST['contenu'], 76, "\n"); // pas bon, ne tient pas compte des mots
             $dest = $_REQUEST['to'].', '.$autre_to;
-        $mymail = new DiogenesMailer($_SESSION['username'], $dest, $_REQUEST['sujet'], false, $_REQUEST['cc'], $_REQUEST['bcc']);
+        $mymail = new DiogenesMailer($_SESSION['forlife'], $dest, $_REQUEST['sujet'], false, $_REQUEST['cc'], $_REQUEST['bcc']);
         $mymail->addHeader($FROM);
         $mymail->setBody(wordwrap($_REQUEST['contenu'],72,"\n"));
         if ($mymail->send()) {
@@ -61,9 +61,11 @@ if (isset($_REQUEST['submit']) and $_REQUEST['submit'] == 'Envoyer'
     } // ! if ($_REQUEST['to'] == '' and $_REQUEST['cc'] == '')
 }
 
-$sql = "SELECT u.prenom, u.nom, u.promo, u.username
-        FROM auth_user_md5 as u, contacts as c
-        WHERE u.user_id = c.contact AND c.uid = {$_SESSION['uid']}
+$sql = "SELECT  u.prenom, u.nom, u.promo, a.alias as forlife
+          FROM  auth_user_md5 AS u
+    INNER JOIN  contacts      AS c ON (u.user_id = c.contact)
+    INNER JOIN  aliases       AS a ON (u.user_id=a.id AND type='a_vie')
+         WHERE  c.uid = {$_SESSION['uid']}
         ORDER BY u.nom, u.prenom";
 $page->mysql_assign($sql, 'contacts','nb_contacts');
 
index 608bd89..34ba58e 100644 (file)
@@ -17,7 +17,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: sendmail.tpl,v 1.9 2004-08-31 11:25:39 x2000habouzit Exp $
+        $Id: sendmail.tpl,v 1.10 2004-09-02 21:22:19 x2000habouzit Exp $
  ***************************************************************************}
 
 
@@ -66,7 +66,7 @@
         <input type='text' name='from' size='45' value='{if $smarty.request.from}
 {$smarty.request.from}
 {else}
-"{$smarty.session.prenom} {$smarty.session.nom}" &lt;{$smarty.session.username}@polytechnique.org&gt;
+"{$smarty.session.prenom} {$smarty.session.nom}" &lt;{$smarty.session.forlife}@polytechnique.org&gt;
 {/if}' />
       </td>
     </tr>
@@ -85,7 +85,7 @@
     <tr> 
       <td class="titre">copie cachée&nbsp;:</td>
       <td>
-        <input type='text' name='bcc' size='45' value="{$smarty.request.bcc|default:$smarty.session.username}" />
+        <input type='text' name='bcc' size='45' value="{$smarty.request.bcc|default:$smarty.session.forlife}" />
       </td>
     </tr>
     <tr> 
   <tr class="{cycle values="impair,pair"}">
 {/if}
     <td>
-      <input type="checkbox" name="contacts[{$contact.username}]"
-        value="{$contact.prenom} {$contact.nom} &lt;{$contact.username}@polytechnique.org&gt;"
-        {if $smarty.request.contacts && $smarty.request.contacts.username}checked="checked"{/if} />
-      <a href="javascript:x()" onclick="popWin('fiche.php?user={$contact.username}')">{$contact.prenom} {$contact.nom}</a> (X{$contact.promo})
+      <input type="checkbox" name="contacts[{$contact.forlife}]"
+        value="{$contact.prenom} {$contact.nom} &lt;{$contact.forlife}@polytechnique.org&gt;"
+        {if $smarty.request.contacts && $smarty.request.contacts.forlife}checked="checked"{/if} />
+      <a href="javascript:x()" onclick="popWin('fiche.php?user={$contact.forlife}')">{$contact.prenom} {$contact.nom}</a> (X{$contact.promo})
     </td>
 {if $key is odd}
   </tr>