From 5066c3e066ad67788bdf6edac9e80cab614a2d4d Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Mon, 21 Nov 2016 15:12:11 +0100 Subject: [PATCH] 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();