X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fvalidations%2Fpaiements.inc.php;h=2612f3bf7403487b8ee66df9406fa85302ef2e33;hb=1f58ccb1e75eca08fbd04971d617ea372bc77b5a;hp=2343ac3a8ae43d249136117d21ad4d6357cafb7c;hpb=527ccdb5d9e3a120168331f4aa3070f6c574228e;p=platal.git diff --git a/include/validations/paiements.inc.php b/include/validations/paiements.inc.php index 2343ac3..2612f3b 100644 --- a/include/validations/paiements.inc.php +++ b/include/validations/paiements.inc.php @@ -1,6 +1,6 @@ titre = $_intitule; $this->site = $_site; @@ -163,7 +165,6 @@ class PayReq extends Validate public function commit() { - global $globals; $res = XDB::query("SELECT MAX(id) FROM paiement.paiements"); $id = $res->fetchOneCell()+1; $ret = XDB::execute("INSERT INTO paiement.paiements VALUES @@ -173,7 +174,7 @@ class PayReq extends Validate ", $id, $this->titre, $this->site, $this->montant, $this->montant_min, $this->montant_max, - $this->bestalias."@".$globals->mail->domain, $this->msg_reponse, $this->asso_id); + $this->user->bestEmail(), $this->msg_reponse, $this->asso_id); if ($this->asso_id && $this->evt) { XDB::execute("UPDATE groupex.evenements SET paiement_id = {?} @@ -200,7 +201,12 @@ class PayReq extends Validate $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(); } }