From 26ed0ba74b4eff61d675ea47296e47ff50309241 Mon Sep 17 00:00:00 2001 From: efalcy <efalcy@afi-sa.fr> Date: Thu, 5 Oct 2017 11:00:00 +0200 Subject: [PATCH] dev #65027 : replace img banner by img ressource --- library/digital_resources/Skilleos/Service/Parser.php | 2 +- .../Skilleos/controllers/AuthController.php | 7 +------ library/digital_resources/Skilleos/tests/SkilleosTest.php | 4 ++-- library/digital_resources/Skilleos/tests/results.json | 6 ++++++ 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/library/digital_resources/Skilleos/Service/Parser.php b/library/digital_resources/Skilleos/Service/Parser.php index 3037971d61a..5cc173f69e5 100644 --- a/library/digital_resources/Skilleos/Service/Parser.php +++ b/library/digital_resources/Skilleos/Service/Parser.php @@ -28,7 +28,7 @@ class Skilleos_Service_Parser extends Class_WebService_BibNumerique_RessourceNum ->setDescription($json->introduction.$json->description.$json->contenu_and_objectif); $this->_lessons = []; - $this->_posters[] = $json->banner->url; + $this->_posters[] = $json->ressource->url; $this->addAuthor($json->teacher->partner->name); diff --git a/library/digital_resources/Skilleos/controllers/AuthController.php b/library/digital_resources/Skilleos/controllers/AuthController.php index 71f26d2c7bc..8928c9500bd 100644 --- a/library/digital_resources/Skilleos/controllers/AuthController.php +++ b/library/digital_resources/Skilleos/controllers/AuthController.php @@ -25,13 +25,12 @@ class Skilleos_Plugin_AuthController extends Class_DigitalResource_Controller { public function servicevalidateAction() { - $service=$this->_request->getParam('service'); $ticket=$this->_request->getParam('ticket'); if (strlen($ticket)<1 || strlen($service)<1) { return $this->_helper->casFailureResponse('INVALID_REQUEST'); } - xdebug_break(); + if (!$user = (new Class_CasTicket())->userForTicket($ticket)) return $this->_helper->casFailureResponse('INVALID_TICKET',$ticket); @@ -39,10 +38,6 @@ class Skilleos_Plugin_AuthController extends Class_DigitalResource_Controller { 'mail' => $user->getMail(), 'givenName' => $user->getPrenom()]; return $this->_helper->casValidResponse($user, $ticket, $attributes); - - - - } } ?> \ No newline at end of file diff --git a/library/digital_resources/Skilleos/tests/SkilleosTest.php b/library/digital_resources/Skilleos/tests/SkilleosTest.php index cf328d3520e..13328d219de 100644 --- a/library/digital_resources/Skilleos/tests/SkilleosTest.php +++ b/library/digital_resources/Skilleos/tests/SkilleosTest.php @@ -217,11 +217,11 @@ abstract class SkilleosServiceTestCase extends AbstractControllerTestCase { ['Authorization' => "Bearer YTEzMDA1M2Q1ZGRmYmE0YjJkNWQ3MGY3ZGUyYTI3ZWJkMjBjOGI2NzIzMDIzMDc0MDAyYTE0NGJjMTRmMzkzMg"]) ->answers($results_json) ->whenCalled('open_url') - ->with('https://moncompte.skilleos.com/uploads/ressources/default/0001/10/thumb_9636_default_big.png') + ->with('https://moncompte.skilleos.com/uploads/ressources/default/0010/10/thumb_9636_default_big.png') ->answers(null) ->whenCalled('open_url') - ->with('https://moncompte.skilleos.com/uploads/ressources/default/0001/10/thumb_9653_default_big.png') + ->with('https://moncompte.skilleos.com/uploads/ressources/default/0001/11/thumb_9653_default_big.png') ->answers(null) ->beStrict(); diff --git a/library/digital_resources/Skilleos/tests/results.json b/library/digital_resources/Skilleos/tests/results.json index fbd7025cd4b..cbc8c9cdf78 100644 --- a/library/digital_resources/Skilleos/tests/results.json +++ b/library/digital_resources/Skilleos/tests/results.json @@ -1973,6 +1973,9 @@ "name": "Sport & Bien-\u00eatre", "id": 34 }, + "ressource": { + "url": "https:\/\/moncompte.skilleos.com\/uploads\/ressources\/default\/0001\/11\/thumb_9653_default_big.png" + }, "banner": { "url": "https:\/\/moncompte.skilleos.com\/uploads\/ressources\/default\/0001\/10\/thumb_9653_default_big.png", "size": 859858, @@ -3163,6 +3166,9 @@ "name": "Sport & Bien-\u00eatre", "id": 34 }, + "ressource": { + "url": "https:\/\/moncompte.skilleos.com\/uploads\/ressources\/default\/0010\/10\/thumb_9636_default_big.png" + }, "banner": { "url": "https:\/\/moncompte.skilleos.com\/uploads\/ressources\/default\/0001\/10\/thumb_9636_default_big.png", "size": 816200, -- GitLab