Moving to GitHub.
[platal.git] / modules / marketing.php
index d1d8372..a939a6a 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2011 Polytechnique.org                              *
+ *  Copyright (C) 2003-2014 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -237,7 +237,7 @@ class MarketingModule extends PLModule
         if (Post::has('mail')) {
             $email = valide_email(Post::v('mail'));
         }
-        if (Post::has('valide') && isvalid_email_redirection($email)) {
+        if (Post::has('valide') && isvalid_email_redirection($email, $user)) {
             S::assert_xsrf_token();
 
             // security stuff
@@ -303,7 +303,7 @@ class MarketingModule extends PLModule
             $email = trim(Post::v('mail'));
 
             require_once 'emails.inc.php';
-            if (!isvalid_email_redirection($email)) {
+            if (!isvalid_email_redirection($email, $user)) {
                 $page->trigError('Email invalide&nbsp;!');
             } else {
                 // On cherche les marketings précédents sur cette adresse
@@ -328,8 +328,8 @@ class MarketingModule extends PLModule
             $market = new AnnuaireMarketing(null, true);
             $text = $market->getText(array(
                 'sexe'           => $user->isFemale(),
-                'forlife_email'  => $user->forlifeEmail(),
-                'forlife_email2' => $user->forlifeEmailAlternate()
+                'forlife_email'  => $user->hruid . "@" . $user->mainEmailDomain(),
+                'forlife_email2' => $user->hruid . "@" . $user->alternateEmailDomain()
             ));
             $text = str_replace('%%hash%%', '', $text);
             $text = str_replace('%%personal_notes%%', '<em id="personal_notes_display"></em>', $text);
@@ -401,5 +401,5 @@ class MarketingModule extends PLModule
     }
 }
 
-// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker fenc=utf-8:
 ?>