From 237b6585ed66d5ede438ef7d820da8d4a6443f03 Mon Sep 17 00:00:00 2001
From: x2001corpet
Date: Wed, 12 Oct 2005 06:35:56 +0000
Subject: [PATCH] orth + bug 356 nom d'usage pour les paiements
git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@93 839d8a87-29fc-0310-9880-83ba4fa771e5
---
include/money/cyberpaiement.inc.php | 4 +++-
include/money/paypal.inc.php | 4 +++-
templates/profil.tpl | 4 ++--
templates/profil/general.tpl | 2 +-
4 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/include/money/cyberpaiement.inc.php b/include/money/cyberpaiement.inc.php
index f9b3e26..ffe502c 100644
--- a/include/money/cyberpaiement.inc.php
+++ b/include/money/cyberpaiement.inc.php
@@ -54,6 +54,8 @@ class CyberPayment
if (Cookie::has(session_name())) {
$returnurl .= "?".SID;
}
+ $req = $globals->xdb->query("SELECT IF(nom_usage!='', nom_usage, nom) AS nom FROM auth_user_md5 WHERE user_id = {?}",Session::get('uid'));
+ $name = $req->fetchOneCell();
// on constuit la reference de la transaction
$prefix = ($pay->flags->hasflag('unique')) ? str_pad("",15,"0") : rand_url_id();
@@ -71,7 +73,7 @@ class CyberPayment
'CHAMP007' => $globals->baseurl,
'CHAMP008' => $pay->mail);
$this->infos['client'] = Array(
- 'CHAMP100' => Session::get('nom'),
+ 'CHAMP100' => $name,
'CHAMP101' => Session::get('prenom'),
'CHAMP102' => '.',
'CHAMP103' => '.',
diff --git a/include/money/paypal.inc.php b/include/money/paypal.inc.php
index 63634c5..bac5a75 100644
--- a/include/money/paypal.inc.php
+++ b/include/money/paypal.inc.php
@@ -52,6 +52,8 @@ class PayPal
global $globals;
$this->urlform = 'https://'.$globals->money->paypal_site.'/cgi-bin/webscr';
+ $req = $globals->xdb->query("SELECT IF(nom_usage!='', nom_usage, nom) AS nom FROM auth_user_md5 WHERE user_id = {?}",Session::get('uid'));
+ $name = $req->fetchOneCell();
$roboturl = str_replace("https://","http://",$globals->baseurl)
."/paiement/paypal_retour.php?uid="
@@ -69,7 +71,7 @@ class PayPal
$info_client = Array(
'first_name' => Session::get('prenom'),
- 'last_name' => Session::get('nom'),
+ 'last_name' => $name,
'email' => Session::get('bestalias').'@polytechnique.org');
$res = $globals->xdb->query(
diff --git a/templates/profil.tpl b/templates/profil.tpl
index 6a37f1e..7558397 100644
--- a/templates/profil.tpl
+++ b/templates/profil.tpl
@@ -30,8 +30,8 @@
{/foreach}
Tu peux consulter
-tel qu'elle apparaîtra pour un camarade,
-ou qu'elle apparaîtra à tout le monde.
+telle qu'elle apparaîtra pour un camarade,
+ou qu'elle apparaîtra à tout le monde.