[DEV] Ajout de l'accessibilité au WS avec authentification

master
Cédric BOUHOURS 2 years ago
parent bc9fbff78a
commit b1e38a435a

@ -18,6 +18,7 @@
<span>{un_livre.TITLE}</span><br/> <span>{un_livre.TITLE}</span><br/>
<span>{un_livre.ISBN13}</span><br/> <span>{un_livre.ISBN13}</span><br/>
<img src="{un_livre.IMAGEMEDIUM}" /><br/> <img src="{un_livre.IMAGEMEDIUM}" /><br/>
<a href="?p=front&amp;p2=chercher&amp;index={INDEX_CURRENT}&amp;champ={CHAMP}&amp;valeur={VALEUR}&amp;add={un_livre.ID}" >Ajouter à sa bibliothèque</a>
<hr/> <hr/>
<!-- END un_livre --> <!-- END un_livre -->
</div> </div>

@ -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"]??[]); affectToBlocAndRepeat($template,"resultat.un_livre",$_SESSION["meslivres_resultat_recherche"]["ITEM2"]??[]);
affectToXHTML($template,array( affectToXHTML($template,array(
"INDEX_CURRENT"=>$_GET['bfmw_num_index']-5,
"INDEX_NEXT"=>$_GET['bfmw_num_index'], "INDEX_NEXT"=>$_GET['bfmw_num_index'],
"INDEX_PREV"=>($_GET['bfmw_num_index']-10)>0?($_GET['bfmw_num_index']-10):0, "INDEX_PREV"=>($_GET['bfmw_num_index']-10)>0?($_GET['bfmw_num_index']-10):0,
"CHAMP"=>$_GET['bfmw_orig_champ'], "CHAMP"=>$_GET['bfmw_orig_champ'],

@ -1,14 +1,17 @@
<?php <?php
class WS_Util class WS_Util
{ {
public static function CallWebService(string $base_url,string $endpoint, string $method,array $queryParams = [], $requestBody = []) : array { public static function CallWebService(string $base_url,string $endpoint, string $method,array $queryParams = [], $requestBody = [], string $login = "", string $pwd = "" ) : array {
$url = $base_url . $endpoint; $url = $base_url . $endpoint;
$options = [ $options = [
'http' => [ 'http' => [
'method' => $method, 'method' => $method,
'header' => 'Content-Type: application/json', // Remplacez si nécessaire 'header' => array(
'ignore_errors' => true, // Gérer les erreurs HTTP 'Content-Type: application/json',
empty($login)?:'Authorization: Basic $login $pwd'
),
'ignore_errors' => true
] ]
]; ];

Loading…
Cancel
Save