Salut,
Merci pour ce module, tout fonctionne excepté la sécurité

n'importe quel client peut voir n'importe quelle commande

J'ai pdf invoice 1.5 mais je comprends pas la sécurité devrait marché ...
Si j'essai la sécurité du fichier donné en page 2 je n'ai carrément plus accès à aucune facture

Please Help lool !
Problème réglé

____________________________________________________________________________
EDIT - EDIT - EDIT - EDIT - EDIT - EDIT - EDIT - EDIT - EDIT - EDIT - EDIT - EDIT - EDIT____________________________________________________________________________
Pour ceux qui comme moi ont rencontré ce problème (VOUS DEVEZ AVOIR INSTALLE LE MODULE DE LA PREMIERE PAGE) :
Créer un fichier index_error.php dans lequel vous mettrez le message d'erreur de votre choix (exemple : Hacking attempts ou une jolie erreur 404)
l'icon pdf qui va bien =>

à placer dans includes/languages/french/images/buttons/
Dans catalog/account_history.php
Chercher :
Code
<td class="main" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ORDERS_INVOICE, 'oID=' . $history['orders_id']) . '" target="_blank">' . tep_image_button('invoice.gif', IMAGE_BUTTON_INVOICE) . '</a>'; ?> </td>
Remplacer par :
Code
<td class="main" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ORDERS_INVOICE, 'oID=' . $history['orders_id'] . '&cID=' . (int)$customer_id) . '" target="_blank">' . tep_image_button('icon_pdf.png', IMAGE_BUTTON_INVOICE) . '</a>'; ?> </td>
Dans catalog/invoice.php
Chercher :
Code
// création de la sécurité pour la récupération des factures pdf
// récupération de l'id de client de la commande
$verif_order = tep_db_query("
SELECT customers_id,
orders_id
FROM " . TABLE_ORDERS . "
WHERE customers_id = '" . tep_session_is_registered('customer_id') . "'
");
$verif = tep_db_fetch_array($verif_order);
//récupération de l'id de la commande du client en cours
$orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where orders_id = '" . $oID . "'");
$order = tep_db_fetch_array($orders_query);
// comparaison des id des clients pour attester le client en cours
if ($verif['orders_id'] == $oID)
{
// fin debut sécurité
Remplacer par :
Code
// création de la sécurité pour la récupération des factures pdf
// récupération de l'id de client de la commande
$verif_order = tep_db_query("select customers_id, orders_id from " . TABLE_ORDERS . " where customers_id = '" . $_GET['cID'] . "' and orders_id = '" . $_GET['oID'] . "'");
$verif = tep_db_fetch_array($verif_order);
// comparaison des id des clients pour attester le client en cours
if(((int)$customer_id == $_GET['cID']) && ($verif['orders_id'] == $_GET['oID']))
{
// fin debut sécurité
Chercher :
Code
// début fin sécurité
}
else
{
echo 'ce que vous voulez dire au cas ou quelquun essaie de bidouiller';
}
// fin sécurité
Remplacer par :
Code
// début fin sécurité
}
else
{
?>
<script type="text/javascript">location.href = 'index_error.php';</script>
<?php
}
// fin sécurité
That's All Folks !