From e87a32e92fbf7b4807b5aae900c57de004286712 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 May 2019 09:53:10 +0200 Subject: [PATCH] Fix Try to fix DAV pb with some buggy clients by disabling browser --- htdocs/admin/dav.php | 2 +- htdocs/dav/fileserver.php | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/htdocs/admin/dav.php b/htdocs/admin/dav.php index 894706576b5..6ac210c1ddb 100644 --- a/htdocs/admin/dav.php +++ b/htdocs/admin/dav.php @@ -153,7 +153,7 @@ print "\n"; clearstatcache(); -print $langs->trans("WebDAVSetupDesc")."
\n"; +print ''.$langs->trans("WebDAVSetupDesc")."
\n"; print "
"; diff --git a/htdocs/dav/fileserver.php b/htdocs/dav/fileserver.php index 55284036bea..3d484fa8b01 100644 --- a/htdocs/dav/fileserver.php +++ b/htdocs/dav/fileserver.php @@ -14,6 +14,9 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . + * + * You can test with the WebDav client cadaver: + * cadaver http://myurl/dav/fileserver.php */ /** @@ -59,7 +62,8 @@ $publicDir = $conf->dav->multidir_output[$entity].'/public'; $privateDir = $conf->dav->multidir_output[$entity].'/private'; $ecmDir = $conf->ecm->multidir_output[$entity]; $tmpDir = $conf->dav->multidir_temp[$entity]; -//var_dump($tmpDir);exit; +//var_dump($tmpDir);mkdir($tmpDir);exit; + // Authentication callback function $authBackend = new \Sabre\DAV\Auth\Backend\BasicCallBack(function ($username, $password) { @@ -147,13 +151,17 @@ if ((empty($conf->global->DAV_ALLOW_PUBLIC_DIR) $server->addPlugin(new \Sabre\DAV\Auth\Plugin($authBackend)); } // Support for LOCK and UNLOCK +dol_mkdir($tmpDir); $lockBackend = new \Sabre\DAV\Locks\Backend\File($tmpDir . '/.locksdb'); $lockPlugin = new \Sabre\DAV\Locks\Plugin($lockBackend); $server->addPlugin($lockPlugin); // Support for html frontend -$browser = new \Sabre\DAV\Browser\Plugin(); -$server->addPlugin($browser); +if (empty($conf->global->DAV_DISABLE_BROWSER)) +{ + $browser = new \Sabre\DAV\Browser\Plugin(); + $server->addPlugin($browser); +} // Automatically guess (some) contenttypes, based on extension //$server->addPlugin(new \Sabre\DAV\Browser\GuessContentType());