diff options
author | Andrew Summers <18727110+summersab@users.noreply.github.com> | 2023-08-29 17:07:38 -0500 |
---|---|---|
committer | Andrew Summers <18727110+summersab@users.noreply.github.com> | 2023-08-29 21:32:58 -0500 |
commit | 6b09a79227a5dc98aa4620c6e5e15b610a06c806 (patch) | |
tree | d6bf73c77bcd6fee4374bdfe93aae7b3d9af5f78 /lib | |
parent | 9d1547f59d53b46ba401ddf0e7f4c6e4f067004e (diff) | |
download | nextcloud-server-6b09a79227a5dc98aa4620c6e5e15b610a06c806.tar.gz nextcloud-server-6b09a79227a5dc98aa4620c6e5e15b610a06c806.zip |
Refactor `OC\Server::getShareManager`
Signed-off-by: Andrew Summers <18727110+summersab@users.noreply.github.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Share20/Hooks.php | 6 | ||||
-rw-r--r-- | lib/private/Template/JSConfigHelper.php | 3 | ||||
-rw-r--r-- | lib/public/Util.php | 5 |
3 files changed, 9 insertions, 5 deletions
diff --git a/lib/private/Share20/Hooks.php b/lib/private/Share20/Hooks.php index ae08b20fde6..2ab328b6bd9 100644 --- a/lib/private/Share20/Hooks.php +++ b/lib/private/Share20/Hooks.php @@ -21,12 +21,14 @@ */ namespace OC\Share20; +use OCP\Share\IManager as IShareManager; + class Hooks { public static function post_deleteUser($arguments) { - \OC::$server->getShareManager()->userDeleted($arguments['uid']); + \OC::$server->get(IShareManager::class)->userDeleted($arguments['uid']); } public static function post_deleteGroup($arguments) { - \OC::$server->getShareManager()->groupDeleted($arguments['gid']); + \OC::$server->get(IShareManager::class)->groupDeleted($arguments['gid']); } } diff --git a/lib/private/Template/JSConfigHelper.php b/lib/private/Template/JSConfigHelper.php index 7b6d0a6a346..9cf0838e43a 100644 --- a/lib/private/Template/JSConfigHelper.php +++ b/lib/private/Template/JSConfigHelper.php @@ -49,6 +49,7 @@ use OCP\ISession; use OCP\IURLGenerator; use OCP\ILogger; use OCP\IUser; +use OCP\Share\IManager as IShareManager; use OCP\User\Backend\IPasswordConfirmationBackend; use OCP\Util; @@ -260,7 +261,7 @@ class JSConfigHelper { 'resharingAllowed' => Share::isResharingAllowed(), 'remoteShareAllowed' => $outgoingServer2serverShareEnabled, 'federatedCloudShareDoc' => $this->urlGenerator->linkToDocs('user-sharing-federated'), - 'allowGroupSharing' => \OC::$server->getShareManager()->allowGroupSharing(), + 'allowGroupSharing' => \OC::$server->get(IShareManager::class)->allowGroupSharing(), 'defaultInternalExpireDateEnabled' => $defaultInternalExpireDateEnabled, 'defaultInternalExpireDate' => $defaultInternalExpireDate, 'defaultInternalExpireDateEnforced' => $defaultInternalExpireDateEnforced, diff --git a/lib/public/Util.php b/lib/public/Util.php index bff8038b3dd..34ccc61074f 100644 --- a/lib/public/Util.php +++ b/lib/public/Util.php @@ -48,6 +48,7 @@ namespace OCP; use OC\AppScriptDependency; use OC\AppScriptSort; +use OCP\Share\IManager as IShareManager; use bantu\IniGetWrapper\IniGetWrapper; use Psr\Container\ContainerExceptionInterface; @@ -127,11 +128,11 @@ class Util { * * @return boolean * @since 7.0.0 - * @deprecated 9.1.0 Use \OC::$server->getShareManager()->sharingDisabledForUser + * @deprecated 9.1.0 Use \OC::$server->get(\OCP\Share\IManager::class)->sharingDisabledForUser */ public static function isSharingDisabledForUser() { if (self::$shareManager === null) { - self::$shareManager = \OC::$server->getShareManager(); + self::$shareManager = \OC::$server->get(IShareManager::class); } $user = \OC::$server->getUserSession()->getUser(); |