From: x2000habouzit Date: Thu, 2 Sep 2004 21:09:31 +0000 (+0000) Subject: I cannot believe all of this already works... X-Git-Tag: xorg/old~1604 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=73fa68d5608012b2b0e08fcdea01dd87502e1e6d;p=platal.git I cannot believe all of this already works... to easy --- diff --git a/htdocs/trombino.php b/htdocs/trombino.php index 5918af4..d1e4de0 100644 --- a/htdocs/trombino.php +++ b/htdocs/trombino.php @@ -18,7 +18,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: trombino.php,v 1.2 2004-08-31 10:03:28 x2000habouzit Exp $ + $Id: trombino.php,v 1.3 2004-09-02 21:09:31 x2000habouzit Exp $ ***************************************************************************/ require("auto.prepend.inc.php"); @@ -51,7 +51,7 @@ if (isset($_REQUEST["ordi"]) and } } elseif (isset($_REQUEST["trombi"])) { // Fichier à récupérer dans les archives trombi + commit immédiat - $file = "/home/web/trombino/photos".$_SESSION["promo"]."/".$_SESSION["username"].".jpg"; + $file = "/home/web/trombino/photos".$_SESSION["promo"]."/".$_SESSION["forlife"].".jpg"; $myphoto = new PhotoReq($_SESSION['uid'], $file); $myphoto->commit(); $myphoto->clean(); diff --git a/include/valid_epouses.inc.php b/include/valid_epouses.inc.php index 92b7d58..7fe1fc5 100644 --- a/include/valid_epouses.inc.php +++ b/include/valid_epouses.inc.php @@ -18,14 +18,14 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: valid_epouses.inc.php,v 1.15 2004-09-01 22:51:00 x2000habouzit Exp $ + $Id: valid_epouses.inc.php,v 1.16 2004-09-02 21:09:32 x2000habouzit Exp $ ***************************************************************************/ class EpouseReq extends Validate { var $epouse; var $alias; - var $username; + var $forlife; var $oldepouse; var $oldalias; @@ -34,24 +34,21 @@ class EpouseReq extends Validate { var $homonyme; - function EpouseReq ($_uid, $_username, $_epouse, $_stamp=0) { + function EpouseReq ($_uid, $_forlife, $_epouse, $_stamp=0) { global $globals; $this->Validate($_uid, true, 'epouse', $_stamp); $this->epouse = $_epouse; - $this->username = $_username; + $this->forlife = $_forlife; - list($prenom) = explode('.',$_username); - $this->alias = make_username($prenom,$this->epouse); + list($prenom) = explode('.',$_forlife); + $this->alias = make_forlife($prenom,$this->epouse); if(empty($_epouse)) $this->alias = ""; - $sql = $globals->db->query("select u1.alias, u1.epouse, u1.prenom, u1.nom" - .", IFNULL(u2.username,u3.username)" - ." FROM auth_user_md5 as u1" - ." LEFT JOIN auth_user_md5 as u2" - ." ON(u2.username = '{$this->alias}' and u2.user_id != u1.user_id)" - ." LEFT JOIN auth_user_md5 as u3" - ." ON(u3.alias = '{$this->alias}' and u3.user_id != u1.user_id)" - ." WHERE u1.user_id = ".$this->uid); + $sql = $globals->db->query(" + SELECT u.alias, u.epouse, u.prenom, u.nom, a.id + FROM auth_user_md5 as u + LEFT JOIN aliases as a ON(a.alias = '{$this->alias}' and a.id != u.user_id) + WHERE u.user_id = ".$this->uid); list($this->oldalias, $this->oldepouse, $this->prenom, $this->nom, $this->homonyme) = mysql_fetch_row($sql); mysql_free_result($sql); } @@ -69,7 +66,7 @@ class EpouseReq extends Validate { require_once("tpl.mailer.inc.php"); $mymail = new TplMailer('valid.epouses.tpl'); - $mymail->assign('username', $this->username); + $mymail->assign('forlife', $this->forlife); if($_REQUEST['submit']=="Accepter") { $mymail->assign('answer','yes'); diff --git a/include/valid_evts.inc.php b/include/valid_evts.inc.php index 88e2279..f8cad1e 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.10 2004-08-31 11:16:48 x2000habouzit Exp $ + $Id: valid_evts.inc.php,v 1.11 2004-09-02 21:09:32 x2000habouzit Exp $ ***************************************************************************/ @@ -31,7 +31,7 @@ class EvtReq extends Validate { var $peremption; var $comment; - var $username; + var $forlife; var $promo; var $nom; var $prenom; @@ -47,9 +47,12 @@ class EvtReq extends Validate { $this->pmax = $_pmax; $this->peremption = $_peremption; $this->comment = $_comment; - $req = $globals->db->query("SELECT username,promo,nom,prenom FROM " - ."auth_user_md5 WHERE user_id='$_uid'"); - list($this->username,$this->promo,$this->nom,$this->prenom) + $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') + WHERE user_id='$_uid'"); + list($this->forlife,$this->promo,$this->nom,$this->prenom) = mysql_fetch_row($req); mysql_free_result($req); } @@ -65,7 +68,7 @@ class EvtReq extends Validate { if (isset($_POST['action'])) { require("tpl.mailer.inc.php"); $mymail = new TplMailer('valid.evts.tpl'); - $mymail->assign('username',$this->username); + $mymail->assign('forlife',$this->forlife); $mymail->assign('titre',$this->titre); if($_REQUEST['action']=="Valider") { diff --git a/include/valid_photos.inc.php b/include/valid_photos.inc.php index 5dc4f24..8f291d7 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.11 2004-08-31 22:01:31 x2000habouzit Exp $ + $Id: valid_photos.inc.php,v 1.12 2004-09-02 21:09:32 x2000habouzit Exp $ ***************************************************************************/ @@ -28,7 +28,7 @@ class PhotoReq extends Validate { var $x; var $y; - var $username; + var $forlife; var $prenom; var $nom; @@ -36,8 +36,12 @@ class PhotoReq extends Validate { global $erreur, $globals; $this->Validate($_uid, true, 'photo', $_stamp); - $sql = $globals->db->query("SELECT username, prenom, nom FROM auth_user_md5 WHERE user_id=".$this->uid); - list($this->username,$this->prenom,$this->nom) = mysql_fetch_row($sql); + $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' ) + WHERE user_id=".$this->uid); + list($this->forlife,$this->prenom,$this->nom) = mysql_fetch_row($sql); mysql_free_result($sql); if(!file_exists($_file)) { @@ -84,7 +88,7 @@ class PhotoReq extends Validate { require_once("tpl.mailer.inc.php"); $mymail = new TplMailer('valid.photos.tpl'); - $mymail->assign('username', $this->username); + $mymail->assign('forlife', $this->forlife); if($_REQUEST['submit']=="Accepter") { $mymail->assign('answer','yes'); diff --git a/templates/evenements.tpl b/templates/evenements.tpl index 39ac4c0..5493969 100644 --- a/templates/evenements.tpl +++ b/templates/evenements.tpl @@ -17,7 +17,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: evenements.tpl,v 1.5 2004-08-31 11:25:38 x2000habouzit Exp $ + $Id: evenements.tpl,v 1.6 2004-09-02 21:09:32 x2000habouzit Exp $ ***************************************************************************} @@ -58,15 +58,17 @@ Tu as ajout

{/if} -
- - - - - - - - + +
+ + + + + + + + +
diff --git a/templates/include/form.valid.epouses.tpl b/templates/include/form.valid.epouses.tpl index aaecd02..bd044a8 100644 --- a/templates/include/form.valid.epouses.tpl +++ b/templates/include/form.valid.epouses.tpl @@ -17,7 +17,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: form.valid.epouses.tpl,v 1.7 2004-09-01 22:51:00 x2000habouzit Exp $ + $Id: form.valid.epouses.tpl,v 1.8 2004-09-02 21:09:32 x2000habouzit Exp $ ***************************************************************************} @@ -26,7 +26,7 @@ Demandeur : - + {$valid->prenom} {$valid->nom} {if $valid->oldepouse}({$valid->oldepouse} - {$valid->oldalias}){/if} @@ -60,7 +60,7 @@

