summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2018-05-08 20:52:14 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2018-05-08 20:52:14 +0200
commit17f1653ceb2971ff74055934cde33d4f2452d067 (patch)
tree497ed9d3dcccba6e3b60fb2156df728a5e94096d /apps
parent7d3e7f4341d2b547c04c23da69865676f5389a80 (diff)
downloadnextcloud-server-17f1653ceb2971ff74055934cde33d4f2452d067.tar.gz
nextcloud-server-17f1653ceb2971ff74055934cde33d4f2452d067.zip
If not in debug disable principal listing
Trashbin and Version should have the same behaviour as the other collections. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps')
-rw-r--r--apps/files_trashbin/lib/Sabre/RootCollection.php5
-rw-r--r--apps/files_versions/lib/Sabre/RootCollection.php6
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);
}
/**