Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Revert 581d300
  • Loading branch information
sshambar committed May 4, 2020
commit 1885d41460ca80b3c2cca0d0d5cc6dc24e8a7e81
14 changes: 4 additions & 10 deletions lib/private/User/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,9 @@ public function setUser($user) {
/**
* get the current active user
*
* @param bool $validate whether to validate session
* @return IUser|null Current user, otherwise null
*/
public function getUser($validate = true) {
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()) {
Expand All @@ -237,16 +236,11 @@ public function getUser($validate = true) {
if (is_null($uid)) {
return null;
}
// UserManager will cache user for later validation...
$user = $this->manager->get($uid);
if (is_null($user)) {
$this->activeUser = $this->manager->get($uid);
if (is_null($this->activeUser)) {
return null;
}
if ($validate === true) {
// only set activeUser when validating...
$this->activeUser = $user;
$this->validateSession();
}
$this->validateSession();
}
return $this->activeUser;
}
Expand Down
3 changes: 1 addition & 2 deletions lib/private/legacy/OC_App.php
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,7 @@ public static function getEnabledApps(bool $forceRefresh = false, bool $all = fa
if ($all) {
$user = null;
} else {
// getUser but don't validate session yet
$user = \OC::$server->getUserSession()->getUser(false);
$user = \OC::$server->getUserSession()->getUser();
}

if (is_null($user)) {
Expand Down