Skip to content
Snippets Groups Projects
Commit 560085e1 authored by Joas Schilling's avatar Joas Schilling
Browse files

Make sure to init the users Filesystem so we can add group shares

parent 1cb3583a
No related branches found
No related tags found
No related merge requests found
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
namespace OC\Core\Command\User; namespace OC\Core\Command\User;
use OC\Files\Filesystem;
use OCP\IGroupManager; use OCP\IGroupManager;
use OCP\IUser; use OCP\IUser;
use OCP\IUserManager; use OCP\IUserManager;
...@@ -131,7 +132,15 @@ class Add extends Command { ...@@ -131,7 +132,15 @@ class Add extends Command {
$output->writeln('Display name set to "' . $user->getDisplayName() . '"'); $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); $group = $this->groupManager->get($groupName);
if (!$group) { if (!$group) {
$this->groupManager->createGroup($groupName); $this->groupManager->createGroup($groupName);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment