diff --git a/application/modules/opac/views/scripts/auth/boite-login.phtml b/application/modules/opac/views/scripts/auth/boite-login.phtml index 551cb06a023febc74a90292afc81a2a280162152..470e7a09367eeb8fc62ef0a4bbbe40bc40466e47 100644 --- a/application/modules/opac/views/scripts/auth/boite-login.phtml +++ b/application/modules/opac/views/scripts/auth/boite-login.phtml @@ -1,8 +1,13 @@ <div class="form"> <?php - if($user = Class_Users::getLoader()->getIdentity()) { + if($user = Class_Users::getIdentity()) { echo sprintf("<div class='welcome'>%s %s </div>", $this->preferences['message_connecte'], $user->getNomAff()); + if ($user->hasIdabon()){ + if(!$user->isAbonnementValid()) + echo $this->tag('p','Abonnement expiré - Merci de contacter la médiathèque'); + } + echo sprintf('<a href="%s" target="_parent" class="account-link">%s</a>', $this->url(['controller'=>'abonne', 'action'=>'fiche', 'id_profil'=>$this->preferences['profil_redirect'] > 0 ? $this->preferences['profil_redirect'] : Class_Profil::getCurrentProfil()->getId()],null,true), $this->_($this->preferences['lien_compte'])); diff --git a/tests/application/modules/opac/controllers/AuthControllerTest.php b/tests/application/modules/opac/controllers/AuthControllerTest.php index 77853dba3e8bef2091effe52c6f1ac3b25ca563d..dd5f5b52b4db8b10a5c486b69f4a9535b74657e5 100644 --- a/tests/application/modules/opac/controllers/AuthControllerTest.php +++ b/tests/application/modules/opac/controllers/AuthControllerTest.php @@ -556,6 +556,12 @@ class AuthControllerAdminIsLoggedTest extends PortailWithOneLoginModuleTestCase $this->assertQueryContentContains('#boite_login .welcome', 'Bienvenue sysadm',$this->_response->getBody()); } + + /** @test */ + public function shouldNotDisplayExpiredSubscription() { + $this->assertNotXPath('//div[@class="boite login"]//p'); + } + public function testLinkSeDeconnecter() { $this->assertXPath('//div[@id="boite_login"]//a[contains(@href, "auth/logout")]',