Commit da4ad1c0 authored by Robin Appelman's avatar Robin Appelman
Browse files

show a better error message when trying to create a user that already exists

parent 2a8c3798
......@@ -286,6 +286,15 @@ class UsersController extends Controller {
}
}
if ($this->userManager->userExists($username)) {
return new DataResponse(
array(
'message' => (string)$this->l10n->t('A user with that name already exists.')
),
Http::STATUS_CONFLICT
);
}
try {
$user = $this->userManager->createUser($username, $password);
} catch (\Exception $exception) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment