Commit 6938aeba authored by Henri-Damien LAURENT's avatar Henri-Damien LAURENT

hotline#109177 : Intonation Theme : Skilleos redirection was broken

parent d946021e
Pipeline #10004 passed with stage
in 44 minutes and 58 seconds
- ticket #109177 : Pb lien Skilléos (sso + bootstrap)
\ No newline at end of file
......@@ -97,14 +97,16 @@ abstract class IntonationLoginRenderAbstract {
foreach($this->_settings->toArray() as $key => $value)
if (is_string($value) || is_int($value))
$options [Storm_Inflector::underscorize($key)] = $value;
$form = ZendAfi_Form_Login::newWithOptions(['data' => $options]);
$action = $this->_settings->getClearAction()
? ''
: $this->_view->url(['controller' => 'auth',
'action' => 'login',
'redirect' => Class_Url::absolute()], null, true);
'redirect' => (isset($options['redirect_url']))
? $options['redirect_url']
: Class_Url::absolute()]
, null, true);
$form
->setAction($action);
......
......@@ -24,7 +24,12 @@ class Intonation_View_Widget_Login extends ZendAfi_View_Helper_BaseHelper {
public function Widget_Login($settings) {
$preferences = $settings->getPreferences();
$preferences[Class_Template::current()->withNameSpace('form_style')] = '';
$login = (new Intonation_Library_Widget_Login_View($this->view->id_module, $preferences))
$login = (new Intonation_Library_Widget_Login_View($this->view->id_module,
array_merge(
$preferences,
($settings->getFormOptions() && isset($settings->getFormOptions()['data']))
? $settings->getFormOptions()['data']
:[])))
->setView($this->view);
$login->getHtml();
return $login->getContent();
......
......@@ -4867,6 +4867,28 @@ class TemplatesDispatchIntonationAuthLoginTest extends TemplatesIntonationTestCa
class TemplatesDispatchIntonationAuthLoginWithRedirectTest extends TemplatesIntonationTestCase {
public function setUp() {
parent::setUp();
ZendAfi_Auth::getInstance()->clearIdentity();
$this->dispatch('/opac/auth/login/id_profil/72?redirect='.urlencode('http://mybib/modules/skilleos'));
}
/** @test */
public function formActionShouldContainsRedirectUrlMyBib() {
$this->assertXPath('//form[contains(@action, "/auth/login/redirect/'.urlencode("http://mybib/modules/skilleos").'")]', $this->_response->getBody());
}
/** @test */
public function inputTypeHiddenShouldContainsRedirectUrlMyBib() {
$this->assertXPath('//input[@type="hidden"][@name="redirect"][@value="http://mybib/modules/skilleos"]', $this->_response->getBody());
}
}
class TemplatesDispatchNewsletterWidgetTest extends TemplatesIntonationTestCase {
/** @test */
......
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