Adapt text to the sex of the user && Typo.
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Fri, 30 May 2008 10:59:33 +0000 (12:59 +0200)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Fri, 30 May 2008 10:59:33 +0000 (12:59 +0200)
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
modules/email.php
templates/emails/imap_register.tpl

index 1961dc5..f729165 100644 (file)
@@ -450,12 +450,12 @@ class EmailModule extends PLModule
         $page->changeTpl('emails/imap_register.tpl');
         $id = null;
         if (!empty($hash) || !empty($login)) {
-            $req = XDB::query("SELECT  u.prenom, id
+            $req = XDB::query("SELECT  u.prenom, FIND_IN_SET('femme', u.flags) AS sexe, a.id
                                  FROM  aliases AS a
                            INNER JOIN  newsletter_ins AS ni ON (a.id = ni.user_id)
                            INNER JOIN  auth_user_md5 AS u ON (u.user_id = a.id)
                                 WHERE  a.alias = {?} AND ni.hash = {?}", $login, $hash);
-            list($prenom, $id) = $req->fetchOneRow();
+            list($prenom, $sexe, $id) = $req->fetchOneRow();
         }
 
         require_once('emails.inc.php');
@@ -465,11 +465,13 @@ class EmailModule extends PLModule
             $storage->activate();
             $page->assign('ok', true);
             $page->assign('prenom', S::v('prenom'));
+            $page->assign('sexe', S::v('femme'));
         } else if (!S::logged() && $id) {
             $storage = new EmailStorage($id, 'imap');
             $storage->activate();
             $page->assign('ok', true);
             $page->assign('prenom', $prenom);
+            $page->assign('sexe', $sexe);
         }
     }
 
index 62581f3..cf29b4a 100644 (file)
 
 {if $ok}
 <p>
-  Cher {$prenom},
+  {if $sexe}Chère{else}Cher{/if} {$prenom},
 </p>
 
 <p>
-le stockage de secours de tes emails a été activé avec succès. Tu trouveras d'avantages d'informations à ce
+le stockage de secours de tes emails a été activé avec succès. Tu trouveras davantage d'informations à ce
 sujet sur la page de <a href="Xorg/IMAP">documentation</a>.
 </p>