Revert 581d3007f
This commit is contained in:
parent
581d3007fb
commit
1885d41460
|
@ -223,10 +223,9 @@ class Session implements IUserSession, Emitter {
|
||||||
/**
|
/**
|
||||||
* get the current active user
|
* get the current active user
|
||||||
*
|
*
|
||||||
* @param bool $validate whether to validate session
|
|
||||||
* @return IUser|null Current user, otherwise null
|
* @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
|
// 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
|
// described at https://github.com/owncloud/core/pull/12912#issuecomment-67391155
|
||||||
if (OC_User::isIncognitoMode()) {
|
if (OC_User::isIncognitoMode()) {
|
||||||
|
@ -237,16 +236,11 @@ class Session implements IUserSession, Emitter {
|
||||||
if (is_null($uid)) {
|
if (is_null($uid)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
// UserManager will cache user for later validation...
|
$this->activeUser = $this->manager->get($uid);
|
||||||
$user = $this->manager->get($uid);
|
if (is_null($this->activeUser)) {
|
||||||
if (is_null($user)) {
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if ($validate === true) {
|
$this->validateSession();
|
||||||
// only set activeUser when validating...
|
|
||||||
$this->activeUser = $user;
|
|
||||||
$this->validateSession();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return $this->activeUser;
|
return $this->activeUser;
|
||||||
}
|
}
|
||||||
|
|
|
@ -348,8 +348,7 @@ class OC_App {
|
||||||
if ($all) {
|
if ($all) {
|
||||||
$user = null;
|
$user = null;
|
||||||
} else {
|
} else {
|
||||||
// getUser but don't validate session yet
|
$user = \OC::$server->getUserSession()->getUser();
|
||||||
$user = \OC::$server->getUserSession()->getUser(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_null($user)) {
|
if (is_null($user)) {
|
||||||
|
|
Loading…
Reference in New Issue