diff --git a/VERSIONS_HOTLINE/99042 b/VERSIONS_HOTLINE/99042 new file mode 100644 index 0000000000000000000000000000000000000000..cedb3c381640b5d4451e3b8c104fc54548c06dde --- /dev/null +++ b/VERSIONS_HOTLINE/99042 @@ -0,0 +1 @@ + - ticket #99042 : ArteVOD SSO : ajout du referer dans l'url de redirection \ No newline at end of file diff --git a/library/Class/ArteVodLink.php b/library/Class/ArteVodLink.php index a28a27d604825d2789a4fcaed4b88c1406e5caeb..207bde536bf09580b5591893f8cd4569e9c98c68 100644 --- a/library/Class/ArteVodLink.php +++ b/library/Class/ArteVodLink.php @@ -77,7 +77,8 @@ class Class_ArteVodLink { 'email' => $this->_user->getMail(), 'dnaiss' => $this->_user->getNaissance(), 'datout' => $this->_user->getDateFin(), - 'return_url' => $this->baseUrl()]; + 'return_url' => $this->baseUrl(), + 'referer' => Class_Url::getProtocol(). Class_AdminVar::getNomDomaine()]; return static::AUTH_URL . '?' diff --git a/tests/application/modules/opac/controllers/ModulesControllerTest.php b/tests/application/modules/opac/controllers/ModulesControllerTest.php index 161f14ce80f56ce8b6dddc03427b7adf24c78f35..7e7a8dcec8cf1330d3347daf43e02d55763a0d36 100644 --- a/tests/application/modules/opac/controllers/ModulesControllerTest.php +++ b/tests/application/modules/opac/controllers/ModulesControllerTest.php @@ -139,10 +139,10 @@ class ModulesControllerArteVodTest extends AbstractControllerTestCase { ->addRight(Class_UserGroup::RIGHT_ACCES_ARTEVOD); Class_Users::getIdentity()->setUserGroups([$group]); - + Class_AdminVar::set('NOM_DOMAINE', 'mymediatheque.com'); $this->dispatch('/opac/modules/artevod'); $this->assertXpathContentContains('//script', - 'document.location.href="https://portal.mediatheque-numerique.com/sso_login?sso_id=afi&id=666&id_encrypted=ce04173447e59a7a3608f625b0348ccec5f4070c7c3f286b032cbe6374ec9f32&d=d8fb24f80a99bded9ed417591c5ac5cc1e123bcce10d65e1f6a83211ca18d3e8&return_url=https%3A%2F%2Fvod.mediatheque-numerique.com%2Fmediatheques%2Fuser";'); + 'document.location.href="https://portal.mediatheque-numerique.com/sso_login?sso_id=afi&id=666&id_encrypted=ce04173447e59a7a3608f625b0348ccec5f4070c7c3f286b032cbe6374ec9f32&d=d8fb24f80a99bded9ed417591c5ac5cc1e123bcce10d65e1f6a83211ca18d3e8&return_url=https%3A%2F%2Fvod.mediatheque-numerique.com%2Fmediatheques%2Fuser&referer=http%3A%2F%2Fmymediatheque.com";', $this->_response->getBody()); } } diff --git a/tests/library/Class/ArteVodLinkTest.php b/tests/library/Class/ArteVodLinkTest.php index 566fc8feaf5a8282fef7cedd0cd57ab57027aa99..14772e4a80dd04ef95b913d3fa4dd51e9ea2771c 100644 --- a/tests/library/Class/ArteVodLinkTest.php +++ b/tests/library/Class/ArteVodLinkTest.php @@ -57,7 +57,7 @@ class ArteVodLinkWithUserAndAlbumTest extends ModelTestCase { ->setDateFin('2023-09-12'); Class_AdminVar::set('ARTE_VOD_SSO_KEY', $this->_sso_key); - + Class_AdminVar::set('NOM_DOMAINE', 'mymediatheque.com'); $this->_arte_vod_link = Class_ArteVodLink::forAlbumAndUser($entre_les_murs, $this->_james_bond); } @@ -81,7 +81,8 @@ class ArteVodLinkWithUserAndAlbumTest extends ModelTestCase { .'&nom=Bond' .'&email='.urlencode('jbond@007.fr') .'&datout=2023-09-12' - .'&return_url=' . urlencode('http://www.mediatheque-numerique.com/films/entre-les-murs'), + .'&return_url=' . urlencode('http://www.mediatheque-numerique.com/films/entre-les-murs') + .'&referer=http%3A%2F%2Fmymediatheque.com', $this->_arte_vod_link->url()); } @@ -100,7 +101,8 @@ class ArteVodLinkWithUserAndAlbumTest extends ModelTestCase { .'&id_encrypted='. hash('sha256', '45' . $this->_sso_key) .'&d='. hash('sha256', date('dmY'). $this->_sso_key) .'&datout=2023-09-12' - .'&return_url=' . urlencode('http://www.mediatheque-numerique.com/films/entre-les-murs'), + .'&return_url=' . urlencode('http://www.mediatheque-numerique.com/films/entre-les-murs') + .'&referer=http%3A%2F%2Fmymediatheque.com', $this->_arte_vod_link->url()); } @@ -120,7 +122,8 @@ class ArteVodLinkWithUserAndAlbumTest extends ModelTestCase { .'&id=19' .'&id_encrypted='. hash('sha256', '19' . $this->_sso_key) .'&d='. hash('sha256', date('dmY') . $this->_sso_key) - .'&return_url=' . urlencode('http://www.mediatheque-numerique.com/films/entre-les-murs'), + .'&return_url=' . urlencode('http://www.mediatheque-numerique.com/films/entre-les-murs') + .'&referer=http%3A%2F%2Fmymediatheque.com', $this->_arte_vod_link->url()); } @@ -141,8 +144,8 @@ class ArteVodLinkWithUserAndAlbumTest extends ModelTestCase { .'&id_encrypted='. hash('sha256', '45' . $this->_sso_key) .'&d='. hash('sha256', date('dmY') . $this->_sso_key) .'&dnaiss=1975-01-01' - .'&return_url=' . urlencode('http://www.mediatheque-numerique.com/films/entre-les-murs'), - + .'&return_url=' . urlencode('http://www.mediatheque-numerique.com/films/entre-les-murs') + .'&referer=http%3A%2F%2Fmymediatheque.com', $this->_arte_vod_link->url()); } }