Commit 63ab4ca9 authored by Ghislain Loas's avatar Ghislain Loas

hotline #71669 fix tests failures

parent 661606fe
......@@ -798,10 +798,8 @@ class Auth_Strategy_Cas_Abstract extends Auth_Strategy_Abstract{
public function redirectMusicme() {
if (strpos($this->controller->getCasServerUrl(),'musicme') !== false) {
$module_menu = Class_DigitalResource::getInstance()->getModuleMenuFor('Musicme');
return $module_menu->getDynamiqueUrl();
}
if (strpos($this->controller->getCasServerUrl(),'musicme') !== false)
return Musicme_Config::getInstance()->getSsoUrl(Class_Users::getIdentity());
return false;
}
......
......@@ -62,10 +62,16 @@ class LaSourisQuiRaconte_Config extends Class_DigitalResource_Config {
'controller' => 'auth',
'action' => 'validate',
'ticket' => (new Class_CasTicket())->getTicketForCurrentUser()]);
return static::LSQR_URL . '/espaces/bokeh_verif.php?url_controle=' . $url;
}
public function getAlbumSsoUrl($user, $album) {
return $this->getSsoUrl($user) . '&redirect_id=' . $album->getIdOrigine();
}
public function getExportUrl() {
return static::LSQR_URL . '/espaces/export_bokeh.php?token=bokeh_export';
}
......
......@@ -20,8 +20,4 @@
*/
class LaSourisQuiRaconte_ModuleMenu extends Class_DigitalResource_ModuleMenu {
public function getAlbumUrl($album, $user) {
return $this->getDynamiqueUrl($user) . '&redirect_id=' . $album->getIdOrigine();
}
}
\ No newline at end of file
class LaSourisQuiRaconte_ModuleMenu extends Class_DigitalResource_ModuleMenu {}
\ No newline at end of file
......@@ -64,6 +64,16 @@ class Musicme_Config extends Class_DigitalResource_Config {
}
public function getAlbumSsoUrl($user, $album) {
$sso_url = explode('?', $this->getSsoUrl($user));
return str_replace('http://www.musicme.com',
$sso_url[0],
str_replace('"','%22',$album->getExternalUri()))
. '?' . (isset($sso_url[1]) ? $sso_url[1] : '');
}
public function isEnabled() {
return '' != $this->getAdminVar('BIB_ID');
}
......
......@@ -260,7 +260,8 @@ class CasServerControllerMusicmeValidateActionTest extends AbstractControllerTes
public function musicmeUrlShouldContainsTicket0a1b2c3d() {
$expected_ticket = 'ST-'.md5(Zend_Session::getId().'1');
$musicme = Class_DigitalResource::getInstance()->getModuleMenuFor('Musicme');
$this->assertEquals('http://linkmusicme.com?iduser=tom&ticket='.$expected_ticket.'&MediaLibraryID=QUEST&service=http%3A%2F%2Flinkmusicme.com%3Fiduser%3Dtom%26ticket%3D'.$expected_ticket.'%26MediaLibraryID%3DQUEST', Class_DigitalResource::getInstance()->getModuleMenuFor('Musicme')->getDynamiqueUrl());
$this->assertEquals('http://linkmusicme.com?iduser=tom&ticket='.$expected_ticket.'&MediaLibraryID=QUEST&service=http%3A%2F%2Flinkmusicme.com%3Fiduser%3Dtom%26ticket%3D'.$expected_ticket.'%26MediaLibraryID%3DQUEST',
Musicme_Config::getInstance()->getSsoUrl(Class_Users::getIdentity()));
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment