diff --git a/templates/web/account/access.html.twig b/templates/web/account/access.html.twig index 6419420887..96a2d7bf7c 100644 --- a/templates/web/account/access.html.twig +++ b/templates/web/account/access.html.twig @@ -28,7 +28,7 @@ {{ "Allowed access to the following collections" | trans }} - {% for baseId, base in baseInfo["registrations"]["by-type"]["accepted"] %} + {% for base in baseInfo["registrations"]["by-type"]["accepted"] %} @@ -51,7 +51,7 @@ {{ "Rejected access to the following collections" | trans }} - {% for baseId, base in baseInfo["registrations"]["by-type"]["rejected"] %} + {% for base in baseInfo["registrations"]["by-type"]["rejected"] %} @@ -74,7 +74,7 @@ {{ "Pending access to the following collections" | trans }} - {% for baseId, base in baseInfo["registrations"]["by-type"]["pending"] %} + {% for base in baseInfo["registrations"]["by-type"]["pending"] %} {{ base["coll-name"] }} @@ -95,7 +95,7 @@ {{ "Temporary access to the following collections" | trans }} - {% for baseId, base in baseInfo["registrations"]["by-type"]["in-time"] %} + {% for base in baseInfo["registrations"]["by-type"]["in-time"] %} {{ base["coll-name"] }} @@ -116,7 +116,7 @@ {{ "Outdated access to the following collections" | trans }} - {% for baseId, base in baseInfo["registrations"]["by-type"]["out-dated"] %} + {% for base in baseInfo["registrations"]["by-type"]["out-dated"] %} {{ base["coll-name"] }} @@ -137,7 +137,7 @@ {{ "Suspended access to the following collections" | trans }} - {% for baseId, base in baseInfo["registrations"]["by-type"]["inactive"] %} + {% for base in baseInfo["registrations"]["by-type"]["inactive"] %} {{ base["coll-name"] }} @@ -167,7 +167,7 @@
{{ TOU['value'] }}
{% endif %} - {% for baseId, collInfo in baseInfo["config"]["collections"] if (collInfo['registration'] is none and collInfo['can-register']) %} + {% for collInfo in baseInfo["config"]["collections"] if (collInfo['registration'] is none and collInfo['can-register']) %} {% if collInfo["cgu"] is not none %} {{ "login::register: L\'acces aux bases ci-dessous implique l\'acceptation des Conditions Generales d\'Utilisation (CGU) suivantes" | trans }} diff --git a/tests/Alchemy/Tests/Phrasea/Controller/Root/AccountTest.php b/tests/Alchemy/Tests/Phrasea/Controller/Root/AccountTest.php index bca05c83ce..562b84bc73 100644 --- a/tests/Alchemy/Tests/Phrasea/Controller/Root/AccountTest.php +++ b/tests/Alchemy/Tests/Phrasea/Controller/Root/AccountTest.php @@ -52,12 +52,66 @@ class AccountTest extends \PhraseanetAuthenticatedWebTestCase [ 'registrations' => [ 'by-type' => [ - 'inactive' => [new Registration()], - 'accepted' => [new Registration()], - 'in-time' => [new Registration()], - 'out-dated' => [new Registration()], - 'pending' => [new Registration()], - 'rejected' => [new Registration()], + 'inactive' => [[ + 'base-id' => '1', + 'db-name' => 'db_test', + 'active' => false, + 'time-limited' => false, + 'in-time' => false, + 'registration' => null, + 'coll-name' => 'BIBOO_INACTIVE', + 'type' => 'inactive', + ]], + 'accepted' => [[ + 'base-id' => '2', + 'db-name' => 'db_test', + 'active' => true, + 'time-limited' => false, + 'in-time' => false, + 'registration' => null, + 'coll-name' => 'BIBOO_ACCEPTED', + 'type' => 'accepted', + ]], + 'in-time' => [[ + 'base-id' => '3', + 'db-name' => 'db_test', + 'active' => true, + 'time-limited' => false, + 'in-time' => false, + 'registration' => null, + 'coll-name' => 'BIBOO_INTIME', + 'type' => 'in-time', + ]], + 'out-dated' => [[ + 'base-id' => '4', + 'db-name' => 'db_test', + 'active' => true, + 'time-limited' => false, + 'in-time' => false, + 'registration' => null, + 'coll-name' => 'BIBOO_OUTDATED', + 'type' => 'out-dated', + ]], + 'pending' => [[ + 'base-id' => '5', + 'db-name' => 'db_test', + 'active' => true, + 'time-limited' => false, + 'in-time' => false, + 'registration' => null, + 'coll-name' => 'BIBOO_PENDING', + 'type' => 'pending', + ]], + 'rejected' => [[ + 'base-id' => '6', + 'db-name' => 'db_test', + 'active' => true, + 'time-limited' => false, + 'in-time' => false, + 'registration' => null, + 'coll-name' => 'BIBOO_REJECTED', + 'type' => 'rejected', + ]], ], 'by-collection' => [] ], diff --git a/tests/Alchemy/Tests/Phrasea/Controller/Root/LoginTest.php b/tests/Alchemy/Tests/Phrasea/Controller/Root/LoginTest.php index 44a918f0e8..ef2b711a02 100644 --- a/tests/Alchemy/Tests/Phrasea/Controller/Root/LoginTest.php +++ b/tests/Alchemy/Tests/Phrasea/Controller/Root/LoginTest.php @@ -1032,7 +1032,7 @@ class LoginTest extends \PhraseanetAuthenticatedWebTestCase } self::$DI['client']->request('POST', '/login/register-classic/', $parameters); - $this->assertTrue(self::$DI['client']->getResponse()->isRedirect()); + $this->assertTrue(self::$DI['client']->getResponse()->isRedirect(),self::$DI['client']->getResponse()->getContent()); if (null === $user = self::$DI['app']['repo.users']->findByEmail($parameters['email'])) { $this->fail('User not created'); @@ -1102,7 +1102,7 @@ class LoginTest extends \PhraseanetAuthenticatedWebTestCase if (null === $user = self::$DI['app']['repo.users']->findByEmail($parameters['email'])) { $this->fail('User not created'); } - $this->assertTrue(self::$DI['client']->getResponse()->isRedirect()); + $this->assertTrue(self::$DI['client']->getResponse()->isRedirect(),self::$DI['client']->getResponse()->getContent()); $this->assertGreaterThan(0, $emails['Alchemy\Phrasea\Notification\Mail\MailInfoUserRegistered']); $this->assertEquals(1, $emails['Alchemy\Phrasea\Notification\Mail\MailRequestEmailConfirmation']); $this->assertFlashMessagePopulated(self::$DI['app'], 'info', 1);