diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2019-12-03 19:31:31 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2019-12-03 19:31:31 +0100 |
commit | c106a9d293473233bd2e0dcd5a8e7789a98d8ab6 (patch) | |
tree | 4bef12f2c0a1ce23c19363c04e3e021e983333b9 /lib/private/Setup.php | |
parent | cd71ad0e50ecafdbad67c99d77bd77b32bdd5ca5 (diff) | |
download | nextcloud-server-c106a9d293473233bd2e0dcd5a8e7789a98d8ab6.tar.gz nextcloud-server-c106a9d293473233bd2e0dcd5a8e7789a98d8ab6.zip |
Set last-password-confirmation for setup
Else you have to enter your password directly after setup if you do
anything admin worthy.
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/private/Setup.php')
-rw-r--r-- | lib/private/Setup.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/private/Setup.php b/lib/private/Setup.php index 266c70846c6..4ebd5618189 100644 --- a/lib/private/Setup.php +++ b/lib/private/Setup.php @@ -49,6 +49,7 @@ use OC\Authentication\Token\DefaultTokenCleanupJob; use OC\Authentication\Token\DefaultTokenProvider; use OC\Log\Rotate; use OC\Preview\BackgroundCleanupJob; +use OCP\AppFramework\Utility\ITimeFactory; use OCP\Defaults; use OCP\IGroup; use OCP\IL10N; @@ -421,6 +422,9 @@ class Setup { $userSession->login($username, $password); $userSession->createSessionToken($request, $userSession->getUser()->getUID(), $username, $password); + $session = $userSession->getSession(); + $session->set('last-password-confirm', \OC::$server->query(ITimeFactory::class)->getTime()); + // Set email for admin if (!empty($options['adminemail'])) { $config->setUserValue($user->getUID(), 'settings', 'email', $options['adminemail']); |