diff options
author | Lukas Reschke <lukas@owncloud.com> | 2014-12-19 14:54:11 +0100 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2014-12-19 14:54:11 +0100 |
commit | f671b232cc122cdb8e993c8b35bd5419b32a9ae4 (patch) | |
tree | 9f8c90d3324513060a67c451e68df16d09b2fd73 | |
parent | 2d647973202151c12a3bd5f0396657212b1f7b7f (diff) | |
parent | e3230b5bc2e552d68547bf718ef00b6d52d30c9d (diff) | |
download | nextcloud-server-f671b232cc122cdb8e993c8b35bd5419b32a9ae4.tar.gz nextcloud-server-f671b232cc122cdb8e993c8b35bd5419b32a9ae4.zip |
Merge pull request #12923 from owncloud/ultra-slim-version-of-incognito-mode
Add ultra-slim hack for incognito mode
-rw-r--r-- | lib/private/user.php | 7 | ||||
-rw-r--r-- | lib/private/user/session.php | 5 |
2 files changed, 12 insertions, 0 deletions
diff --git a/lib/private/user.php b/lib/private/user.php index 17b84d1f93e..d66354b247d 100644 --- a/lib/private/user.php +++ b/lib/private/user.php @@ -343,7 +343,14 @@ class OC_User { */ public static function setIncognitoMode($status) { self::$incognitoMode = $status; + } + /** + * get incognito mode status + * @return bool + */ + public static function isIncognitoMode() { + return self::$incognitoMode; } /** diff --git a/lib/private/user/session.php b/lib/private/user/session.php index 53662d00952..9324ef2f42c 100644 --- a/lib/private/user/session.php +++ b/lib/private/user/session.php @@ -124,6 +124,11 @@ class Session implements IUserSession, Emitter { * @return \OC\User\User */ public function getUser() { + // FIXME: This is a quick'n dirty work-around for the incognito mode as + // described at https://github.com/owncloud/core/pull/12912#issuecomment-67391155 + if (\OC_User::isIncognitoMode()) { + return null; + } if ($this->activeUser) { return $this->activeUser; } else { |