Adapt the validation mail to the sex of the user
authorx2003bruneau <x2003bruneau@839d8a87-29fc-0310-9880-83ba4fa771e5>
Thu, 30 Nov 2006 20:41:08 +0000 (20:41 +0000)
committerx2003bruneau <x2003bruneau@839d8a87-29fc-0310-9880-83ba4fa771e5>
Thu, 30 Nov 2006 20:41:08 +0000 (20:41 +0000)
git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1212 839d8a87-29fc-0310-9880-83ba4fa771e5

include/validations.inc.php

index 4003a56..bc88ddf 100644 (file)
@@ -62,6 +62,7 @@ class Validate
     var $prenom;
     var $nom;
     var $promo;
+    var $sexe;
     var $bestalias;
     var $forlife;
 
@@ -90,12 +91,12 @@ class Validate
         $this->unique = $_unique;
         $this->type   = $_type;
         $res = XDB::query(
-                "SELECT  u.prenom, u.nom, u.promo, a.alias, b.alias
+                "SELECT  u.prenom, u.nom, u.promo, FIND_IN_SET('femme', u.flags) AS sexe, a.alias, b.alias
                    FROM  auth_user_md5 AS u
              INNER JOIN  aliases       AS a ON ( u.user_id=a.id AND a.type='a_vie' )
              INNER JOIN  aliases       AS b ON ( u.user_id=b.id AND b.type!='homonyme' AND FIND_IN_SET('bestalias', b.flags) )
                   WHERE  u.user_id={?}", $_uid);
-        list($this->prenom, $this->nom, $this->promo, $this->forlife, $this->bestalias) = $res->fetchOneRow();
+        list($this->prenom, $this->nom, $this->promo, $this->sexe, $this->forlife, $this->bestalias) = $res->fetchOneRow();
     }
     
     // }}}
@@ -239,7 +240,7 @@ class Validate
         $mailer->addTo("\"{$this->prenom} {$this->nom}\" <{$this->bestalias}@{$globals->mail->domain}>");
         $mailer->addCc("validation+{$this->type}@{$globals->mail->domain}");
 
-        $body = "Cher(e) camarade,\n\n"
+        $body = ($this->sexe ? "Chère camarade,\n\n" : "Cher camarade,\n\n")
               . $this->_mail_body($isok)
               . (Env::has('comm') ? "\n\n".Env::v('comm') : '')
               . "\n\nCordialement,\nL'équipe Polytechnique.org\n";