From f7509fc5366b72aa8a760a237979b756bae6cbf3 Mon Sep 17 00:00:00 2001 From: x2000bedo Date: Thu, 2 Sep 2004 23:57:43 +0000 Subject: [PATCH] get rid of username in marketing --- htdocs/admin/utilisateurs.php | 4 ++-- htdocs/marketing/ins_confirmees.php | 7 ++++--- htdocs/marketing/utilisateurs_identification.php | 9 ++++++--- htdocs/marketing/utilisateurs_marketing.php | 4 ++-- htdocs/marketing/volontaire.php | 7 ++++--- templates/marketing/ins_confirmees.tpl | 4 ++-- templates/marketing/volontaire.tpl | 5 +++-- 7 files changed, 23 insertions(+), 17 deletions(-) diff --git a/htdocs/admin/utilisateurs.php b/htdocs/admin/utilisateurs.php index b8a98e7..3c4dc4a 100644 --- a/htdocs/admin/utilisateurs.php +++ b/htdocs/admin/utilisateurs.php @@ -18,7 +18,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: utilisateurs.php,v 1.18 2004-09-02 23:33:56 x2000bedo Exp $ + $Id: utilisateurs.php,v 1.19 2004-09-02 23:57:43 x2000bedo Exp $ ***************************************************************************/ require("auto.prepend.inc.php"); @@ -163,7 +163,7 @@ 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' )"); + $r=$globals->db->query("SELECT alias FROM aliases WHERE ( id = {$mr['user_id']} AND type='a_vie' )"); list($forlife) = mysql_fetch_row($r); mysql_free_result($r); $mr['forlife'] = $forlife; diff --git a/htdocs/marketing/ins_confirmees.php b/htdocs/marketing/ins_confirmees.php index d9fd830..c1a09a5 100644 --- a/htdocs/marketing/ins_confirmees.php +++ b/htdocs/marketing/ins_confirmees.php @@ -18,7 +18,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: ins_confirmees.php,v 1.2 2004-08-31 10:03:30 x2000habouzit Exp $ + $Id: ins_confirmees.php,v 1.3 2004-09-02 23:57:48 x2000bedo Exp $ ***************************************************************************/ require("auto.prepend.inc.php"); @@ -26,9 +26,10 @@ new_admin_page('marketing/ins_confirmees.tpl',true); if (!isset($_GET["sort"]) || $_GET["sort"] != "promo") $_GET["sort"] = "date_ins"; -$sql = "SELECT a.username,a.date_ins,a.promo,a.nom,a.prenom +$sql = "SELECT a.alias AS forlife,u.date_ins,u.promo,u.nom,u.prenom FROM ins_confirmees AS i - INNER JOIN auth_user_md5 AS a ON i.id=a.user_id + INNER JOIN auth_user_md5 AS u ON i.id=u.user_id + INNER JOIN aliases AS a ON (u.user_id = a.id AND a.type='a_vie') ORDER BY a.{$_GET['sort']} DESC"; $page->mysql_assign($sql, 'ins', 'nb_ins'); diff --git a/htdocs/marketing/utilisateurs_identification.php b/htdocs/marketing/utilisateurs_identification.php index 4d87545..9a1d78b 100644 --- a/htdocs/marketing/utilisateurs_identification.php +++ b/htdocs/marketing/utilisateurs_identification.php @@ -18,7 +18,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: utilisateurs_identification.php,v 1.3 2004-08-31 13:59:42 x2000habouzit Exp $ + $Id: utilisateurs_identification.php,v 1.4 2004-09-02 23:57:48 x2000bedo Exp $ ***************************************************************************/ require("auto.prepend.inc.php"); @@ -74,7 +74,8 @@ case "Creer le login": if ($myrow = mysql_fetch_array($result)) exit_error("Le matricule existe déjà dans la table auth_user_md5."); - $result=$globals->db->query("SELECT user_id FROM auth_user_md5 where username='".$_REQUEST["mailorg"]."'"); + $result=$globals->db->query("SELECT user_id FROM aliases AS a + WHERE a.type='a_vie' AND a.alias='".$_REQUEST["mailorg"]."'"); if ($myrow = mysql_fetch_array($result)) exit_error("Le login existe déjà dans la table auth_user_md5."); @@ -85,11 +86,13 @@ case "Creer le login": $password=md5($pass_clair); $date=date("Y-m-j"); - $sql = "INSERT INTO auth_user_md5 SET username='".$_REQUEST['mailorg']."',matricule='".$_REQUEST['xmat']."',promo='".$_REQUEST['promoN']."',password='$password',nom='".$_REQUEST['nomN']."',prenom='".$_REQUEST['prenomN']."',date='$date',naissance='$naissance', date_ins = NULL"; + $sql = "INSERT INTO auth_user_md5 SET matricule='".$_REQUEST['xmat']."',promo='".$_REQUEST['promoN']."',password='$password',nom='".$_REQUEST['nomN']."',prenom='".$_REQUEST['prenomN']."',date='$date',naissance='$naissance', date_ins = NULL"; $result=$globals->db->query($sql); if (!$globals->db->err()) { $newuid = mysql_insert_id(); + $sql = "INSERT INTO aliases SET alias='".$_REQUEST['mailorg']."',type='a_vie',id='$newuid'"; + $result=$globals->db->query($sql); /** inscription à la liste promo ****************/ $inspromo = inscription_liste_promo($newuid,$_REQUEST['promoN']); /** inscription à la newsletter ***************/ diff --git a/htdocs/marketing/utilisateurs_marketing.php b/htdocs/marketing/utilisateurs_marketing.php index 91544f6..00745f4 100644 --- a/htdocs/marketing/utilisateurs_marketing.php +++ b/htdocs/marketing/utilisateurs_marketing.php @@ -18,7 +18,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: utilisateurs_marketing.php,v 1.4 2004-08-31 13:59:42 x2000habouzit Exp $ + $Id: utilisateurs_marketing.php,v 1.5 2004-09-02 23:57:48 x2000bedo Exp $ ***************************************************************************/ require("auto.prepend.inc.php"); @@ -42,7 +42,7 @@ switch ($_REQUEST["submit"]) { $prenom=$myrow["prenom"]; $nom=$myrow["nom"]; $promo=$myrow["promo"]; - $from=$_SESSION['username']."@polytechnique.org"; + $from=$_SESSION['forlife']."@polytechnique.org"; $page->run(); break; diff --git a/htdocs/marketing/volontaire.php b/htdocs/marketing/volontaire.php index 0e764b6..433dda7 100644 --- a/htdocs/marketing/volontaire.php +++ b/htdocs/marketing/volontaire.php @@ -18,7 +18,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: volontaire.php,v 1.3 2004-08-31 13:59:42 x2000habouzit Exp $ + $Id: volontaire.php,v 1.4 2004-09-02 23:57:48 x2000bedo Exp $ ***************************************************************************/ require("auto.prepend.inc.php"); @@ -40,11 +40,12 @@ $page->assign_by_ref('errors', $errors); $sql = "SELECT m.id, m.expe, m.dest, m.email, i.promo, i.nom, i.prenom, i.last_known_email, - sa.promo AS spromo, sa.nom AS snom, sa.prenom AS sprenom, sa.username AS susername, + u.promo AS spromo, u.nom AS snom, u.prenom AS sprenom, a.alias AS forlife, FIND_IN_SET('mail_perso', m.flags) AS mailperso FROM marketing AS m INNER JOIN identification AS i ON i.matricule = m.dest - INNER JOIN auth_user_md5 AS sa ON sa.user_id = m.expe + INNER JOIN auth_user_md5 AS u ON u.user_id = m.expe + INNER JOIN aliases AS a ON (u.user_id = a.id AND a.type='a_vie') WHERE NOT FIND_IN_SET('envoye', m.flags)"; $page->mysql_assign($sql, 'neuves'); diff --git a/templates/marketing/ins_confirmees.tpl b/templates/marketing/ins_confirmees.tpl index b7f0f09..a2a5607 100644 --- a/templates/marketing/ins_confirmees.tpl +++ b/templates/marketing/ins_confirmees.tpl @@ -17,7 +17,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: ins_confirmees.tpl,v 1.5 2004-08-31 11:25:41 x2000habouzit Exp $ + $Id: ins_confirmees.tpl,v 1.6 2004-09-02 23:57:53 x2000bedo Exp $ ***************************************************************************} @@ -36,7 +36,7 @@ {$in.promo} - + {$in.nom} {$in.prenom} diff --git a/templates/marketing/volontaire.tpl b/templates/marketing/volontaire.tpl index 3728569..63a6937 100644 --- a/templates/marketing/volontaire.tpl +++ b/templates/marketing/volontaire.tpl @@ -17,7 +17,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: volontaire.tpl,v 1.2 2004-08-31 11:25:41 x2000habouzit Exp $ + $Id: volontaire.tpl,v 1.3 2004-09-02 23:57:53 x2000bedo Exp $ ***************************************************************************} @@ -51,7 +51,8 @@ {$it.last_known_email} {if $it.mailperso} - Perso + Perso {else} Equipe {/if} -- 2.1.4