summaryrefslogtreecommitdiffstats
path: root/lib/private/User
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2016-12-02 11:16:33 +0100
committerArthur Schiwon <blizzz@arthur-schiwon.de>2017-04-06 15:22:43 +0200
commitdaf9d235478ceccd484fbb66e445e19a3b2cd09b (patch)
tree6ea2f9330b95eb52858b93a4c3d2f880cd3b5728 /lib/private/User
parent50844e8c47f64196a22b1428e0cae509f9f47856 (diff)
downloadnextcloud-server-daf9d235478ceccd484fbb66e445e19a3b2cd09b.tar.gz
nextcloud-server-daf9d235478ceccd484fbb66e445e19a3b2cd09b.zip
don't regenerate Session ID twice, also fixes tests
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'lib/private/User')
-rw-r--r--lib/private/User/Session.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/private/User/Session.php b/lib/private/User/Session.php
index dca5ff394ac..9bbf62b5275 100644
--- a/lib/private/User/Session.php
+++ b/lib/private/User/Session.php
@@ -328,10 +328,11 @@ class Session implements IUserSession, Emitter {
/**
* @param IUser $user
* @param array $loginDetails
+ * @param bool $regenerateSessionId
* @return bool
* @throws LoginException
*/
- public function completeLogin(IUser $user, array $loginDetails) {
+ public function completeLogin(IUser $user, array $loginDetails, $regenerateSessionId = true) {
if (!$user->isEnabled()) {
// disabled users can not log in
// injecting l10n does not work - there is a circular dependency between session and \OCP\L10N\IFactory
@@ -339,7 +340,9 @@ class Session implements IUserSession, Emitter {
throw new LoginException($message);
}
- $this->session->regenerateId();
+ if($regenerateSessionId) {
+ $this->session->regenerateId();
+ }
$this->setUser($user);
$this->setLoginName($loginDetails['loginName']);
@@ -536,7 +539,7 @@ class Session implements IUserSession, Emitter {
return false;
}
- return $this->completeLogin($user, ['loginName' => $uid, 'password' => $password]);
+ return $this->completeLogin($user, ['loginName' => $uid, 'password' => $password], false);
}
/**
@@ -570,7 +573,7 @@ class Session implements IUserSession, Emitter {
return false;
}
- return $this->completeLogin($user, ['loginName' => $uid, 'password' => $password, 'token' => $dbToken]);
+ return $this->completeLogin($user, ['loginName' => $uid, 'password' => $password, 'token' => $dbToken], false);
}
/**