From a7af6656b409a5cb075e0186275419101ad175a4 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Fri, 6 Sep 2013 08:00:18 +0200 Subject: [PATCH] PROPFIND returns same documents like GET PROPFIND previously returned all documents while GET returned only released documents. They now both return only released documents. --- webdav/webdav.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/webdav/webdav.php b/webdav/webdav.php index c0dd84340..544e7c3cc 100644 --- a/webdav/webdav.php +++ b/webdav/webdav.php @@ -239,7 +239,19 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server // TODO recursion needed if "Depth: infinite" } $documents = $obj->getDocuments(); - $documents = SeedDMS_Core_DMS::filterAccess($documents, $this->user, M_READ); + $docs = SeedDMS_Core_DMS::filterAccess($documents, $this->user, M_READ); + if(!$this->user->isAdmin()) { + $documents = array(); + foreach($docs as $document) { + $lc = $document->getLatestContent(); + $status = $lc->getStatus(); + if($status['status'] == S_RELEASED) { + $documents[] = $document; + } + } + } else { + $documents = $docs; + } if ($documents) { // ok, now get all its contents foreach($documents as $document) {