From 1b0f9efec66bb07cc4838c1cb97ec0b953571cf8 Mon Sep 17 00:00:00 2001
From: Patrick Barroca <pbarroca@afi-sa.fr>
Date: Mon, 15 Oct 2018 17:33:40 +0200
Subject: [PATCH] hotline #79132 : fix case in Lekiosk SSO url param

---
 VERSIONS_HOTLINE/79132                                  | 1 +
 library/digital_resources/Lekiosk/CasLink.php           | 2 +-
 library/digital_resources/Lekiosk/tests/LekioskTest.php | 8 ++++----
 3 files changed, 6 insertions(+), 5 deletions(-)
 create mode 100644 VERSIONS_HOTLINE/79132

diff --git a/VERSIONS_HOTLINE/79132 b/VERSIONS_HOTLINE/79132
new file mode 100644
index 00000000000..e7656ffc3f5
--- /dev/null
+++ b/VERSIONS_HOTLINE/79132
@@ -0,0 +1 @@
+ - ticket #79132 : Lekiosk : Correction du lien vers une ressource lorsque l'usager est déjà connecté 
\ No newline at end of file
diff --git a/library/digital_resources/Lekiosk/CasLink.php b/library/digital_resources/Lekiosk/CasLink.php
index 1141cd83055..9d8fe0137e2 100644
--- a/library/digital_resources/Lekiosk/CasLink.php
+++ b/library/digital_resources/Lekiosk/CasLink.php
@@ -27,7 +27,7 @@ class Lekiosk_CasLink extends Lekiosk_LinkAbstract {
                          [
                           'cas_fournisseur' => Class_Url::absolute(['controller' => 'cas-server-v10'], null, true),
                           'id' => Lekiosk_Config::getInstance()->getAdminVar('ID'),
-                          'ReturnUrl' => $this->_getReturnURL($album)
+                          'returnUrl' => $this->_getReturnURL($album)
                          ] );
   }
 }
diff --git a/library/digital_resources/Lekiosk/tests/LekioskTest.php b/library/digital_resources/Lekiosk/tests/LekioskTest.php
index f864e789e3f..60fbb092d78 100644
--- a/library/digital_resources/Lekiosk/tests/LekioskTest.php
+++ b/library/digital_resources/Lekiosk/tests/LekioskTest.php
@@ -104,8 +104,8 @@ class LekioskLinkModeSSOTest extends LekioskLinkModeLinkTestCase {
   public function linkShouldBeCasUrlWithLekioskId() {
     $url = 'https://apipros.lekiosk.com/login/cas?'
       .'cas_fournisseur=' . urlencode(Class_Url::rootUrl() . BASE_URL . '/cas-server-v10')
-                          .'&id=29'
-      .'&ReturnUrl=';
+      .'&id=29'
+      .'&returnUrl=';
 
     $this->assertEquals($url,
                         (new Lekiosk_CasLink(''))->url());
@@ -432,7 +432,7 @@ class LekioskRenderAlbumFromRecordTest extends LekioskServiceTestCase {
     $url = 'https://apipros.lekiosk.com/login/cas?'
       .'cas_fournisseur=' . urlencode(Class_Url::absolute('/cas-server-v10'))
       .'&id=29'
-      .'&ReturnUrl=Le-10-Sport-National-z1962566.aspx';
+      .'&returnUrl=Le-10-Sport-National-z1962566.aspx';
 
     $this->assertXPath('//a[@href="' . $url . '"]', $this->_response->getBody());
   }
@@ -670,7 +670,7 @@ class LekioskServiceHttpHarvestingNoticeAjaxTest extends LekioskServiceHttpHarve
     $url = 'https://apipros.lekiosk.com/login/cas?'
       .'cas_fournisseur=' . urlencode(Class_Url::absolute('/cas-server-v10'))
       .'&id=29'
-      .'&ReturnUrl='. urlencode('/fr/pageproduct/851749/2052615');
+      .'&returnUrl='. urlencode('/fr/pageproduct/851749/2052615');
 
     $this->assertXPath('//a[@href="' . $url . '"]', $this->_response->getBody());
   }
-- 
GitLab