mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Make sure to init the users Filesystem so we can add group shares
This commit is contained in:
parent
1cb3583a9a
commit
560085e1a4
1 changed files with 10 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue