mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 15:33:15 +00:00
Merge pull request #1274 from nlegoff/fix-gh-1271
[3.9] Fix #1271 Can not add user trough validation process
This commit is contained in:
@@ -509,17 +509,14 @@ class Push implements ControllerProviderInterface
|
||||
$user = null;
|
||||
$email = $request->request->get('email');
|
||||
|
||||
try {
|
||||
$user = $app['repo.users']->findByEmail($email);
|
||||
|
||||
if (null !== $user = $app['repo.users']->findByEmail($email)) {
|
||||
$result['message'] = $app->trans('User already exists');
|
||||
$result['success'] = true;
|
||||
$result['user'] = $userFormatter($user);
|
||||
} catch (\Exception $e) {
|
||||
|
||||
return $app->json($result);
|
||||
}
|
||||
|
||||
if (!$user instanceof User) {
|
||||
try {
|
||||
$password = $app['random.medium']->generateString(128);
|
||||
|
||||
@@ -544,7 +541,6 @@ class Push implements ControllerProviderInterface
|
||||
} catch (\Exception $e) {
|
||||
$result['message'] = $app->trans('Error while creating user');
|
||||
}
|
||||
}
|
||||
|
||||
return $app->json($result);
|
||||
})->bind('prod_push_do_add_user');
|
||||
|
Reference in New Issue
Block a user