File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,21 @@ public static function postShared($params): void {
2222 public static function postUnshared ($ params ): void {
2323 // In case the unsharing happens in a background job, we don't have
2424 // a session and we load instead the user from the UserManager
25+ if (Filesystem::getView () === null ) {
26+ $ uidOwner = $ params ['uidOwner ' ] ?? '' ;
27+ if (is_string ($ uidOwner ) && $ uidOwner !== '' ) {
28+ $ user = \OC ::$ server ->getUserManager ()->get ($ uidOwner );
29+ if ($ user !== null ) {
30+ $ setupManager = \OC ::$ server ->get (SetupManager::class);
31+ if (!$ setupManager ->isSetupComplete ($ user )) {
32+ $ setupManager ->setupForUser ($ user );
33+ }
34+ }
35+ }
36+ }
37+ if (Filesystem::getView () === null ) {
38+ return ;
39+ }
2540 $ path = Filesystem::getPath ($ params ['fileSource ' ]);
2641 $ owner = Filesystem::getOwner ($ path );
2742 self ::getUpdate ($ owner )->postUnshared ($ params );
You can’t perform that action at this time.
0 commit comments