From 961317d9114afda53a381802880d6c94af7ccb47 Mon Sep 17 00:00:00 2001
From: Bjoern Schiessle <schiessle@owncloud.com>
Date: Tue, 20 May 2014 17:54:14 +0200
Subject: [PATCH] make sure to enable incognito mode when mounting a public
 link and update init status of the encryption app

---
 apps/files_encryption/lib/session.php           | 2 ++
 apps/files_sharing/lib/connector/publicauth.php | 1 +
 2 files changed, 3 insertions(+)

diff --git a/apps/files_encryption/lib/session.php b/apps/files_encryption/lib/session.php
index 93be6691f9..ef18b924dd 100644
--- a/apps/files_encryption/lib/session.php
+++ b/apps/files_encryption/lib/session.php
@@ -100,6 +100,8 @@ class Session {
 			$privateKey = Crypt::decryptPrivateKey($encryptedKey, '');
 			$this->setPublicSharePrivateKey($privateKey);
 
+			$this->setInitialized(\OCA\Encryption\Session::INIT_SUCCESSFUL);
+
 			\OC_FileProxy::$enabled = $proxyStatus;
 		}
 	}
diff --git a/apps/files_sharing/lib/connector/publicauth.php b/apps/files_sharing/lib/connector/publicauth.php
index ec7b68ba69..c9d545180b 100644
--- a/apps/files_sharing/lib/connector/publicauth.php
+++ b/apps/files_sharing/lib/connector/publicauth.php
@@ -38,6 +38,7 @@ class PublicAuth extends \Sabre\DAV\Auth\Backend\AbstractBasic {
 	 */
 	protected function validateUserPass($username, $password) {
 		$linkItem = \OCP\Share::getShareByToken($username, false);
+		\OC_User::setIncognitoMode(true);
 		$this->share = $linkItem;
 		if (!$linkItem) {
 			return false;
-- 
GitLab