summaryrefslogtreecommitdiffstats
path: root/settings/ajax
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2013-10-22 18:09:40 +0200
committerVincent Petry <pvince81@owncloud.com>2013-10-22 18:10:29 +0200
commit00f4928866bfdf824e5c9d4cab248646442bc518 (patch)
tree7c3d470935a25ae24d666d40729fbcc488efa215 /settings/ajax
parentcadd71ec8a02fc5619a9347109f9e588e13b3e3b (diff)
downloadnextcloud-server-00f4928866bfdf824e5c9d4cab248646442bc518.tar.gz
nextcloud-server-00f4928866bfdf824e5c9d4cab248646442bc518.zip
Added warning notification when user home already exists
When creating a user and the home already exists in the data dir, a warning notification will be displayed. Fixes #5161
Diffstat (limited to 'settings/ajax')
-rw-r--r--settings/ajax/createuser.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/settings/ajax/createuser.php b/settings/ajax/createuser.php
index ccc2a5d402e..915fcaf2d42 100644
--- a/settings/ajax/createuser.php
+++ b/settings/ajax/createuser.php
@@ -38,8 +38,15 @@ try {
}
OC_Group::addToGroup( $username, $i );
}
+
+ // check whether the user's files home exists
+ $userDirectory = OC_User::getHome($username) . '/files/';
+ $homeExists = file_exists($userDirectory);
+
OC_JSON::success(array("data" =>
array(
+ // returns whether the home already existed
+ "homeExists" => $homeExists,
"username" => $username,
"groups" => OC_Group::getUserGroups( $username ))));
} catch (Exception $exception) {