improve performance by reusing existing sessions
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
parent
b13a9983e2
commit
e9e55a1da1
|
@ -389,10 +389,7 @@ class UserBackend implements IApacheBackend, UserInterface, IUserBackend {
|
|||
* @since 6.0.0
|
||||
*/
|
||||
public function isSessionActive() {
|
||||
if($this->getCurrentUserId() !== '') {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return $this->session->get('user_saml.samlUserData') !== null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -487,8 +484,15 @@ class UserBackend implements IApacheBackend, UserInterface, IUserBackend {
|
|||
* @since 6.0.0
|
||||
*/
|
||||
public function getCurrentUserId() {
|
||||
$user = \OC::$server->getUserSession()->getUser();
|
||||
|
||||
if($user instanceof IUser && $this->session->get('user_saml.samlUserData')) {
|
||||
$uid = $user->getUID();
|
||||
} else {
|
||||
$this->userData->setAttributes($this->session->get('user_saml.samlUserData') ?? []);
|
||||
$uid = $this->userData->getEffectiveUid();
|
||||
}
|
||||
|
||||
if($uid !== '' && $this->userExists($uid)) {
|
||||
$uid = $this->userData->testEncodedObjectGUID($uid);
|
||||
|
||||
|
|
Loading…
Reference in New Issue