summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2014-12-17 21:53:43 +0100
committerLukas Reschke <lukas@owncloud.com>2014-12-17 21:53:43 +0100
commite3230b5bc2e552d68547bf718ef00b6d52d30c9d (patch)
tree7607534d8cdc326331a71c68bbfb34330780e4d4
parent3d006207d1940227c34e735fb439d9af105fcbcc (diff)
downloadnextcloud-server-e3230b5bc2e552d68547bf718ef00b6d52d30c9d.tar.gz
nextcloud-server-e3230b5bc2e552d68547bf718ef00b6d52d30c9d.zip
Add ultra-slim hack for incognito mode
As discussed at https://github.com/owncloud/core/pull/12912#issuecomment-67391155
-rw-r--r--lib/private/user.php7
-rw-r--r--lib/private/user/session.php5
2 files changed, 12 insertions, 0 deletions
diff --git a/lib/private/user.php b/lib/private/user.php
index ff45e9e26a6..516b789d430 100644
--- a/lib/private/user.php
+++ b/lib/private/user.php
@@ -342,7 +342,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 {