Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@owncloud.com>2016-05-03 12:58:33 +0300
committerRoeland Jago Douma <roeland@famdouma.nl>2016-06-14 11:17:06 +0300
commitae3d0d96fe7e273f6dfae3a5ca4754b5da4353cc (patch)
treecada27196a9e228861713ed19e76d14416e28f8c /lib/public/Util.php
parentd0a2515e2b08bffac3e3f447cc78c24f372a0589 (diff)
Optimize isSharingDisabledForuser
Diffstat (limited to 'lib/public/Util.php')
-rw-r--r--lib/public/Util.php14
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/public/Util.php b/lib/public/Util.php
index eb573168e10..86f84565218 100644
--- a/lib/public/Util.php
+++ b/lib/public/Util.php
@@ -63,6 +63,9 @@ class Util {
const ERROR=3;
const FATAL=4;
+ /** \OCP\Share\IManager */
+ private static $shareManager;
+
/**
* get the current installed version of ownCloud
* @return array
@@ -171,13 +174,14 @@ class Util {
*
* @return boolean
* @since 7.0.0
+ * @deprecated 9.1.0 Use \OC::$server->getShareManager()->sharingDisabledForUser
*/
public static function isSharingDisabledForUser() {
- return \OC_Util::isSharingDisabledForUser(
- \OC::$server->getConfig(),
- \OC::$server->getGroupManager(),
- \OC::$server->getUserSession()->getUser()
- );
+ if (self::$shareManager === null) {
+ self::$shareManager = \OC::$server->getShareManager();
+ }
+
+ return self::$shareManager->sharingDisabledForUser(\OC::$server->getUserSession()->getUser()->getUID());
}
/**