Raison du refus:

- + diff --git a/templates/include/form.valid.evts.tpl b/templates/include/form.valid.evts.tpl index f72a952..887e916 100644 --- a/templates/include/form.valid.evts.tpl +++ b/templates/include/form.valid.evts.tpl @@ -17,21 +17,21 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: form.valid.evts.tpl,v 1.6 2004-08-31 11:25:40 x2000habouzit Exp $ + $Id: form.valid.evts.tpl,v 1.7 2004-09-02 21:09:32 x2000habouzit Exp $ ***************************************************************************} -
+ - diff --git a/templates/include/form.valid.photos.tpl b/templates/include/form.valid.photos.tpl index 2007718..702d65b 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.7 2004-08-31 11:25:40 x2000habouzit Exp $ + $Id: form.valid.photos.tpl,v 1.8 2004-09-02 21:09:32 x2000habouzit Exp $ ***************************************************************************} @@ -25,7 +25,7 @@
Événement
- Posté par username}"> + + Posté par forlife}')"> {$valid->prenom} {$valid->nom} (X{$valid->promo}) - [lui écrire] + [lui écrire]
- @@ -33,6 +33,7 @@ @@ -47,7 +48,7 @@
Demandeur :username}')"> + forlife}')"> {$valid->prenom} {$valid->nom}
uid}" style="width:110px;" alt=" [ PHOTO ] " /> +   uid}&req=true" style="width:110px;" alt=" [ PHOTO ] " />

