From 9624b3adfaa51ff1a911b63996a5336358dd1a62 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sun, 20 Nov 2016 20:06:26 +0100 Subject: [PATCH 1/7] =?UTF-8?q?These=20files=20aren=E2=80=99t=20used=20any?= =?UTF-8?q?more?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Translation were moved to the global one --- app/Resources/FOSUserBundle/translations/FOSUserBundle.da.yml | 2 -- app/Resources/FOSUserBundle/translations/FOSUserBundle.de.yml | 2 -- app/Resources/FOSUserBundle/translations/FOSUserBundle.es.yml | 2 -- app/Resources/FOSUserBundle/translations/FOSUserBundle.fr.yml | 2 -- app/Resources/FOSUserBundle/translations/FOSUserBundle.oc.yml | 2 -- app/Resources/FOSUserBundle/translations/FOSUserBundle.pl.yml | 2 -- app/Resources/FOSUserBundle/translations/FOSUserBundle.pt.yml | 2 -- docs/de/developer/translate.rst | 2 +- docs/en/developer/translate.rst | 2 +- docs/fr/developer/translate.rst | 3 ++- 10 files changed, 4 insertions(+), 17 deletions(-) delete mode 100644 app/Resources/FOSUserBundle/translations/FOSUserBundle.da.yml delete mode 100644 app/Resources/FOSUserBundle/translations/FOSUserBundle.de.yml delete mode 100644 app/Resources/FOSUserBundle/translations/FOSUserBundle.es.yml delete mode 100644 app/Resources/FOSUserBundle/translations/FOSUserBundle.fr.yml delete mode 100644 app/Resources/FOSUserBundle/translations/FOSUserBundle.oc.yml delete mode 100644 app/Resources/FOSUserBundle/translations/FOSUserBundle.pl.yml delete mode 100644 app/Resources/FOSUserBundle/translations/FOSUserBundle.pt.yml diff --git a/app/Resources/FOSUserBundle/translations/FOSUserBundle.da.yml b/app/Resources/FOSUserBundle/translations/FOSUserBundle.da.yml deleted file mode 100644 index 015989ef1..000000000 --- a/app/Resources/FOSUserBundle/translations/FOSUserBundle.da.yml +++ /dev/null @@ -1,2 +0,0 @@ -Login: "Log ind" -Enter your email address below and we'll send you password reset instructions.: "Indtast din emailadresse nedenfor, så sender vi dig instrukser til at nulstille din adgangskode." diff --git a/app/Resources/FOSUserBundle/translations/FOSUserBundle.de.yml b/app/Resources/FOSUserBundle/translations/FOSUserBundle.de.yml deleted file mode 100644 index 944a0d416..000000000 --- a/app/Resources/FOSUserBundle/translations/FOSUserBundle.de.yml +++ /dev/null @@ -1,2 +0,0 @@ -Login: "Anmelden" -Enter your email address below and we'll send you password reset instructions.: "Tippe deine E-Mail-Adresse unten ein und wir senden dir die Anweisungen, wie du dein Kennwort zurücksetzen kannst." diff --git a/app/Resources/FOSUserBundle/translations/FOSUserBundle.es.yml b/app/Resources/FOSUserBundle/translations/FOSUserBundle.es.yml deleted file mode 100644 index 968eb2416..000000000 --- a/app/Resources/FOSUserBundle/translations/FOSUserBundle.es.yml +++ /dev/null @@ -1,2 +0,0 @@ -Login: "Logearse" -Enter your email address below and we'll send you password reset instructions.: "Introduzca su dirección de email y le enviaremos las instrucciones para resetear su contraseña." diff --git a/app/Resources/FOSUserBundle/translations/FOSUserBundle.fr.yml b/app/Resources/FOSUserBundle/translations/FOSUserBundle.fr.yml deleted file mode 100644 index 1c5ea6400..000000000 --- a/app/Resources/FOSUserBundle/translations/FOSUserBundle.fr.yml +++ /dev/null @@ -1,2 +0,0 @@ -Login: "Se connecter" -Enter your email address below and we'll send you password reset instructions.: "Renseignez votre adresse courriel, nous vous enverrons les instructions pour réinitialiser votre mot de passe." diff --git a/app/Resources/FOSUserBundle/translations/FOSUserBundle.oc.yml b/app/Resources/FOSUserBundle/translations/FOSUserBundle.oc.yml deleted file mode 100644 index b8a751723..000000000 --- a/app/Resources/FOSUserBundle/translations/FOSUserBundle.oc.yml +++ /dev/null @@ -1,2 +0,0 @@ -Login: "Se connectar" -Enter your email address below and we'll send you password reset instructions.: "Picatz vòstra adreça de corrièl çai-jos, vos mandarem las instruccions per reïnicializar vòstre senhal." diff --git a/app/Resources/FOSUserBundle/translations/FOSUserBundle.pl.yml b/app/Resources/FOSUserBundle/translations/FOSUserBundle.pl.yml deleted file mode 100644 index 7e0a24904..000000000 --- a/app/Resources/FOSUserBundle/translations/FOSUserBundle.pl.yml +++ /dev/null @@ -1,2 +0,0 @@ -Login: "Logowanie" -Enter your email address below and we'll send you password reset instructions.: "Wpisz poniżej swój adres email, abyśmy mogli wysłać ci instrukcję resetowania hasła." diff --git a/app/Resources/FOSUserBundle/translations/FOSUserBundle.pt.yml b/app/Resources/FOSUserBundle/translations/FOSUserBundle.pt.yml deleted file mode 100644 index 85eadfd87..000000000 --- a/app/Resources/FOSUserBundle/translations/FOSUserBundle.pt.yml +++ /dev/null @@ -1,2 +0,0 @@ -Login: "Login" -Enter your email address below and we'll send you password reset instructions.: "Digite seu endereço de e-mail para enviarmos as instruções de recupeção de sua senha." diff --git a/docs/de/developer/translate.rst b/docs/de/developer/translate.rst index 50e136eac..10544e31c 100644 --- a/docs/de/developer/translate.rst +++ b/docs/de/developer/translate.rst @@ -20,7 +20,7 @@ der ISO 639-1 Code deiner Sprache ist (`siehe Wikipedia Date: Sun, 20 Nov 2016 20:07:47 +0100 Subject: [PATCH 2/7] Use the correct template MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When resetting the password, the overriden template we used wasn’t well spelled. And since we are using a locked version of FOSUser (on a custom commit), the translation of `resetting.check_email` is wrong in any language but english. --- .../Resetting/{checkEmail.html.twig => check_email.html.twig} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename src/Wallabag/UserBundle/Resources/views/Resetting/{checkEmail.html.twig => check_email.html.twig} (71%) diff --git a/src/Wallabag/UserBundle/Resources/views/Resetting/checkEmail.html.twig b/src/Wallabag/UserBundle/Resources/views/Resetting/check_email.html.twig similarity index 71% rename from src/Wallabag/UserBundle/Resources/views/Resetting/checkEmail.html.twig rename to src/Wallabag/UserBundle/Resources/views/Resetting/check_email.html.twig index 66cbdc28a..e9d46dcc8 100644 --- a/src/Wallabag/UserBundle/Resources/views/Resetting/checkEmail.html.twig +++ b/src/Wallabag/UserBundle/Resources/views/Resetting/check_email.html.twig @@ -5,7 +5,7 @@ {% block fos_user_content %}
- {{ 'resetting.check_email'|trans({'%email%': email}) }} +

