aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2014-11-24 15:02:49 +0100
committerLukas Reschke <lukas@owncloud.com>2014-11-24 15:02:49 +0100
commit858907959043e34cefd6f43759fed1919f86ee94 (patch)
treeb5f3139a665658b8dcc4c36b9afba8b91aa3d28a /apps
parent168fce0b182e69d1364e4432178a8131961d6583 (diff)
downloadnextcloud-server-858907959043e34cefd6f43759fed1919f86ee94.tar.gz
nextcloud-server-858907959043e34cefd6f43759fed1919f86ee94.zip
Close session only if encryption app is not enabled
Fixes https://github.com/owncloud/core/issues/12389
Diffstat (limited to 'apps')
-rw-r--r--apps/files_sharing/lib/controllers/sharecontroller.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/apps/files_sharing/lib/controllers/sharecontroller.php b/apps/files_sharing/lib/controllers/sharecontroller.php
index 552d9164344..71b5ab7f8c8 100644
--- a/apps/files_sharing/lib/controllers/sharecontroller.php
+++ b/apps/files_sharing/lib/controllers/sharecontroller.php
@@ -84,7 +84,6 @@ class ShareController extends Controller {
* @NoCSRFRequired
*
* @param string $token
- *
* @return TemplateResponse|RedirectResponse
*/
public function showAuthenticate($token) {
@@ -127,7 +126,6 @@ class ShareController extends Controller {
*
* @param string $token
* @param string $path
- *
* @return TemplateResponse
*/
public function showShare($token, $path = '') {
@@ -207,6 +205,8 @@ class ShareController extends Controller {
/**
* @PublicPage
* @NoCSRFRequired
+ * @UseSession
+ *
* @param string $token
* @param string $files
* @param string $path
@@ -215,6 +215,12 @@ class ShareController extends Controller {
public function downloadShare($token, $files = null, $path = '') {
\OC_User::setIncognitoMode(true);
+ // FIXME: Use DI once there is a suitable class
+ if (!\OCP\App::isEnabled('files_encryption')) {
+ // encryption app requires the session to store the keys in
+ \OC::$server->getSession()->close();
+ }
+
$linkItem = OCP\Share::getShareByToken($token, false);
// Share is password protected - check whether the user is permitted to access the share