From df4348674b23d4be6764c31cdfb3a71774eed763 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Mon, 13 Jul 2015 17:39:07 +0200 Subject: Allow public auth to recognize sesssion When a public link password has been input, its auth is stored in the session. This fix makes it possible to recognize the session when using public webdav from the files UI. --- apps/files_sharing/lib/connector/publicauth.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/files_sharing/lib/connector/publicauth.php b/apps/files_sharing/lib/connector/publicauth.php index b1c269867f5..9d1bf391560 100644 --- a/apps/files_sharing/lib/connector/publicauth.php +++ b/apps/files_sharing/lib/connector/publicauth.php @@ -82,10 +82,13 @@ class PublicAuth extends \Sabre\DAV\Auth\Backend\AbstractBasic { } return true; + } else if (\OC::$server->getSession()->exists('public_link_authenticated') + && \OC::$server->getSession()->get('public_link_authenticated') === $linkItem['id']) { + return true; } else { return false; } - } elseif ($linkItem['share_type'] == \OCP\Share::SHARE_TYPE_REMOTE) { + } else if ($linkItem['share_type'] == \OCP\Share::SHARE_TYPE_REMOTE) { return true; } else { return false; -- cgit v1.2.3