]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Merge pull request #2620 from wallabag/fix-password-layout
authorJeremy Benoist <j0k3r@users.noreply.github.com>
Wed, 23 Nov 2016 08:53:18 +0000 (09:53 +0100)
committerGitHub <noreply@github.com>
Wed, 23 Nov 2016 08:53:18 +0000 (09:53 +0100)
Fix password layout

17 files changed:
.travis.yml
app/DoctrineMigrations/Version20161122203647.php [new file with mode: 0644]
app/Resources/FOSUserBundle/translations/FOSUserBundle.da.yml [deleted file]
app/Resources/FOSUserBundle/translations/FOSUserBundle.de.yml [deleted file]
app/Resources/FOSUserBundle/translations/FOSUserBundle.es.yml [deleted file]
app/Resources/FOSUserBundle/translations/FOSUserBundle.fr.yml [deleted file]
app/Resources/FOSUserBundle/translations/FOSUserBundle.oc.yml [deleted file]
app/Resources/FOSUserBundle/translations/FOSUserBundle.pl.yml [deleted file]
app/Resources/FOSUserBundle/translations/FOSUserBundle.pt.yml [deleted file]
app/config/config.yml
composer.json
docs/de/developer/translate.rst
docs/en/developer/translate.rst
docs/fr/developer/translate.rst
src/Wallabag/UserBundle/Repository/UserRepository.php
src/Wallabag/UserBundle/Resources/views/Resetting/check_email.html.twig [moved from src/Wallabag/UserBundle/Resources/views/Resetting/checkEmail.html.twig with 71% similarity]
tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php

index a8f6a74416b3ea09cec36717d810b098e8380803..bffa0704dd58d95011f6b475a984848762a11aab 100644 (file)
@@ -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;
diff --git a/app/DoctrineMigrations/Version20161122203647.php b/app/DoctrineMigrations/Version20161122203647.php
new file mode 100644 (file)
index 0000000..ea2703b
--- /dev/null
@@ -0,0 +1,57 @@
+<?php
+
+namespace Application\Migrations;
+
+use Doctrine\DBAL\Migrations\AbstractMigration;
+use Doctrine\DBAL\Schema\Schema;
+use Symfony\Component\DependencyInjection\ContainerAwareInterface;
+use Symfony\Component\DependencyInjection\ContainerInterface;
+
+/**
+ * Methods and properties removed from `FOS\UserBundle\Model\User`
+ *
+ * - `$expired`
+ * - `$credentialsExpired`
+ * - `setExpired()` (use `setExpiresAt(\DateTime::now()` instead)
+ * - `setCredentialsExpired()` (use `setCredentialsExpireAt(\DateTime::now()` instead)
+ *
+ * You need to drop the fields `expired` and `credentials_expired` from your database
+ * schema, because they aren't mapped anymore.
+ */
+class Version20161122203647 extends AbstractMigration implements ContainerAwareInterface
+{
+    /**
+     * @var ContainerInterface
+     */
+    private $container;
+
+    public function setContainer(ContainerInterface $container = null)
+    {
+        $this->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');
+    }
+}
diff --git a/app/Resources/FOSUserBundle/translations/FOSUserBundle.da.yml b/app/Resources/FOSUserBundle/translations/FOSUserBundle.da.yml
deleted file mode 100644 (file)
index 015989e..0000000
+++ /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 (file)
index 944a0d4..0000000
+++ /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 (file)
index 968eb24..0000000
+++ /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 (file)
index 1c5ea64..0000000
+++ /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 (file)
index b8a7517..0000000
+++ /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 (file)
index 7e0a249..0000000
+++ /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 (file)
index 85eadfd..0000000
+++ /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."
index 487e934bcd0ab1262ff748fc4c9780636e17b503..5f939ab5d622345fa2319a68d24046cc959c230b 100644 (file)
@@ -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
index e2aeb424cf59aa2d71322a443f9499abe9adc618..a5ef95296ad6c202fb1e26d011db566c83362f0f 100644 (file)
@@ -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",
@@ -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",
index 50e136eac689d7ff96b35770acdf9986718e507d..10544e31c3672d9be6241bc1338b6e937bcceb7d 100644 (file)
@@ -20,7 +20,7 @@ der ISO 639-1 Code deiner Sprache ist (`siehe Wikipedia <https://en.wikipedia.or
 Andere Dateien zum Übersetzen:
 
 - https://github.com/wallabag/wallabag/tree/master/app/Resources/CraueConfigBundle/translations.
-- https://github.com/wallabag/wallabag/tree/master/app/Resources/FOSUserBundle/translations.
+- https://github.com/wallabag/wallabag/tree/master/src/Wallabag/UserBundle/Resources/translations.
 
 Du musst die ``THE_TRANSLATION_FILE.CODE.yml`` Dateien erstellen.
 
index d412d3e9a02b14ff3a9edb6d112645340cb964c5..1e5d500904e1664b5172f32be5e37f679324bd81 100644 (file)
@@ -20,7 +20,7 @@ is the ISO 639-1 code of your language (`see wikipedia <https://en.wikipedia.org
 Other files to translate:
 
 - https://github.com/wallabag/wallabag/tree/master/app/Resources/CraueConfigBundle/translations.
-- https://github.com/wallabag/wallabag/tree/master/app/Resources/FOSUserBundle/translations.
+- https://github.com/wallabag/wallabag/tree/master/src/Wallabag/UserBundle/Resources/translations.
 
 You have to create ``THE_TRANSLATION_FILE.CODE.yml`` files.
 
index 902c29ad3acf94ae27869359d3a0635d1e40145d..870d1c20bb1ef7f90e4d773fb51f51e023526fb3 100644 (file)
@@ -21,7 +21,7 @@ où CODE est le code ISO 639-1 de votre langue (`cf wikipedia <https://fr.wikipe
 Autres fichiers à traduire :
 
 - https://github.com/wallabag/wallabag/tree/master/app/Resources/CraueConfigBundle/translations.
-- https://github.com/wallabag/wallabag/tree/master/app/Resources/FOSUserBundle/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``.
 
index 445edb3c1077cb2826e2937cb7fccdff2ae4e2be..f913f52dd5beaf0fed96d38c940d230a98be07ba 100644 (file)
@@ -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();
     }
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 66cbdc28a3812a74af26e4370a2170b8f23b1fee..e9d46dcc8ae7105cb1410455895f6d0447ab018e 100644 (file)
@@ -5,7 +5,7 @@
 {% block fos_user_content %}
 <div class="card-content">
     <div class="row">
-        {{ 'resetting.check_email'|trans({'%email%': email}) }}
+        <p>{{ 'resetting.check_email'|trans({'%tokenLifetime%': tokenLifetime}) }}</p>
     </div>
 </div>
 {% endblock fos_user_content %}
index 9bbc5960038c28e35c8823a082226c0cbae728ea..a28c3b6bb7be53c8baae35d35822c217a371ad76 100644 (file)
@@ -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();