Skip to content
Snippets Groups Projects
Commit c0066a02 authored by Ghislain Loas's avatar Ghislain Loas
Browse files

Merge branch...

Merge branch 'hotline#130328_magasin_de_theme_boite_authentification_redirection_sur_autre_profil' into 'hotline'

hotline MT #130328 fix redirect to profile in login widget

See merge request !4031
parents abf95739 05141eed
Branches
Tags
1 merge request!4031hotline MT #130328 fix redirect to profile in login widget
Pipeline #13537 passed with stage
in 53 minutes and 15 seconds
- ticket #130328 : Magasin de thèmes : Correction dans la boite de connexion, le paramètre de redirection à la connexion est maintenant correctement pris en charge.
\ No newline at end of file
......@@ -103,9 +103,7 @@ abstract class IntonationLoginRenderAbstract {
? ''
: $this->_view->url(['controller' => 'auth',
'action' => 'login',
'redirect' => (isset($options['redirect_url']))
? $options['redirect_url']
: Class_Url::absolute()]);
'redirect' => $this->_redirectUrl($options)]);
$form
->setAction($action);
......@@ -122,6 +120,16 @@ abstract class IntonationLoginRenderAbstract {
}
protected function _redirectUrl($options) {
if ( isset($options['redirect_url']))
return $options['redirect_url'];
return ($profile_id = $this->_settings->getProfilRedirect())
? Class_Url::absolute(['id_profil' => $profile_id])
: Class_Url::absolute();
}
abstract function renderLogged();
......
......@@ -61,6 +61,7 @@ abstract class ChiliLoginWidgetTestCase extends Admin_AbstractControllerTestCase
->addWidget(Intonation_Library_Widget_Login_Definition::CODE,
Class_Profil::DIV_MAIN,
['authenticated_menu' => '4-' . $id_menu,
'profil_redirect' => 1,
'Chili_form_style' => 'toggle']);
$profile->assertSave();
......@@ -191,4 +192,23 @@ class ChiliLoginWidgetFrontTest extends ChiliLoginWidgetTestCase {
$this->assertNotXPath('//a[contains(@class, "nav-link")][contains(@href, "/abonne/cards")]//span[contains(@class, "badge_tag")]');
}
}
class ChiliLoginNotLoggedTest extends ChiliLoginWidgetTestCase {
public function setUp() {
parent::setUp();
ZendAfi_Auth::getInstance()->clearIdentity();
$this->dispatch('/index/index/id_profil/4');
}
/** @test */
public function formActionShouldContainsRedircetToFirstProfile() {
$this->assertXPath('//div//form[contains(@action, "/auth/login/id_profil/4/redirect/")][contains(@action, "%2Findex%2Findex%2Fid_profil%2F1")]', $this->_response->getBody());
}
}
\ No newline at end of file
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