mirror of
https://github.com/wallabag/wallabag.git
synced 2025-02-23 05:56:18 +00:00
Enabled created user from Config
By default, creating user with FOSUser are disabled by default. Fix #1423
This commit is contained in:
parent
5716249455
commit
0f30f48b93
2 changed files with 10 additions and 0 deletions
|
@ -98,6 +98,8 @@ class ConfigController extends Controller
|
||||||
|
|
||||||
// handle adding new user
|
// handle adding new user
|
||||||
$newUser = 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 = $this->createForm(new NewUserType(), $newUser, array('validation_groups' => array('Profile')));
|
||||||
$newUserForm->handleRequest($request);
|
$newUserForm->handleRequest($request);
|
||||||
|
|
||||||
|
|
|
@ -337,6 +337,14 @@ class ConfigControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$this->assertGreaterThan(1, $alert = $crawler->filter('div.messages.success')->extract(array('_text')));
|
$this->assertGreaterThan(1, $alert = $crawler->filter('div.messages.success')->extract(array('_text')));
|
||||||
$this->assertContains('User "wallace" added', $alert[0]);
|
$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()
|
public function testRssUpdateResetToken()
|
||||||
|
|
Loading…
Reference in a new issue