mirror of
https://github.com/nextcloud/server.git
synced 2026-05-22 01:55:56 -04:00
fix(encryption): init filesystem before unshare hook
Signed-off-by: Hoang Pham <hoangmaths96@gmail.com>
This commit is contained in:
parent
6d7e3420ba
commit
616e85e97b
1 changed files with 15 additions and 0 deletions
|
|
@ -22,6 +22,21 @@ class HookManager {
|
|||
public static function postUnshared($params): void {
|
||||
// In case the unsharing happens in a background job, we don't have
|
||||
// a session and we load instead the user from the UserManager
|
||||
if (Filesystem::getView() === null) {
|
||||
$uidOwner = $params['uidOwner'] ?? '';
|
||||
if (is_string($uidOwner) && $uidOwner !== '') {
|
||||
$user = \OC::$server->getUserManager()->get($uidOwner);
|
||||
if ($user !== null) {
|
||||
$setupManager = \OC::$server->get(SetupManager::class);
|
||||
if (!$setupManager->isSetupComplete($user)) {
|
||||
$setupManager->setupForUser($user);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Filesystem::getView() === null) {
|
||||
return;
|
||||
}
|
||||
$path = Filesystem::getPath($params['fileSource']);
|
||||
$owner = Filesystem::getOwner($path);
|
||||
self::getUpdate($owner)->postUnshared($params);
|
||||
|
|
|
|||
Loading…
Reference in a new issue