From b1e38a435a3ca4f4c77ccbb48391754bc35fdd11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20BOUHOURS?= Date: Mon, 4 Sep 2023 17:15:13 +0200 Subject: [PATCH] =?UTF-8?q?[DEV]=20Ajout=20de=20l'accessibilit=C3=A9=20au?= =?UTF-8?q?=20WS=20avec=20authentification?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Templates/chercher.html | 1 + Traitement/chercher.php | 1 + common/Model/WS_Util.php | 9 ++++++--- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Templates/chercher.html b/Templates/chercher.html index 510f601..abc2a1f 100644 --- a/Templates/chercher.html +++ b/Templates/chercher.html @@ -18,6 +18,7 @@ {un_livre.TITLE}
{un_livre.ISBN13}

+ Ajouter à sa bibliothèque
diff --git a/Traitement/chercher.php b/Traitement/chercher.php index 8a13ef7..7b85b18 100644 --- a/Traitement/chercher.php +++ b/Traitement/chercher.php @@ -28,6 +28,7 @@ if (isset ($_SESSION["meslivres_resultat_recherche"]) && isset($_GET['bfmw_num_i affectToBlocAndRepeat($template,"resultat.un_livre",$_SESSION["meslivres_resultat_recherche"]["ITEM2"]??[]); affectToXHTML($template,array( + "INDEX_CURRENT"=>$_GET['bfmw_num_index']-5, "INDEX_NEXT"=>$_GET['bfmw_num_index'], "INDEX_PREV"=>($_GET['bfmw_num_index']-10)>0?($_GET['bfmw_num_index']-10):0, "CHAMP"=>$_GET['bfmw_orig_champ'], diff --git a/common/Model/WS_Util.php b/common/Model/WS_Util.php index c0af6bf..aae8d2a 100644 --- a/common/Model/WS_Util.php +++ b/common/Model/WS_Util.php @@ -1,14 +1,17 @@ [ 'method' => $method, - 'header' => 'Content-Type: application/json', // Remplacez si nécessaire - 'ignore_errors' => true, // Gérer les erreurs HTTP + 'header' => array( + 'Content-Type: application/json', + empty($login)?:'Authorization: Basic $login $pwd' + ), + 'ignore_errors' => true ] ];