From a8c8d165a2ed888def0183a5cdd474999a89fceb Mon Sep 17 00:00:00 2001 From: x2000habouzit Date: Thu, 2 Sep 2004 21:22:18 +0000 Subject: [PATCH] get rid of more usernames yahoooooo madness is near --- htdocs/paiement/cyberpaiement_retour.php | 15 ++++++++++----- htdocs/paiement/index.php | 4 ++-- htdocs/sendmail.php | 12 +++++++----- templates/sendmail.tpl | 14 +++++++------- 4 files changed, 26 insertions(+), 19 deletions(-) diff --git a/htdocs/paiement/cyberpaiement_retour.php b/htdocs/paiement/cyberpaiement_retour.php index 82dca5c..497ccc9 100644 --- a/htdocs/paiement/cyberpaiement_retour.php +++ b/htdocs/paiement/cyberpaiement_retour.php @@ -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,$conf_text); $conf_text = str_replace("",$montant,$conf_text); $conf_text = str_replace("",$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". diff --git a/htdocs/paiement/index.php b/htdocs/paiement/index.php index 4b53528..e13aa94 100644 --- a/htdocs/paiement/index.php +++ b/htdocs/paiement/index.php @@ -18,12 +18,12 @@ * 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'); diff --git a/htdocs/sendmail.php b/htdocs/sendmail.php index fe0a887..5106b28 100644 --- a/htdocs/sendmail.php +++ b/htdocs/sendmail.php @@ -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'); diff --git a/templates/sendmail.tpl b/templates/sendmail.tpl index 608bd89..34ba58e 100644 --- a/templates/sendmail.tpl +++ b/templates/sendmail.tpl @@ -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 @@ @@ -85,7 +85,7 @@ copie cachée : - + @@ -111,10 +111,10 @@ {/if} - - {$contact.prenom} {$contact.nom} (X{$contact.promo}) + + {$contact.prenom} {$contact.nom} (X{$contact.promo}) {if $key is odd} -- 2.1.4