diff options
author | Vincent Petry <pvince81@owncloud.com> | 2013-11-22 18:08:49 +0400 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2013-11-22 18:08:49 +0400 |
commit | 3b904647b0b5d13a0ca4a779d4ea603b526c98a4 (patch) | |
tree | 1e43b1751d4a50aba744f907e6602d206ff15205 /lib | |
parent | c67b8f2b224a6053600ffecd765bcf49ed6d8e8a (diff) | |
parent | 2cc0c90015aca5ea287dadd8c0edc3925a573426 (diff) |
Merge pull request #6003 from owncloud/incognito_mode
Incognito mode
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/user.php | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/private/user.php b/lib/private/user.php index f15fdf1dbbc..5bd36006750 100644 --- a/lib/private/user.php +++ b/lib/private/user.php @@ -54,6 +54,9 @@ class OC_User { private static $_setupedBackends = array(); + // bool, stores if a user want to access a resource anonymously, e.g if he opens a public link + private static $incognitoMode = false; + /** * @brief registers backend * @param string $backend name of the backend @@ -320,6 +323,15 @@ class OC_User { } /** + * @brief set incognito mode, e.g. if a user wants to open a public link + * @param bool $status + */ + public static function setIncognitoMode($status) { + self::$incognitoMode = $status; + + } + + /** * Supplies an attribute to the logout hyperlink. The default behaviour * is to return an href with '?logout=true' appended. However, it can * supply any attribute(s) which are valid for <a>. @@ -354,7 +366,7 @@ class OC_User { */ public static function getUser() { $uid = OC::$session ? OC::$session->get('user_id') : null; - if (!is_null($uid)) { + if (!is_null($uid) && self::$incognitoMode === false) { return $uid; } else { return false; |