aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@users.noreply.github.com>2024-03-15 16:05:59 +0100
committerGitHub <noreply@github.com>2024-03-15 16:05:59 +0100
commit5a1ed2d9eac523c3c530baff5aa933964c0f67d0 (patch)
treee6e458418c7ec94bad5dbd985b0dc5f27b73f29e /lib
parente0faca6170e9bf39bfe34fcac225d4ae2ae8c3b7 (diff)
parent2c8d410f674b74d33ce187e7aa3e20ffbfc5d26a (diff)
downloadnextcloud-server-5a1ed2d9eac523c3c530baff5aa933964c0f67d0.tar.gz
nextcloud-server-5a1ed2d9eac523c3c530baff5aa933964c0f67d0.zip
Merge pull request #40131 from summersab/refactor/OC-Server-getShareManager
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Share20/Hooks.php6
-rw-r--r--lib/private/Template/JSConfigHelper.php3
-rw-r--r--lib/public/Util.php4
3 files changed, 8 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 8cba93f1f4e..d2cd536fa9f 100644
--- a/lib/private/Template/JSConfigHelper.php
+++ b/lib/private/Template/JSConfigHelper.php
@@ -49,6 +49,7 @@ use OCP\ILogger;
use OCP\ISession;
use OCP\IURLGenerator;
use OCP\IUser;
+use OCP\Share\IManager as IShareManager;
use OCP\User\Backend\IPasswordConfirmationBackend;
use OCP\Util;
@@ -261,7 +262,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 e3f394c1ca9..11229567188 100644
--- a/lib/public/Util.php
+++ b/lib/public/Util.php
@@ -110,11 +110,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(IManager::class);
}
$user = \OC::$server->getUserSession()->getUser();