diff options
author | Roeland Douma <rullzer@users.noreply.github.com> | 2016-02-26 08:18:10 +0100 |
---|---|---|
committer | Roeland Douma <rullzer@users.noreply.github.com> | 2016-02-26 08:18:10 +0100 |
commit | 54f8ec8be0bf6fcd908018681542fd9689abe617 (patch) | |
tree | 349d69d47069bc09b0275ea3071d35543a342e24 | |
parent | 696ee349eab86882f15b85b7e3f840a0cf7749a8 (diff) | |
parent | 0e999ab3b464fc778e58059033e0b486136a9723 (diff) | |
download | nextcloud-server-54f8ec8be0bf6fcd908018681542fd9689abe617.tar.gz nextcloud-server-54f8ec8be0bf6fcd908018681542fd9689abe617.zip |
Merge pull request #22574 from owncloud/backport-22419-console-add-user-group-with-shares
[8.2] Make sure to init the users Filesystem so we can add group shares
-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 426b8489ccf..3e0e5dff66e 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); |