Close session only if encryption app is not enabled

Fixes https://github.com/owncloud/core/issues/12389
This commit is contained in:
Lukas Reschke 2014-11-24 15:02:49 +01:00
parent 168fce0b18
commit 8589079590
1 changed files with 8 additions and 2 deletions

View File

@ -84,7 +84,6 @@ class ShareController extends Controller {
* @NoCSRFRequired * @NoCSRFRequired
* *
* @param string $token * @param string $token
*
* @return TemplateResponse|RedirectResponse * @return TemplateResponse|RedirectResponse
*/ */
public function showAuthenticate($token) { public function showAuthenticate($token) {
@ -127,7 +126,6 @@ class ShareController extends Controller {
* *
* @param string $token * @param string $token
* @param string $path * @param string $path
*
* @return TemplateResponse * @return TemplateResponse
*/ */
public function showShare($token, $path = '') { public function showShare($token, $path = '') {
@ -207,6 +205,8 @@ class ShareController extends Controller {
/** /**
* @PublicPage * @PublicPage
* @NoCSRFRequired * @NoCSRFRequired
* @UseSession
*
* @param string $token * @param string $token
* @param string $files * @param string $files
* @param string $path * @param string $path
@ -215,6 +215,12 @@ class ShareController extends Controller {
public function downloadShare($token, $files = null, $path = '') { public function downloadShare($token, $files = null, $path = '') {
\OC_User::setIncognitoMode(true); \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); $linkItem = OCP\Share::getShareByToken($token, false);
// Share is password protected - check whether the user is permitted to access the share // Share is password protected - check whether the user is permitted to access the share