mirror of
https://github.com/nextcloud/server.git
synced 2026-03-05 15:01:16 -05:00
Merge pull request #37394 from nextcloud/backport/36810/stable26
[stable26] do onetime user setup before getting any mount from providers
This commit is contained in:
commit
76350d8a4d
1 changed files with 7 additions and 9 deletions
|
|
@ -235,11 +235,13 @@ class SetupManager {
|
|||
* part of the user setup that is run only once per user
|
||||
*/
|
||||
private function oneTimeUserSetup(IUser $user) {
|
||||
if (in_array($user->getUID(), $this->setupUsers, true)) {
|
||||
if ($this->isSetupStarted($user)) {
|
||||
return;
|
||||
}
|
||||
$this->setupUsers[] = $user->getUID();
|
||||
|
||||
$this->setupRoot();
|
||||
|
||||
$this->eventLogger->start('fs:setup:user:onetime', 'Onetime filesystem for user');
|
||||
|
||||
$this->setupBuiltinWrappers();
|
||||
|
|
@ -319,11 +321,7 @@ class SetupManager {
|
|||
* @throws \OC\ServerNotAvailableException
|
||||
*/
|
||||
private function setupForUserWith(IUser $user, callable $mountCallback): void {
|
||||
$this->setupRoot();
|
||||
|
||||
if (!$this->isSetupStarted($user)) {
|
||||
$this->oneTimeUserSetup($user);
|
||||
}
|
||||
$this->oneTimeUserSetup($user);
|
||||
|
||||
if ($this->lockdownManager->canAccessFilesystem()) {
|
||||
$mountCallback();
|
||||
|
|
@ -422,9 +420,7 @@ class SetupManager {
|
|||
return;
|
||||
}
|
||||
|
||||
if (!$this->isSetupStarted($user)) {
|
||||
$this->oneTimeUserSetup($user);
|
||||
}
|
||||
$this->oneTimeUserSetup($user);
|
||||
|
||||
$this->eventLogger->start('fs:setup:user:path', "Setup $path filesystem for user");
|
||||
$this->eventLogger->start('fs:setup:user:path:find', "Find mountpoint for $path");
|
||||
|
|
@ -513,6 +509,8 @@ class SetupManager {
|
|||
|
||||
$this->eventLogger->start('fs:setup:user:providers', "Setup filesystem for " . implode(', ', $providers));
|
||||
|
||||
$this->oneTimeUserSetup($user);
|
||||
|
||||
// home providers are always used
|
||||
$providers = array_filter($providers, function (string $provider) {
|
||||
return !is_subclass_of($provider, IHomeMountProvider::class);
|
||||
|
|
|
|||
Loading…
Reference in a new issue