]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Enabled created user from Config 1435/head
authorJeremy Benoist <jeremy.benoist@gmail.com>
Sat, 26 Sep 2015 17:35:00 +0000 (19:35 +0200)
committerJeremy Benoist <jeremy.benoist@gmail.com>
Sat, 26 Sep 2015 17:45:14 +0000 (19:45 +0200)
By default, creating user with FOSUser are disabled by default.

Fix #1423

src/Wallabag/CoreBundle/Controller/ConfigController.php
src/Wallabag/CoreBundle/Tests/Controller/ConfigControllerTest.php

index 73484d86c2f0949a01649a6954cd8985e1893677..5affdee894c66cd2c9afa342f685266b228e4734 100644 (file)
@@ -98,6 +98,8 @@ class ConfigController extends Controller
 
         // handle adding new user
         $newUser = new User();
+        // enable created user by default
+        $newUser->setEnabled(true);
         $newUserForm = $this->createForm(new NewUserType(), $newUser, array('validation_groups' => array('Profile')));
         $newUserForm->handleRequest($request);
 
index 116eec602f241c9f67aaf5fb06b945924fde5277..3407fc5e05ceec8f821b44b1ec616ca8c122b2e0 100644 (file)
@@ -337,6 +337,14 @@ class ConfigControllerTest extends WallabagCoreTestCase
 
         $this->assertGreaterThan(1, $alert = $crawler->filter('div.messages.success')->extract(array('_text')));
         $this->assertContains('User "wallace" added', $alert[0]);
+
+        $em = $client->getContainer()->get('doctrine.orm.entity_manager');
+        $user = $em
+            ->getRepository('WallabagCoreBundle:User')
+            ->findOneByUsername('wallace');
+
+        $this->assertTrue(false !== $user);
+        $this->assertTrue($user->isEnabled());
     }
 
     public function testRssUpdateResetToken()