Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2015-03-20 06:24:50 +0300
committerMorris Jobke <hey@morrisjobke.de>2015-03-20 14:57:09 +0300
commit625cbc63a4fbfa46981d04f43523f3a895e3e088 (patch)
tree9c5976aa460cf522449ab4c3af7495a8848ef79d /settings
parent5720211f70c6435651bf48b7c58704a5e5cb4ba2 (diff)
show a better error message when trying to create a user that already exists
Diffstat (limited to 'settings')
-rw-r--r--settings/controller/userscontroller.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/settings/controller/userscontroller.php b/settings/controller/userscontroller.php
index a20cbb4050a..0bae055a143 100644
--- a/settings/controller/userscontroller.php
+++ b/settings/controller/userscontroller.php
@@ -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) {