{{ 'resetting.check_email'|trans({'%tokenLifetime%': tokenLifetime}) }}

{% endblock fos_user_content %} From 4da598c5df08f8a5e20c838df5de8c9e4efcb273 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sun, 20 Nov 2016 22:24:48 +0100 Subject: [PATCH 3/7] Fix Travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a8f6a7441..bffa0704d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -76,5 +76,5 @@ script: - if [[ $CS_FIXER = run ]]; then php bin/php-cs-fixer fix src/ --verbose --dry-run ; fi; - if [[ $VALIDATE_TRANSLATION_FILE = run ]]; then php bin/console lint:yaml src/Wallabag/CoreBundle/Resources/translations -v ; fi; - if [[ $VALIDATE_TRANSLATION_FILE = run ]]; then php bin/console lint:yaml app/Resources/CraueConfigBundle/translations -v ; fi; - - if [[ $VALIDATE_TRANSLATION_FILE = run ]]; then php bin/console lint:yaml app/Resources/FOSUserBundle/translations -v ; fi; + - if [[ $VALIDATE_TRANSLATION_FILE = run ]]; then php bin/console lint:yaml src/Wallabag/UserBundle/Resources/translations -v ; fi; - if [[ $ASSETS = build ]]; then ./node_modules/grunt-cli/bin/grunt tests; fi; From 5066c3e066ad67788bdf6edac9e80cab614a2d4d Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Mon, 21 Nov 2016 15:12:11 +0100 Subject: [PATCH 4/7] Re-use FOSUser master branch --- app/config/config.yml | 5 +++-- composer.json | 2 +- src/Wallabag/UserBundle/Repository/UserRepository.php | 2 +- .../CoreBundle/Controller/ConfigControllerTest.php | 8 ++++---- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/app/config/config.yml b/app/config/config.yml index 487e934bc..5f939ab5d 100644 --- a/app/config/config.yml +++ b/app/config/config.yml @@ -210,6 +210,7 @@ fos_user: from_email: address: "%from_email%" sender_name: wallabag + fos_oauth_server: db_driver: orm client_class: Wallabag\ApiBundle\Entity\Client @@ -217,10 +218,10 @@ fos_oauth_server: refresh_token_class: Wallabag\ApiBundle\Entity\RefreshToken auth_code_class: Wallabag\ApiBundle\Entity\AuthCode service: - user_provider: fos_user.user_manager + user_provider: fos_user.user_provider.username_email options: refresh_token_lifetime: 1209600 - + scheb_two_factor: trusted_computer: enabled: true diff --git a/composer.json b/composer.json index e2aeb424c..52e3235fd 100644 --- a/composer.json +++ b/composer.json @@ -65,7 +65,7 @@ "liip/theme-bundle": "~1.1", "lexik/form-filter-bundle": "~5.0", "j0k3r/graby": "~1.0", - "friendsofsymfony/user-bundle": "dev-master#e168ed64629d034cb9cbbffb9d4350f62ef04fab as 2.0.x-dev", + "friendsofsymfony/user-bundle": "2.0.x-dev", "friendsofsymfony/oauth-server-bundle": "^1.5", "stof/doctrine-extensions-bundle": "^1.2", "scheb/two-factor-bundle": "~2.0", diff --git a/src/Wallabag/UserBundle/Repository/UserRepository.php b/src/Wallabag/UserBundle/Repository/UserRepository.php index 445edb3c1..f913f52dd 100644 --- a/src/Wallabag/UserBundle/Repository/UserRepository.php +++ b/src/Wallabag/UserBundle/Repository/UserRepository.php @@ -48,7 +48,7 @@ class UserRepository extends EntityRepository { return $this->createQueryBuilder('u') ->select('count(u)') - ->andWhere('u.expired = false') + ->andWhere('u.enabled = true') ->getQuery() ->getSingleScalarResult(); } diff --git a/tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php b/tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php index 9bbc59600..a28c3b6bb 100644 --- a/tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php @@ -592,13 +592,13 @@ class ConfigControllerTest extends WallabagCoreTestCase $user = $em ->getRepository('WallabagUserBundle:User') ->findOneByUsername('empty'); - $user->setExpired(1); + $user->setEnabled(false); $em->persist($user); $user = $em ->getRepository('WallabagUserBundle:User') ->findOneByUsername('bob'); - $user->setExpired(1); + $user->setEnabled(false); $em->persist($user); $em->flush(); @@ -614,13 +614,13 @@ class ConfigControllerTest extends WallabagCoreTestCase $user = $em ->getRepository('WallabagUserBundle:User') ->findOneByUsername('empty'); - $user->setExpired(0); + $user->setEnabled(true); $em->persist($user); $user = $em ->getRepository('WallabagUserBundle:User') ->findOneByUsername('bob'); - $user->setExpired(0); + $user->setEnabled(true); $em->persist($user); $em->flush(); From ae741f998ed633996a4759cf04a549fa0d3fa90b Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Tue, 22 Nov 2016 20:29:41 +0100 Subject: [PATCH 5/7] Fix MonologBundle deprecation The Symfony\Bundle\MonologBundle\DependencyInjection\Compiler\DebugHandlerPass class is deprecated since version 2.12 and will be removed in 3.0. Use AddDebugLogProcessorPass in FrameworkBundle instead. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 52e3235fd..a5ef95296 100644 --- a/composer.json +++ b/composer.json @@ -49,7 +49,7 @@ "doctrine/doctrine-cache-bundle": "^1.2", "twig/extensions": "~1.0", "symfony/swiftmailer-bundle": "^2.3", - "symfony/monolog-bundle": "^2.8", + "symfony/monolog-bundle": "^3.0", "sensio/distribution-bundle": "^5.0", "sensio/framework-extra-bundle": "^3.0.2", "incenteev/composer-parameter-handler": "^2.0", From be2725db406310ca3e025f1d0d79f768804245a2 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Tue, 22 Nov 2016 20:54:00 +0100 Subject: [PATCH 6/7] Add migration for new FOSUser version --- .../Version20161122203647.php | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 app/DoctrineMigrations/Version20161122203647.php diff --git a/app/DoctrineMigrations/Version20161122203647.php b/app/DoctrineMigrations/Version20161122203647.php new file mode 100644 index 000000000..ea2703b6b --- /dev/null +++ b/app/DoctrineMigrations/Version20161122203647.php @@ -0,0 +1,57 @@ +container = $container; + } + + private function getTable($tableName) + { + return $this->container->getParameter('database_table_prefix') . $tableName; + } + + /** + * @param Schema $schema + */ + public function up(Schema $schema) + { + $this->abortIf($this->connection->getDatabasePlatform()->getName() === 'sqlite', 'This up migration can\'t be executed on SQLite databases, because SQLite don\'t support DROP COLUMN.'); + + $this->addSql('ALTER TABLE '.$this->getTable('user').' DROP expired'); + $this->addSql('ALTER TABLE '.$this->getTable('user').' DROP credentials_expired'); + } + + /** + * @param Schema $schema + */ + public function down(Schema $schema) + { + $this->addSql('ALTER TABLE '.$this->getTable('user').' ADD expired tinyint(1) NULL DEFAULT 0'); + $this->addSql('ALTER TABLE '.$this->getTable('user').' ADD credentials_expired tinyint(1) NULL DEFAULT 0'); + } +} From fcbf253b6bc0772adaf0d0e7cc51de50046cf64e Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Wed, 23 Nov 2016 09:20:00 +0100 Subject: [PATCH 7/7] Remove empty line --- docs/fr/developer/translate.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/fr/developer/translate.rst b/docs/fr/developer/translate.rst index 480258ae8..870d1c20b 100644 --- a/docs/fr/developer/translate.rst +++ b/docs/fr/developer/translate.rst @@ -23,7 +23,6 @@ Autres fichiers à traduire : - https://github.com/wallabag/wallabag/tree/master/app/Resources/CraueConfigBundle/translations. - https://github.com/wallabag/wallabag/tree/master/src/Wallabag/UserBundle/Resources/translations. - Vous devez créer les fichiers ``LE_FICHIER_DE_TRADUCTION.CODE.yml``. Fichier de configuration