X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;ds=sidebyside;f=modules%2Fpayment.php;h=415b60765bc295e5ab9115e0379dc7fbd9f5fa8c;hb=9c1b78c7ee1575436bbf277536c4ec0671ed8344;hp=0cd97f10bd4f2a6dc7867f4559623ca445df9dd8;hpb=a8b4ccb6c163277c49fb92427a7bb4ace8469660;p=platal.git diff --git a/modules/payment.php b/modules/payment.php index 0cd97f1..415b607 100644 --- a/modules/payment.php +++ b/modules/payment.php @@ -1,6 +1,6 @@ $this->make_hook('payment', AUTH_MDP), - 'payment/cyber_return' => $this->make_hook('cyber_return', AUTH_PUBLIC), - 'payment/paypal_return' => $this->make_hook('paypal_return', AUTH_PUBLIC), - '%grp/paiement' => $this->make_hook('xnet_payment', AUTH_MDP), - '%grp/payment' => $this->make_hook('xnet_payment', AUTH_MDP), - '%grp/payment/cyber_return' => $this->make_hook('cyber_return', AUTH_PUBLIC), - '%grp/payment/paypal_return' => $this->make_hook('paypal_return', AUTH_PUBLIC), - 'admin/payments' => $this->make_hook('admin', AUTH_MDP, 'admin'), + 'payment' => $this->make_hook('payment', AUTH_MDP), + 'payment/cyber_return' => $this->make_hook('cyber_return', AUTH_PUBLIC, 'user', NO_HTTPS), + 'payment/paypal_return' => $this->make_hook('paypal_return', AUTH_PUBLIC, 'user', NO_HTTPS), + '%grp/paiement' => $this->make_hook('xnet_payment', AUTH_MDP), + '%grp/payment' => $this->make_hook('xnet_payment', AUTH_MDP), + '%grp/payment/cyber_return' => $this->make_hook('cyber_return', AUTH_PUBLIC, 'user', NO_HTTPS), + '%grp/payment/paypal_return' => $this->make_hook('paypal_return', AUTH_PUBLIC, 'user', NO_HTTPS), + 'admin/payments' => $this->make_hook('admin', AUTH_MDP, 'admin'), ); } @@ -105,7 +105,7 @@ class PaymentModule extends PLModule global $globals; require_once 'profil.func.inc.php' ; - require_once dirname(__FILE__).'/payment/money.inc.php' ; + $this->load('money.inc.php'); if (!empty($GLOBALS['IS_XNET_SITE'])) { if (!$globals->asso('id')) { @@ -208,7 +208,7 @@ class PaymentModule extends PLModule $res = XDB::query("SELECT rcb.text,c.id,c.text FROM paiement.codeRCB AS rcb LEFT JOIN paiement.codeC AS c ON rcb.codeC=c.id - WHERE rcb.id='$champ906'"); + WHERE rcb.id={?}", $champ906); if (list($rcb_text, $c_id, $c_text) = $res->fetchOneRow()) { cb_erreur("erreur lors du paiement : $c_text ($c_id)"); } else{ @@ -221,11 +221,22 @@ class PaymentModule extends PLModule VALUES ({?},{?},{?},{?},{?},{?},{?})", $champ901, $uid, $ref, $champ200, $montant, $champ905,Env::v('comment')); + // We check if it is an Xnet payment and then update the related ML. + $res = XDB::query('SELECT eid + FROM groupex.evenements + WHERE paiement_id = {?}', $ref); + if ($eid = $res->fetchOneCell()) { + $this->load('xnetevents.inc.php'); + $evt = get_event_detail($eid); + subscribe_lists_event(0, $uid, $evt, $montant, true); + } + /* on genere le mail de confirmation */ $conf_text = str_replace("",$prenom,$conf_text); $conf_text = str_replace("",$nom,$conf_text); $conf_text = str_replace("",$promo,$conf_text); $conf_text = str_replace("",$montant,$conf_text); + $conf_text = str_replace("", Env::v('comment'), $conf_text); $conf_text = str_replace("",$femme ? "Chère" : "Cher",$conf_text); $conf_text = str_replace("",$femme ? "Chère" : "Cher",$conf_text); @@ -311,6 +322,16 @@ class PaymentModule extends PLModule VALUES ({?},{?},{?},{?},{?},{?},{?})", $no_transaction, $uid, $ref, $fullref, $montant, $clef, Env::v('comment')); + // We check if it is an Xnet payment and then update the related ML. + $res = XDB::query('SELECT eid + FROM groupex.evenements + WHERE paiement_id = {?}', $ref); + if ($eid = $res->fetchOneCell()) { + $this->load('xnetevents.inc.php'); + $evt = get_event_detail($eid); + subscribe_lists_event(0, $uid, $evt, $montant, true); + } + /* on genere le mail de confirmation */ $conf_text = str_replace("",$prenom,$conf_text); $conf_text = str_replace("",$nom,$conf_text);