-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #51204 from nextcloud/backport/51000/stable29
[stable29] fix(FederatedShareProvider): Delete external shares when groups are deleted or users removed from a group
- Loading branch information
Showing
9 changed files
with
160 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors | ||
* SPDX-License-Identifier: AGPL-3.0-or-later | ||
*/ | ||
namespace OC\Share20; | ||
|
||
use OCP\EventDispatcher\Event; | ||
use OCP\EventDispatcher\IEventListener; | ||
use OCP\Group\Events\GroupDeletedEvent; | ||
use OCP\Share\IManager; | ||
|
||
/** | ||
* @template-implements IEventListener<GroupDeletedEvent> | ||
*/ | ||
class GroupDeletedListener implements IEventListener { | ||
public function __construct( | ||
protected IManager $shareManager, | ||
) { | ||
} | ||
|
||
public function handle(Event $event): void { | ||
if (!$event instanceof GroupDeletedEvent) { | ||
return; | ||
} | ||
|
||
$this->shareManager->groupDeleted($event->getGroup()->getGID()); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors | ||
* SPDX-License-Identifier: AGPL-3.0-or-later | ||
*/ | ||
namespace OC\Share20; | ||
|
||
use OCP\EventDispatcher\Event; | ||
use OCP\EventDispatcher\IEventListener; | ||
use OCP\Share\IManager; | ||
use OCP\User\Events\UserDeletedEvent; | ||
|
||
/** | ||
* @template-implements IEventListener<UserDeletedEvent> | ||
*/ | ||
class UserDeletedListener implements IEventListener { | ||
public function __construct( | ||
protected IManager $shareManager, | ||
) { | ||
} | ||
|
||
public function handle(Event $event): void { | ||
if (!$event instanceof UserDeletedEvent) { | ||
return; | ||
} | ||
|
||
$this->shareManager->userDeleted($event->getUser()->getUID()); | ||
} | ||
} |