diff options
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/AppFramework/DependencyInjection/DIContainer.php | 5 | ||||
-rw-r--r-- | lib/private/Encryption/File.php | 2 | ||||
-rw-r--r-- | lib/private/Server.php | 8 |
3 files changed, 14 insertions, 1 deletions
diff --git a/lib/private/AppFramework/DependencyInjection/DIContainer.php b/lib/private/AppFramework/DependencyInjection/DIContainer.php index 4fb13b09ae0..45a971f1257 100644 --- a/lib/private/AppFramework/DependencyInjection/DIContainer.php +++ b/lib/private/AppFramework/DependencyInjection/DIContainer.php @@ -57,6 +57,7 @@ use OCP\IRequest; use OCP\IServerContainer; use OCP\IUserSession; use OCP\RichObjectStrings\IValidator; +use OCP\Share\IShareHelper; use OCP\Util; class DIContainer extends SimpleContainer implements IAppContainer { @@ -169,6 +170,10 @@ class DIContainer extends SimpleContainer implements IAppContainer { ); }); + $this->registerService(IShareHelper::class, function (SimpleContainer $c) { + return $c->query(IShareHelper::class); + }); + /** * App Framework APIs diff --git a/lib/private/Encryption/File.php b/lib/private/Encryption/File.php index 329fb12b839..3b6a87ef516 100644 --- a/lib/private/Encryption/File.php +++ b/lib/private/Encryption/File.php @@ -101,7 +101,7 @@ class File implements \OCP\Encryption\IFile { // Find out who, if anyone, is sharing the file if ($file !== null) { $resultForFile = $this->shareManager->getAccessList($file, false); - $userIds = \array_merge($userIds, $resultForFile['users']); + $userIds = array_merge($userIds, $resultForFile['users']); $public = $resultForFile['public'] || $resultForFile['remote'] || $public; } diff --git a/lib/private/Server.php b/lib/private/Server.php index c38675934c3..068c89dd8e2 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -93,6 +93,7 @@ use OC\Security\CredentialsManager; use OC\Security\SecureRandom; use OC\Security\TrustedDomainHelper; use OC\Session\CryptoWrapper; +use OC\Share20\ShareHelper; use OC\Tagging\TagMapper; use OCA\Theming\ThemingDefaults; use OCP\App\IAppManager; @@ -106,6 +107,7 @@ use OCP\IServerContainer; use OCP\ITempManager; use OCP\RichObjectStrings\IValidator; use OCP\Security\IContentSecurityPolicyManager; +use OCP\Share\IShareHelper; use Symfony\Component\EventDispatcher\EventDispatcher; use Symfony\Component\EventDispatcher\EventDispatcherInterface; @@ -977,6 +979,12 @@ class Server extends ServerContainer implements IServerContainer { $this->registerService(\OCP\ISession::class, function(SimpleContainer $c) { return $c->query(\OCP\IUserSession::class)->getSession(); }); + + $this->registerService(IShareHelper::class, function(Server $c) { + return new ShareHelper( + $c->getLazyRootFolder() + ); + }); } /** |