Merge branch 'platal-0.10.0'
[platal.git] / include / validations / paiements.inc.php
index ec12a83..2612f3b 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -44,7 +44,7 @@ Si le télépaiement n'est pas lié à un groupe ou supérieur à 51 euros, lais
     // }}}
     // {{{ constructor
 
-    public function __construct(User $_user, $_intitule, $_site, $_montant, $_msg,
+    public function __construct(User &$_user, $_intitule, $_site, $_montant, $_msg,
                                 $_montantmin=0, $_montantmax=999, $_asso_id = 0,
                                 $_evt = 0, $_stamp=0)
     {
@@ -201,7 +201,12 @@ Si le télépaiement n'est pas lié à un groupe ou supérieur à 51 euros, lais
                     $mailer->assign('payment', $id);
                     $mailer->assign('prenom', $u['prenom']);
                     $mailer->assign('topay', $topay);
-                    $mailer->assign('to', $u['email']);
+
+                    if (strpos($u['email'], '@') === false) {
+                        $mailer->assign('to', $u['email'] . '@' . $globals->mail->domain);
+                    } else {
+                        $mailer->assign('to', $u['email']);
+                    }
                     $mailer->send();
                 }
             }