X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fpayment.php;h=d24ebcfb8a724aa9af43cac4460794a8ad5c4eb0;hb=56cd7aeef7f34f7dec76564821330be5d587b72c;hp=737d9c2e36dc0185767b6f03eb8af8f5ef18b3c6;hpb=ba879af870d71163785c12ae4f4e7a070c6e614e;p=platal.git diff --git a/modules/payment.php b/modules/payment.php index 737d9c2..d24ebcf 100644 --- a/modules/payment.php +++ b/modules/payment.php @@ -90,7 +90,7 @@ class PaymentModule extends PLModule function handlers() { return array( - 'payment' => $this->make_hook('payment', AUTH_MDP), + 'payment' => $this->make_hook('payment', AUTH_MDP, 'payment'), 'payment/cyber_return' => $this->make_hook('cyber_return', AUTH_PUBLIC, 'user', NO_HTTPS), 'payment/cyber2_return' => $this->make_hook('cyber2_return', AUTH_PUBLIC, 'user', NO_HTTPS), 'payment/paypal_return' => $this->make_hook('paypal_return', AUTH_PUBLIC, 'user', NO_HTTPS), @@ -108,7 +108,6 @@ class PaymentModule extends PLModule { global $globals; - require_once 'profil.func.inc.php' ; $this->load('money.inc.php'); if (!empty($GLOBALS['IS_XNET_SITE'])) { @@ -264,7 +263,7 @@ class PaymentModule extends PLModule function handler_cyber2_return(&$page, $uid = null) { global $globals, $platal; - + /* on vérifie la signature */ $vads_params = array(); foreach($_REQUEST as $key => $value) @@ -275,7 +274,7 @@ class PaymentModule extends PLModule //if($signature != Env::v('signature')) { // cb_erreur("signature invalide"); //} - + /* on extrait les informations sur l'utilisateur */ $user = User::get(Env::v('vads_cust_id')); if (!$user) { @@ -294,7 +293,7 @@ class PaymentModule extends PLModule if (!list($conf_mail, $conf_title, $conf_text) = $res->fetchOneRow()) { cb_erreur("référence de commande inconnue"); } - + /* on extrait le montant */ if (Env::v('vads_currency') != "978") { cb_erreur("monnaie autre que l'euro"); @@ -305,13 +304,13 @@ class PaymentModule extends PLModule if (Env::v('vads_result') != "00") { cb_erreur("erreur lors du paiement : ?? (".Env::v('vads_result').")"); } - + /* on fait l'insertion en base de donnees */ XDB::execute("INSERT INTO payment_transactions (id, uid, ref, fullref, amount, pkey, comment) VALUES ({?}, {?}, {?}, {?}, {?}, {?}, {?})", Env::v('vads_trans_date'), $user->id(), $ref, Env::v('vads_order_id'), $montant, "", Env::v('vads_order_info')); echo "Paiement stored.\n"; - + // We check if it is an Xnet payment and then update the related ML. $res = XDB::query('SELECT eid FROM group_events