aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2015-09-26 19:35:00 +0200
committerJeremy Benoist <jeremy.benoist@gmail.com>2015-09-26 19:45:14 +0200
commit0f30f48b937eddc9b1130049403a5ff09e1041c0 (patch)
treee44a1bc1cb9c61bb5b75cf50a0d4036efb55b274
parent57162494557c5eac938a7d6800ac1b112f73efc9 (diff)
downloadwallabag-0f30f48b937eddc9b1130049403a5ff09e1041c0.tar.gz
wallabag-0f30f48b937eddc9b1130049403a5ff09e1041c0.tar.zst
wallabag-0f30f48b937eddc9b1130049403a5ff09e1041c0.zip
Enabled created user from Config
By default, creating user with FOSUser are disabled by default. Fix #1423
-rw-r--r--src/Wallabag/CoreBundle/Controller/ConfigController.php2
-rw-r--r--src/Wallabag/CoreBundle/Tests/Controller/ConfigControllerTest.php8
2 files changed, 10 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Controller/ConfigController.php b/src/Wallabag/CoreBundle/Controller/ConfigController.php
index 73484d86..5affdee8 100644
--- a/src/Wallabag/CoreBundle/Controller/ConfigController.php
+++ b/src/Wallabag/CoreBundle/Controller/ConfigController.php
@@ -98,6 +98,8 @@ class ConfigController extends Controller
98 98
99 // handle adding new user 99 // handle adding new user
100 $newUser = new User(); 100 $newUser = new User();
101 // enable created user by default
102 $newUser->setEnabled(true);
101 $newUserForm = $this->createForm(new NewUserType(), $newUser, array('validation_groups' => array('Profile'))); 103 $newUserForm = $this->createForm(new NewUserType(), $newUser, array('validation_groups' => array('Profile')));
102 $newUserForm->handleRequest($request); 104 $newUserForm->handleRequest($request);
103 105
diff --git a/src/Wallabag/CoreBundle/Tests/Controller/ConfigControllerTest.php b/src/Wallabag/CoreBundle/Tests/Controller/ConfigControllerTest.php
index 116eec60..3407fc5e 100644
--- a/src/Wallabag/CoreBundle/Tests/Controller/ConfigControllerTest.php
+++ b/src/Wallabag/CoreBundle/Tests/Controller/ConfigControllerTest.php
@@ -337,6 +337,14 @@ class ConfigControllerTest extends WallabagCoreTestCase
337 337
338 $this->assertGreaterThan(1, $alert = $crawler->filter('div.messages.success')->extract(array('_text'))); 338 $this->assertGreaterThan(1, $alert = $crawler->filter('div.messages.success')->extract(array('_text')));
339 $this->assertContains('User "wallace" added', $alert[0]); 339 $this->assertContains('User "wallace" added', $alert[0]);
340
341 $em = $client->getContainer()->get('doctrine.orm.entity_manager');
342 $user = $em
343 ->getRepository('WallabagCoreBundle:User')
344 ->findOneByUsername('wallace');
345
346 $this->assertTrue(false !== $user);
347 $this->assertTrue($user->isEnabled());
340 } 348 }
341 349
342 public function testRssUpdateResetToken() 350 public function testRssUpdateResetToken()