X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fpayment.php;h=940fac1bc6140551f84fbb4f0bdd4332f4133de7;hb=7373df1ef02775172149f6a16c4c94fccd3a1ab8;hp=0d0797293dd89f1d721b91af499ca844c5c29a82;hpb=a7de4ef724d1a3b0bf978a50ce7cc9d23412c7a0;p=platal.git diff --git a/modules/payment.php b/modules/payment.php index 0d07972..940fac1 100644 --- a/modules/payment.php +++ b/modules/payment.php @@ -31,7 +31,8 @@ function cb_erreur($text) { } /* sort en affichant une erreur */ -function paypal_erreur($text, $send=true) { +function paypal_erreur($text, $send=true) +{ global $page, $erreur; if ($erreur) return; $erreur = $text; @@ -79,8 +80,8 @@ class PaymentModule extends PLModule 'payment' => $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/paiement' => $this->make_hook('xnet_payment', AUTH_MDP, 'groupmember'), + '%grp/payment' => $this->make_hook('xnet_payment', AUTH_MDP, 'groupmember'), '%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'), @@ -106,11 +107,9 @@ class PaymentModule extends PLModule if (!$res->numRows()) { return PL_FORBIDDEN; } - new_group_page('payment/index.tpl'); - } else { - $page->changeTpl('payment/index.tpl'); - $page->assign('xorg_title','Polytechnique.org - Télépaiements'); } + $page->changeTpl('payment/index.tpl'); + $page->assign('xorg_title','Polytechnique.org - Télépaiements'); // initialisation $op = Env::v('op', 'select'); @@ -171,7 +170,7 @@ class PaymentModule extends PLModule /* on extrait les informations sur l'utilisateur */ $res = XDB::query(" - SELECT a.prenom,a.nom,a.promo,l.alias,FIND_IN_SET(a.flags,'femme') + SELECT a.prenom,a.nom,a.promo,l.alias,FIND_IN_SET('femme', a.flags) FROM auth_user_md5 AS a INNER JOIN aliases AS l ON (a.user_id=l.id AND type!='homonyme') WHERE a.user_id={?}", $uid); @@ -224,8 +223,8 @@ class PaymentModule extends PLModule $mymail->addTo("\"$prenom $nom\" <$forlife@polytechnique.org>"); $mymail->addCc($conf_mail); $mymail->setSubject($conf_title); - $mymail->setTxtBody($conf_text); - $mymail->send(); + $mymail->setWikiBody($conf_text); + $mymail->send(S::v('mail_fmt') == 'html'); /* on envoie les details de la transaction à telepaiement@ */ $mymail = new PlMailer(); @@ -278,7 +277,7 @@ class PaymentModule extends PLModule /* on extrait les informations sur l'utilisateur */ $res = XDB::query(" - SELECT a.prenom,a.nom,a.promo,l.alias,FIND_IN_SET(a.flags,'femme') + SELECT a.prenom,a.nom,a.promo,l.alias,FIND_IN_SET('femme', a.flags) FROM auth_user_md5 AS a INNER JOIN aliases AS l ON (a.user_id=l.id AND type!='homonyme') WHERE a.user_id={?}", $uid); @@ -317,8 +316,8 @@ class PaymentModule extends PLModule $mymail->addTo("\"$prenom $nom\" <$forlife@polytechnique.org>"); $mymail->addCc($conf_mail); $mymail->setSubject($conf_title); - $mymail->setTxtBody($conf_text); - $mymail->send(); + $mymail->setWikiBody($conf_text); + $mymail->send(S::v('mail_fmt') == 'html'); /* on envoie les details de la transaction à telepaiement@ */ $mymail = new PlMailer(); @@ -346,12 +345,12 @@ class PaymentModule extends PLModule if (!is_null($pid)) { return $this->handler_payment($page, $pid); } - new_group_page('payment/xnet.tpl'); + $page->changeTpl('payment/xnet.tpl'); $res = XDB::query( "SELECT id, text, url FROM {$globals->money->mpay_tprefix}paiements - WHERE asso_id = {?} AND NOT FIND_IN_SET(flags, 'old') + WHERE asso_id = {?} AND NOT FIND_IN_SET('old', flags) ORDER BY id DESC", $globals->asso('id')); $tit = $res->fetchAllAssoc(); $page->assign('titres', $tit);