aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/User/Session.php
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2016-12-05 20:57:15 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2016-12-05 20:57:15 +0100
commite368a745aa5f9eb53327b2875d9fade8b4e8398b (patch)
tree7e1b8f2338f5a5baeabc0d22c1bdd59876bf6590 /lib/private/User/Session.php
parentbea85adc087648f170d898ea5f16079cde820d35 (diff)
downloadnextcloud-server-e368a745aa5f9eb53327b2875d9fade8b4e8398b.tar.gz
nextcloud-server-e368a745aa5f9eb53327b2875d9fade8b4e8398b.zip
Set last-login-check on basic auth
Else the last-login-check fails hard because the session value is not set and thus defaults to 0. * Started with tests Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/private/User/Session.php')
-rw-r--r--lib/private/User/Session.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/private/User/Session.php b/lib/private/User/Session.php
index c3561cf64e3..dcda825b9db 100644
--- a/lib/private/User/Session.php
+++ b/lib/private/User/Session.php
@@ -423,6 +423,7 @@ class Session implements IUserSession, Emitter {
*
* @todo do not allow basic auth if the user is 2FA enforced
* @param IRequest $request
+ * @param OC\Security\Bruteforce\Throttler $throttler
* @return boolean if the login was successful
*/
public function tryBasicAuthLogin(IRequest $request,
@@ -440,6 +441,10 @@ class Session implements IUserSession, Emitter {
$this->session->set(
Auth::DAV_AUTHENTICATED, $this->getUser()->getUID()
);
+
+ // Set the last-password-confirm session to make the sudo mode work
+ $this->session->set('last-password-confirm', $this->timeFacory->getTime());
+
return true;
}
} catch (PasswordLoginForbiddenException $ex) {