summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2018-04-06 22:26:05 +0200
committerGitHub <noreply@github.com>2018-04-06 22:26:05 +0200
commita13440d46a709b972512ddbb46c084141cdeb99a (patch)
treeee0b9dc94ba631fb87d77c7156a01dc41a721aa6 /core
parente970e9f7106c094d49fd3ed49244fb073b97e381 (diff)
parent33b93db953e66b77c71b67f74f8d7d1039b0056a (diff)
downloadnextcloud-server-a13440d46a709b972512ddbb46c084141cdeb99a.tar.gz
nextcloud-server-a13440d46a709b972512ddbb46c084141cdeb99a.zip
Merge pull request #9109 from nextcloud/feature/8004/always_remember
Always remember me
Diffstat (limited to 'core')
-rw-r--r--core/Controller/LoginController.php10
-rw-r--r--core/templates/login.php10
2 files changed, 4 insertions, 16 deletions
diff --git a/core/Controller/LoginController.php b/core/Controller/LoginController.php
index d0a91320e1f..ffa5b10fc2f 100644
--- a/core/Controller/LoginController.php
+++ b/core/Controller/LoginController.php
@@ -33,6 +33,7 @@
namespace OC\Core\Controller;
+use OC\Authentication\Token\IToken;
use OC\Authentication\TwoFactorAuth\Manager;
use OC\Security\Bruteforce\Throttler;
use OC\User\Session;
@@ -137,11 +138,10 @@ class LoginController extends Controller {
*
* @param string $user
* @param string $redirect_url
- * @param string $remember_login
*
* @return TemplateResponse|RedirectResponse
*/
- public function showLoginForm($user, $redirect_url, $remember_login) {
+ public function showLoginForm($user, $redirect_url) {
if ($this->userSession->isLoggedIn()) {
return new RedirectResponse(OC_Util::getDefaultPageUrl());
}
@@ -184,8 +184,6 @@ class LoginController extends Controller {
}
$parameters['alt_login'] = OC_App::getAlternativeLogIns();
- $parameters['rememberLoginState'] = !empty($remember_login) ? $remember_login : 0;
- $parameters['hideRemeberLoginState'] = !empty($redirect_url) && $this->session->exists('client.flow.state.token');
if ($user !== null && $user !== '') {
$parameters['loginName'] = $user;
@@ -240,7 +238,7 @@ class LoginController extends Controller {
* @param string $timezone_offset
* @return RedirectResponse
*/
- public function tryLogin($user, $password, $redirect_url, $remember_login = false, $timezone = '', $timezone_offset = '') {
+ public function tryLogin($user, $password, $redirect_url, $remember_login = true, $timezone = '', $timezone_offset = '') {
if(!is_string($user)) {
throw new \InvalidArgumentException('Username must be string');
}
@@ -288,7 +286,7 @@ class LoginController extends Controller {
// TODO: remove password checks from above and let the user session handle failures
// requires https://github.com/owncloud/core/pull/24616
$this->userSession->completeLogin($loginResult, ['loginName' => $user, 'password' => $password]);
- $this->userSession->createSessionToken($this->request, $loginResult->getUID(), $user, $password, (int)$remember_login);
+ $this->userSession->createSessionToken($this->request, $loginResult->getUID(), $user, $password, IToken::REMEMBER);
// User has successfully logged in, now remove the password reset link, when it is available
$this->config->deleteUserValue($loginResult->getUID(), 'core', 'lostpassword');
diff --git a/core/templates/login.php b/core/templates/login.php
index 3633400b312..ee1ce6a6870 100644
--- a/core/templates/login.php
+++ b/core/templates/login.php
@@ -76,16 +76,6 @@ script('core', 'merged-login');
<?php } ?>
<div class="login-additional">
- <?php if (!$_['hideRemeberLoginState']) { ?>
- <div class="remember-login-container">
- <?php if ($_['rememberLoginState'] === 0) { ?>
- <input type="checkbox" name="remember_login" value="1" id="remember_login" class="checkbox checkbox--white">
- <?php } else { ?>
- <input type="checkbox" name="remember_login" value="1" id="remember_login" class="checkbox checkbox--white" checked="checked">
- <?php } ?>
- <label for="remember_login"><?php p($l->t('Stay logged in')); ?></label>
- </div>
- <?php } ?>
<?php if (!empty($_['canResetPassword'])) { ?>
<div class="lost-password-container">
<a id="lost-password" href="<?php p($_['resetPasswordLink']); ?>">