From: x2000habouzit Date: Wed, 17 Nov 2004 12:21:47 +0000 (+0000) Subject: melix bug backport + use bestaliases X-Git-Tag: xorg/old~916 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=4f7d3e818a81a6dc602e4098d11c8fc3126d0f6a;p=platal.git melix bug backport + use bestaliases --- diff --git a/htdocs/newsletter/show.php b/htdocs/newsletter/show.php index 01268de..3d0f7c6 100644 --- a/htdocs/newsletter/show.php +++ b/htdocs/newsletter/show.php @@ -18,7 +18,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: show.php,v 1.3 2004-11-13 14:16:24 x2000habouzit Exp $ + $Id: show.php,v 1.4 2004-11-17 12:21:47 x2000habouzit Exp $ ***************************************************************************/ require("auto.prepend.inc.php"); @@ -32,7 +32,7 @@ $page->assign_by_ref('nl',$nl); if(isset($_POST['send'])) { $res = $globals->db->query("SELECT pref FROM newsletter_ins WHERE user_id='{$_SESSION['uid']}'"); if(!(list($format) = mysql_fetch_row($res))) $format = 'html'; - $nl->sendTo($_SESSION['prenom'], $_SESSION['nom'], $_SESSION['forlife'], $_SESSION['femme'], $format=='html'); + $nl->sendTo($_SESSION['prenom'], $_SESSION['nom'], $_SESSION['bestalias'], $_SESSION['femme'], $format=='html'); } $page->run(); diff --git a/include/newsletter.inc.php b/include/newsletter.inc.php index c1741a3..2be3a58 100644 --- a/include/newsletter.inc.php +++ b/include/newsletter.inc.php @@ -18,7 +18,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: newsletter.inc.php,v 1.33 2004-11-16 21:02:46 x2000habouzit Exp $ + $Id: newsletter.inc.php,v 1.34 2004-11-17 12:21:48 x2000habouzit Exp $ ***************************************************************************/ define('FEMME', 1); @@ -254,12 +254,12 @@ EOF; return $res; } - function sendTo($prenom,$nom,$forlife,$sex,$html) { + function sendTo($prenom,$nom,$login,$sex,$html) { require_once('diogenes.hermes.inc.php'); $mailer = new HermesMailer(); $mailer->setFrom("\"Lettre Mensuelle Polytechnique.org\" "); $mailer->setSubject($this->title()); - $mailer->addTo("\"$prenom $nom\" <$forlife@polytechnique.org>"); + $mailer->addTo("\"$prenom $nom\" <$login@polytechnique.org>"); $mailer->addHeader('Reply-To','info+nlp@polytechnique.org'); $mailer->setTxtBody($this->toText($prenom,$nom,$sex)); if($html) { diff --git a/include/valid_aliases.inc.php b/include/valid_aliases.inc.php index db59d17..c1b5db4 100644 --- a/include/valid_aliases.inc.php +++ b/include/valid_aliases.inc.php @@ -18,7 +18,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: valid_aliases.inc.php,v 1.19 2004-11-15 08:30:15 x2000habouzit Exp $ + $Id: valid_aliases.inc.php,v 1.20 2004-11-17 12:21:48 x2000habouzit Exp $ ***************************************************************************/ class AliasReq extends Validate { @@ -26,9 +26,10 @@ class AliasReq extends Validate { var $raison; var $forlife; + var $bestalias; var $prenom; var $nom; - var $old; + var $old=''; function AliasReq ($_uid, $_alias, $_raison, $_stamp=0) { global $globals; @@ -37,13 +38,20 @@ class AliasReq extends Validate { $this->raison = $_raison; $sql = $globals->db->query(" - SELECT l.alias,prenom,nom,v.alias + SELECT l.alias,m.alias,prenom,nom FROM auth_user_md5 AS u INNER JOIN aliases AS l ON (u.user_id=l.id AND l.type='a_vie') - LEFT JOIN virtual_redirect AS vr ON (CONCAT(l.alias,'@m4x.org') = vr.redirect) - LEFT JOIN virtual AS v ON(v.vid=vr.vid AND v.alias LIKE '%@melix.net') + INNER JOIN aliases AS m ON (u.user_id=m.id AND FIND_IN_SET('bestalias',m.flags)) WHERE user_id='".$this->uid."'"); - list($this->forlife,$this->prenom,$this->nom,$this->old) = mysql_fetch_row($sql); + list($this->forlife,$this->bestalias,$this->prenom,$this->nom) = mysql_fetch_row($sql); + mysql_free_result($sql); + + $sql = $globals->db->query(" + SELECT v.alias + FROM virtual_redirect AS vr + INNER JOIN virtual AS v ON (v.vid=vr.vid AND v.alias LIKE '%@melix.net') + WHERE vr.redirect='{$this->forlife}@m4x.org'"); + if(mysql_num_rows($sql)) list($this->old) = mysql_fetch_row($sql); mysql_free_result($sql); } @@ -61,7 +69,7 @@ class AliasReq extends Validate { require_once("tpl.mailer.inc.php"); $mymail = new TplMailer('valid.alias.tpl'); $mymail->assign('alias', $this->alias); - $mymail->assign('forlife', $this->forlife); + $mymail->assign('bestalias', $this->bestalias); if($_REQUEST['submit']=="Accepter") { $mymail->assign('answer', 'yes'); diff --git a/include/valid_evts.inc.php b/include/valid_evts.inc.php index f8cad1e..dcf77d3 100644 --- a/include/valid_evts.inc.php +++ b/include/valid_evts.inc.php @@ -18,7 +18,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: valid_evts.inc.php,v 1.11 2004-09-02 21:09:32 x2000habouzit Exp $ + $Id: valid_evts.inc.php,v 1.12 2004-11-17 12:21:48 x2000habouzit Exp $ ***************************************************************************/ @@ -31,7 +31,7 @@ class EvtReq extends Validate { var $peremption; var $comment; - var $forlife; + var $bestalias; var $promo; var $nom; var $prenom; @@ -50,9 +50,9 @@ class EvtReq extends Validate { $req = $globals->db->query(" SELECT a.alias,promo,nom,prenom FROM auth_user_md5 AS u - INNER JOIN aliases AS a ON ( u.user_id=a.id AND type='a_vie') + INNER JOIN aliases AS a ON ( u.user_id=a.id AND FIND_IN_SET('bestalias',a.flags)) WHERE user_id='$_uid'"); - list($this->forlife,$this->promo,$this->nom,$this->prenom) + list($this->bestalias,$this->promo,$this->nom,$this->prenom) = mysql_fetch_row($req); mysql_free_result($req); } @@ -68,7 +68,7 @@ class EvtReq extends Validate { if (isset($_POST['action'])) { require("tpl.mailer.inc.php"); $mymail = new TplMailer('valid.evts.tpl'); - $mymail->assign('forlife',$this->forlife); + $mymail->assign('bestalias',$this->bestalias); $mymail->assign('titre',$this->titre); if($_REQUEST['action']=="Valider") { diff --git a/include/valid_listes.inc.php b/include/valid_listes.inc.php index bc87a81..701d2af 100644 --- a/include/valid_listes.inc.php +++ b/include/valid_listes.inc.php @@ -18,11 +18,11 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: valid_listes.inc.php,v 1.4 2004-11-10 10:59:10 x2000habouzit Exp $ + $Id: valid_listes.inc.php,v 1.5 2004-11-17 12:21:48 x2000habouzit Exp $ ***************************************************************************/ class ListeReq extends Validate { - var $forlife; + var $bestalias; var $liste; var $desc; @@ -49,9 +49,9 @@ class ListeReq extends Validate { $sql = $globals->db->query(" SELECT l.alias FROM auth_user_md5 AS u - INNER JOIN aliases AS l ON (u.user_id=l.id AND type='a_vie') + INNER JOIN aliases AS l ON (u.user_id=l.id AND FIND_IN_SET('bestalias',l.flags)) WHERE user_id='".$this->uid."'"); - list($this->forlife) = mysql_fetch_row($sql); + list($this->bestalias) = mysql_fetch_row($sql); mysql_free_result($sql); } @@ -69,7 +69,7 @@ class ListeReq extends Validate { require_once("tpl.mailer.inc.php"); $mymail = new TplMailer('valid.liste.tpl'); $mymail->assign('alias', $this->liste); - $mymail->assign('forlife', $this->forlife); + $mymail->assign('bestalias', $this->bestalias); $mymail->assign('motif', stripslashes($_REQUEST['motif'])); if($_REQUEST['submit']=="Accepter") { diff --git a/include/valid_photos.inc.php b/include/valid_photos.inc.php index 79b216f..d6a5d2f 100644 --- a/include/valid_photos.inc.php +++ b/include/valid_photos.inc.php @@ -18,7 +18,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: valid_photos.inc.php,v 1.15 2004-11-06 17:37:22 x2000habouzit Exp $ + $Id: valid_photos.inc.php,v 1.16 2004-11-17 12:21:48 x2000habouzit Exp $ ***************************************************************************/ @@ -28,7 +28,7 @@ class PhotoReq extends Validate { var $x; var $y; - var $forlife; + var $bestalias; var $prenom; var $nom; @@ -39,9 +39,9 @@ class PhotoReq extends Validate { $sql = $globals->db->query(" SELECT a.alias, prenom, nom FROM auth_user_md5 AS u - INNER JOIN aliases AS a ON ( a.id=u.user_id AND type='a_vie' ) + INNER JOIN aliases AS a ON ( a.id=u.user_id AND FIND_IN_SET('bestalias',a.flags) ) WHERE user_id=".$this->uid); - list($this->forlife,$this->prenom,$this->nom) = mysql_fetch_row($sql); + list($this->bestalias,$this->prenom,$this->nom) = mysql_fetch_row($sql); mysql_free_result($sql); if(!file_exists($_file)) { @@ -88,7 +88,7 @@ class PhotoReq extends Validate { require_once("tpl.mailer.inc.php"); $mymail = new TplMailer('valid.photos.tpl'); - $mymail->assign('forlife', $this->forlife); + $mymail->assign('bestalias', $this->bestalias); if($_REQUEST['submit']=="Accepter") { $mymail->assign('answer','yes'); diff --git a/templates/include/form.valid.aliases.tpl b/templates/include/form.valid.aliases.tpl index 9dde6c0..edf38b5 100644 --- a/templates/include/form.valid.aliases.tpl +++ b/templates/include/form.valid.aliases.tpl @@ -17,7 +17,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: form.valid.aliases.tpl,v 1.10 2004-11-13 15:56:36 x2000habouzit Exp $ + $Id: form.valid.aliases.tpl,v 1.11 2004-11-17 12:21:48 x2000habouzit Exp $ ***************************************************************************} @@ -27,7 +27,7 @@ Demandeur : - forlife}" class='popup2'> + bestalias}" class='popup2'> {$valid->prenom} {$valid->nom} {$valid->old} diff --git a/templates/include/form.valid.evts.tpl b/templates/include/form.valid.evts.tpl index bdc597e..a9baff7 100644 --- a/templates/include/form.valid.evts.tpl +++ b/templates/include/form.valid.evts.tpl @@ -17,7 +17,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: form.valid.evts.tpl,v 1.8 2004-11-13 15:56:37 x2000habouzit Exp $ + $Id: form.valid.evts.tpl,v 1.9 2004-11-17 12:21:48 x2000habouzit Exp $ ***************************************************************************} @@ -28,10 +28,10 @@ - Posté par forlife}" class="popup2"> + Posté par bestalias}" class="popup2"> {$valid->prenom} {$valid->nom} (X{$valid->promo}) - [lui écrire] + [lui écrire] diff --git a/templates/include/form.valid.listes.tpl b/templates/include/form.valid.listes.tpl index 1ade650..e12a920 100644 --- a/templates/include/form.valid.listes.tpl +++ b/templates/include/form.valid.listes.tpl @@ -17,7 +17,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: form.valid.listes.tpl,v 1.2 2004-11-13 15:56:37 x2000habouzit Exp $ + $Id: form.valid.listes.tpl,v 1.3 2004-11-17 12:21:48 x2000habouzit Exp $ ***************************************************************************} @@ -27,8 +27,8 @@ Demandeur : - forlife}" class="popup2"> - {$valid->forlife} + bestalias}" class="popup2"> + {$valid->bestalias} diff --git a/templates/include/form.valid.ml.tpl b/templates/include/form.valid.ml.tpl index 5fc6f7c..67aa95f 100644 --- a/templates/include/form.valid.ml.tpl +++ b/templates/include/form.valid.ml.tpl @@ -17,7 +17,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: form.valid.ml.tpl,v 1.9 2004-11-13 15:56:37 x2000habouzit Exp $ + $Id: form.valid.ml.tpl,v 1.10 2004-11-17 12:21:48 x2000habouzit Exp $ ***************************************************************************} @@ -26,7 +26,7 @@ Demandeur : - forlife}" class="popup2"> + bestalias}" class="popup2"> {$valid->prenom} {$valid->nom} diff --git a/templates/include/form.valid.photos.tpl b/templates/include/form.valid.photos.tpl index 75210cc..db8ac95 100644 --- a/templates/include/form.valid.photos.tpl +++ b/templates/include/form.valid.photos.tpl @@ -17,7 +17,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: form.valid.photos.tpl,v 1.9 2004-11-13 15:56:37 x2000habouzit Exp $ + $Id: form.valid.photos.tpl,v 1.10 2004-11-17 12:21:48 x2000habouzit Exp $ ***************************************************************************} @@ -25,7 +25,7 @@ - diff --git a/templates/mails/valid.alias.tpl b/templates/mails/valid.alias.tpl index b900cda..759344c 100644 --- a/templates/mails/valid.alias.tpl +++ b/templates/mails/valid.alias.tpl @@ -17,13 +17,13 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: valid.alias.tpl,v 1.3 2004-09-02 21:09:33 x2000habouzit Exp $ + $Id: valid.alias.tpl,v 1.4 2004-11-17 12:21:49 x2000habouzit Exp $ ***************************************************************************} {config_load file="mails.conf" section="valid_alias"} -{subject text="[Polytechnique.org/MELIX] Demande de l'alias $alias@melix.net par $forlife"} +{subject text="[Polytechnique.org/MELIX] Demande de l'alias $alias@melix.net par $bestalias"} {from full=#from#} -{to addr="$forlife@polytechnique.org"} +{to addr="$bestalias@polytechnique.org"} {cc full=#cc#} {if $answer eq "yes"} Cher(e) camarade, diff --git a/templates/mails/valid.evts.tpl b/templates/mails/valid.evts.tpl index 393857f..871321e 100644 --- a/templates/mails/valid.evts.tpl +++ b/templates/mails/valid.evts.tpl @@ -17,13 +17,13 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: valid.evts.tpl,v 1.3 2004-09-02 21:09:33 x2000habouzit Exp $ + $Id: valid.evts.tpl,v 1.4 2004-11-17 12:21:49 x2000habouzit Exp $ ***************************************************************************} {config_load file="mails.conf" section="valid_evts"} {subject text="[Polytechnique.org/EVENEMENTS] Proposition d'événement"} {from full=#from#} -{to addr="$forlife@polytechnique.org"} +{to addr="$bestalias@polytechnique.org"} {cc full=#cc#} {if $answer eq "yes"} Cher(e) camarade, diff --git a/templates/mails/valid.liste.tpl b/templates/mails/valid.liste.tpl index 6e73b95..c60a694 100644 --- a/templates/mails/valid.liste.tpl +++ b/templates/mails/valid.liste.tpl @@ -17,13 +17,13 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: valid.liste.tpl,v 1.1 2004-09-25 20:11:36 x2000habouzit Exp $ + $Id: valid.liste.tpl,v 1.2 2004-11-17 12:21:49 x2000habouzit Exp $ ***************************************************************************} {config_load file="mails.conf" section="valid_liste"} -{subject text="[Polytechnique.org/LISTES] Demande de la liste $alias par $forlife"} +{subject text="[Polytechnique.org/LISTES] Demande de la liste $alias par $bestalias"} {from full=#from#} -{to addr="$forlife@polytechnique.org"} +{to addr="$bestalias@polytechnique.org"} {cc full=#cc#} {if $answer eq "yes"} Cher(e) camarade, diff --git a/templates/mails/valid.photos.tpl b/templates/mails/valid.photos.tpl index 1d8e663..928d262 100644 --- a/templates/mails/valid.photos.tpl +++ b/templates/mails/valid.photos.tpl @@ -17,13 +17,13 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: valid.photos.tpl,v 1.3 2004-09-02 21:09:33 x2000habouzit Exp $ + $Id: valid.photos.tpl,v 1.4 2004-11-17 12:21:49 x2000habouzit Exp $ ***************************************************************************} {config_load file="mails.conf" section="valid_photos"} -{subject text="[Polytechnique.org/PHOTO] Changement de photo de $forlife"} +{subject text="[Polytechnique.org/PHOTO] Changement de photo de $bestalias"} {from full=#from#} -{to addr="$forlife@polytechnique.org"} +{to addr="$bestalias@polytechnique.org"} {cc full=#cc#} {if $answer eq "yes"} Cher(e) camarade,
Demandeur :forlife}" class="popup2"> + bestalias}" class="popup2"> {$valid->prenom} {$valid->nom}