diff options
author | Joas Schilling <nickvergessen@owncloud.com> | 2016-02-16 11:46:35 +0100 |
---|---|---|
committer | Joas Schilling <nickvergessen@owncloud.com> | 2016-02-16 11:46:35 +0100 |
commit | 560085e1a4a5db48f3bdab1fb4901dec72c3ed04 (patch) | |
tree | 73bb06993b218fd91f9fe4f13b969ab4b1578162 /core/command | |
parent | 1cb3583a9a28c13d07fa83b569bfa78df9cbf79d (diff) | |
download | nextcloud-server-560085e1a4a5db48f3bdab1fb4901dec72c3ed04.tar.gz nextcloud-server-560085e1a4a5db48f3bdab1fb4901dec72c3ed04.zip |
Make sure to init the users Filesystem so we can add group shares
Diffstat (limited to 'core/command')
-rw-r--r-- | core/command/user/add.php | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/core/command/user/add.php b/core/command/user/add.php index cb0ab319bc0..6c7e3a47231 100644 --- a/core/command/user/add.php +++ b/core/command/user/add.php @@ -22,6 +22,7 @@ namespace OC\Core\Command\User; +use OC\Files\Filesystem; use OCP\IGroupManager; use OCP\IUser; use OCP\IUserManager; @@ -131,7 +132,15 @@ class Add extends Command { $output->writeln('Display name set to "' . $user->getDisplayName() . '"'); } - foreach ($input->getOption('group') as $groupName) { + $groups = $input->getOption('group'); + + if (!empty($groups)) { + // Make sure we init the Filesystem for the user, in case we need to + // init some group shares. + Filesystem::init($user->getUID(), ''); + } + + foreach ($groups as $groupName) { $group = $this->groupManager->get($groupName); if (!$group) { $this->groupManager->createGroup($groupName); |