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 $
***************************************************************************}
-