diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2018-05-10 09:31:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-10 09:31:19 +0200 |
commit | 48034bdc4a21aced21373f4871a28498b7ff0bff (patch) | |
tree | 39b11e37cec633c01422da69cfa6b56c254ecab3 /apps | |
parent | 01c21601e81613b7c4163dbd575456752f70120e (diff) | |
parent | 17f1653ceb2971ff74055934cde33d4f2452d067 (diff) | |
download | nextcloud-server-48034bdc4a21aced21373f4871a28498b7ff0bff.tar.gz nextcloud-server-48034bdc4a21aced21373f4871a28498b7ff0bff.zip |
Merge pull request #9427 from nextcloud/bugfix/noid/no_listing_if_not_in_debug_trash_version
If not in debug disable principal listing
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_trashbin/lib/Sabre/RootCollection.php | 5 | ||||
-rw-r--r-- | apps/files_versions/lib/Sabre/RootCollection.php | 6 |
2 files changed, 9 insertions, 2 deletions
diff --git a/apps/files_trashbin/lib/Sabre/RootCollection.php b/apps/files_trashbin/lib/Sabre/RootCollection.php index e425fb448e2..be31d200f71 100644 --- a/apps/files_trashbin/lib/Sabre/RootCollection.php +++ b/apps/files_trashbin/lib/Sabre/RootCollection.php @@ -23,14 +23,17 @@ declare(strict_types=1); */ namespace OCA\Files_Trashbin\Sabre; +use OCP\IConfig; use Sabre\DAV\INode; use Sabre\DAVACL\AbstractPrincipalCollection; use Sabre\DAVACL\PrincipalBackend; class RootCollection extends AbstractPrincipalCollection { - public function __construct(PrincipalBackend\BackendInterface $principalBackend) { + public function __construct(PrincipalBackend\BackendInterface $principalBackend, IConfig $config) { parent::__construct($principalBackend, 'principals/users'); + + $this->disableListing = !$config->getSystemValue('debug', false); } /** diff --git a/apps/files_versions/lib/Sabre/RootCollection.php b/apps/files_versions/lib/Sabre/RootCollection.php index 397f1c55891..ca5979573b5 100644 --- a/apps/files_versions/lib/Sabre/RootCollection.php +++ b/apps/files_versions/lib/Sabre/RootCollection.php @@ -23,6 +23,7 @@ namespace OCA\Files_Versions\Sabre; use OCP\Files\IRootFolder; +use OCP\IConfig; use Sabre\DAV\INode; use Sabre\DAVACL\AbstractPrincipalCollection; use Sabre\DAVACL\PrincipalBackend; @@ -33,10 +34,13 @@ class RootCollection extends AbstractPrincipalCollection { private $rootFolder; public function __construct(PrincipalBackend\BackendInterface $principalBackend, - IRootFolder $rootFolder) { + IRootFolder $rootFolder, + IConfig $config) { parent::__construct($principalBackend, 'principals/users'); $this->rootFolder = $rootFolder; + + $this->disableListing = !$config->getSystemValue('debug', false); } /** |