summaryrefslogtreecommitdiffstats
path: root/settings
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2013-10-25 16:23:29 +0200
committerVincent Petry <pvince81@owncloud.com>2013-10-25 16:23:29 +0200
commit1ee4b680f63246c8ae5f3e647ba812ffe6ab57b3 (patch)
tree03a1f6005a0150eb7b9bdf5e139c85508c1c64c6 /settings
parent3fc232370e00df1d39638697daf8e8c1af8fe8dc (diff)
downloadnextcloud-server-1ee4b680f63246c8ae5f3e647ba812ffe6ab57b3.tar.gz
nextcloud-server-1ee4b680f63246c8ae5f3e647ba812ffe6ab57b3.zip
Fixed user dir existence check when creating new user
The check was done too later. It turns out that createUser() had already created the dir, which caused the warning message to be shown every time.
Diffstat (limited to 'settings')
-rw-r--r--settings/ajax/createuser.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/settings/ajax/createuser.php b/settings/ajax/createuser.php
index 915fcaf2d42..94b56fa0349 100644
--- a/settings/ajax/createuser.php
+++ b/settings/ajax/createuser.php
@@ -28,6 +28,10 @@ $password = $_POST["password"];
// Return Success story
try {
+ // check whether the user's files home exists
+ $userDirectory = OC_User::getHome($username) . '/files/';
+ $homeExists = file_exists($userDirectory);
+
if (!OC_User::createUser($username, $password)) {
OC_JSON::error(array('data' => array( 'message' => 'User creation failed for '.$username )));
exit();
@@ -39,10 +43,6 @@ 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