Raison du refus:

- +
diff --git a/templates/mails/valid.alias.tpl b/templates/mails/valid.alias.tpl index 36a7a3f..b900cda 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.2 2004-08-31 11:25:41 x2000habouzit Exp $ + $Id: valid.alias.tpl,v 1.3 2004-09-02 21:09:33 x2000habouzit Exp $ ***************************************************************************} {config_load file="mails.conf" section="valid_alias"} -{subject text="[Polytechnique.org/MELIX] Demande de l'alias $alias@melix.net par $username"} +{subject text="[Polytechnique.org/MELIX] Demande de l'alias $alias@melix.net par $forlife"} {from full=#from#} -{to addr="$username@polytechnique.org"} +{to addr="$forlife@polytechnique.org"} {cc full=#cc#} {if $answer eq "yes"} Cher(e) camarade, diff --git a/templates/mails/valid.emploi.tpl b/templates/mails/valid.emploi.tpl deleted file mode 100644 index 7fd3a2a..0000000 --- a/templates/mails/valid.emploi.tpl +++ /dev/null @@ -1,44 +0,0 @@ -{*************************************************************************** - * Copyright (C) 2003-2004 Polytechnique.org * - * http://opensource.polytechnique.org/ * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - *************************************************************************** - $Id: valid.emploi.tpl,v 1.2 2004-08-31 11:25:41 x2000habouzit Exp $ - ***************************************************************************} - -{config_load file="mails.conf" section="valid_emploi"} -{subject text="[Polytechnique.org/EMPLOI] Annonce emploi $entreprise"} -{from full=#from#} -{cc full=#cc#} -{if $answer eq "yes"} -Bonjour, - -L'annonce « {$titre} » a été acceptée par les modérateurs. Elle apparaîtra dans le forum emploi du site. - -Nous vous remercions d'avoir proposé cette annonce - -Cordialement, -L'équipe Polytechnique.org -{elseif $answer eq 'no'} -Bonjour, - -L'annonce « {$titre} » a été refusée par les modérateurs. - -Cordialement, -L'équipe Polytechnique.org -{/if} -{* vim:set et sw=2 sts=2 sws=2: *} diff --git a/templates/mails/valid.epouses.tpl b/templates/mails/valid.epouses.tpl index 016f547..287c066 100644 --- a/templates/mails/valid.epouses.tpl +++ b/templates/mails/valid.epouses.tpl @@ -17,13 +17,13 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: valid.epouses.tpl,v 1.2 2004-08-31 11:25:41 x2000habouzit Exp $ + $Id: valid.epouses.tpl,v 1.3 2004-09-02 21:09:33 x2000habouzit Exp $ ***************************************************************************} {config_load file="mails.conf" section="valid_epouses"} -{subject text="[Polytechnique.org/EPOUSE] Changement de nom de mariage de $username"} +{subject text="[Polytechnique.org/EPOUSE] Changement de nom de mariage de $forlife"} {from full=#from#} -{to addr="$username@polytechnique.org"} +{to addr="$forlife@polytechnique.org"} {cc full=#cc#} {if $answer eq "yes"} Chère camarade, diff --git a/templates/mails/valid.evts.tpl b/templates/mails/valid.evts.tpl index be3e7e2..393857f 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.2 2004-08-31 11:25:41 x2000habouzit Exp $ + $Id: valid.evts.tpl,v 1.3 2004-09-02 21:09:33 x2000habouzit Exp $ ***************************************************************************} {config_load file="mails.conf" section="valid_evts"} {subject text="[Polytechnique.org/EVENEMENTS] Proposition d'événement"} {from full=#from#} -{to addr="$username@polytechnique.org"} +{to addr="$forlife@polytechnique.org"} {cc full=#cc#} {if $answer eq "yes"} Cher(e) camarade, diff --git a/templates/mails/valid.ml.tpl b/templates/mails/valid.ml.tpl index b8318d4..f9c9e0f 100644 --- a/templates/mails/valid.ml.tpl +++ b/templates/mails/valid.ml.tpl @@ -17,13 +17,13 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: valid.ml.tpl,v 1.2 2004-08-31 11:25:41 x2000habouzit Exp $ + $Id: valid.ml.tpl,v 1.3 2004-09-02 21:09:33 x2000habouzit Exp $ ***************************************************************************} {config_load file="mails.conf" section="valid_ml"} -{subject text="[Polytechnique.org/LISTES] Demande de la liste $alias par $username"} +{subject text="[Polytechnique.org/LISTES] Demande de la liste $alias par $forlife"} {from full=#from#} -{to addr="$username@polytechnique.org"} +{to addr="$forlife@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 43f42f9..1d8e663 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.2 2004-08-31 11:25:41 x2000habouzit Exp $ + $Id: valid.photos.tpl,v 1.3 2004-09-02 21:09:33 x2000habouzit Exp $ ***************************************************************************} {config_load file="mails.conf" section="valid_photos"} -{subject text="[Polytechnique.org/PHOTO] Changement de photo de $username"} +{subject text="[Polytechnique.org/PHOTO] Changement de photo de $forlife"} {from full=#from#} -{to addr="$username@polytechnique.org"} +{to addr="$forlife@polytechnique.org"} {cc full=#cc#} {if $answer eq "yes"} Cher(e) camarade, diff --git a/templates/mails/valid.sondages.tpl b/templates/mails/valid.sondages.tpl deleted file mode 100644 index e99a212..0000000 --- a/templates/mails/valid.sondages.tpl +++ /dev/null @@ -1,47 +0,0 @@ -{*************************************************************************** - * Copyright (C) 2003-2004 Polytechnique.org * - * http://opensource.polytechnique.org/ * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., * - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - *************************************************************************** - $Id: valid.sondages.tpl,v 1.2 2004-08-31 11:25:41 x2000habouzit Exp $ - ***************************************************************************} - -{config_load file="mails.conf" section="valid_sondages"} -{subject text="[Polytechnique.org/SONDAGE] Demande de validation du sondage $titre par $username"} -{from full=#from#} -{to addr="$username@polytechnique.org"} -{cc full=#cc#} -{if $answer eq "yes"} -Cher(e) camarade, - - Le sondage {$titre} que tu as composé vient d'être validé. - Il ne te reste plus qu'à transmettre aux sondés l'adresse où ils pourront voter. Cette adresse est : https://www.polytechnique.org/sondages/questionnaire.php?alias={$alias|escape:'url'} - -Cordialement, -L'équipe X.org -{elseif $answer eq 'no'} - -Cher(e) camarade, - - Le sondage $titre que tu avais proposé a été refusé. -La raison de ce refus est : -{$smarty.request.motif} - -Cordialement, -L'équipe X.org -{/if} -{* vim:set et sw=2 sts=2 sws=2: *} diff --git a/templates/profil/general.tpl b/templates/profil/general.tpl index 05bf5cd..14cd508 100644 --- a/templates/profil/general.tpl +++ b/templates/profil/general.tpl @@ -17,7 +17,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: general.tpl,v 1.10 2004-08-31 14:48:57 x2000habouzit Exp $ + $Id: general.tpl,v 1.11 2004-09-02 21:09:33 x2000habouzit Exp $ ***************************************************************************} @@ -132,7 +132,9 @@ quelque part (sur ton ordinateur ou sur Internet) d'une photo d'identité (dans un fichier au format JPEG, PNG ou GIF).
diff --git a/templates/trombino.tpl b/templates/trombino.tpl index f2910b7..4ae77f0 100644 --- a/templates/trombino.tpl +++ b/templates/trombino.tpl @@ -17,7 +17,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: trombino.tpl,v 1.5 2004-08-31 11:25:39 x2000habouzit Exp $ + $Id: trombino.tpl,v 1.6 2004-09-02 21:09:32 x2000habouzit Exp $ ***************************************************************************} @@ -67,7 +67,7 @@ La photo par d -  [ PHOTO ] +  [ PHOTO ] {if $submited} @@ -96,8 +96,6 @@ La photo par d -
-