summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Chan <plus.vincchan@gmail.com>2016-02-10 12:37:38 +0100
committerVincent Chan <plus.vincchan@gmail.com>2016-02-10 12:37:38 +0100
commite7859f705c7128e3af15dbde5438c782065ac874 (patch)
tree8687c3f8d55f3298dbdbfdea6296e02b70efbd6c
parenta8d9eb5320132c408faba5dbfad53cc8a169a9f7 (diff)
downloadnextcloud-server-e7859f705c7128e3af15dbde5438c782065ac874.tar.gz
nextcloud-server-e7859f705c7128e3af15dbde5438c782065ac874.zip
Remember previous state of remember login checkbox
fixes #22205
-rw-r--r--core/js/login.js5
-rw-r--r--core/templates/login.php7
2 files changed, 11 insertions, 1 deletions
diff --git a/core/js/login.js b/core/js/login.js
index 33ec868cb23..186b21423f3 100644
--- a/core/js/login.js
+++ b/core/js/login.js
@@ -21,4 +21,9 @@ OC.Login = _.extend(OC.Login || {}, {
});
$(document).ready(function() {
$('form[name=login]').submit(OC.Login.onLogin);
+
+ //set previous state of remember login checkbox
+ if($('label[for="remember_login"]').attr('previously') === 'checked'){
+ $('#remember_login').prop('checked', true);
+ }
});
diff --git a/core/templates/login.php b/core/templates/login.php
index e87b871c67e..590b035bce3 100644
--- a/core/templates/login.php
+++ b/core/templates/login.php
@@ -68,7 +68,12 @@ script('core', [
<?php if ($_['rememberLoginAllowed'] === true) : ?>
<div class="remember-login-container">
<input type="checkbox" name="remember_login" value="1" id="remember_login" class="checkbox checkbox--white">
- <label for="remember_login"><?php p($l->t('Stay logged in')); ?></label>
+ <?php if ($_POST['remember_login'] !== '1') { ?>
+ <label for="remember_login">
+ <?php } else { ?>
+ <label previously="checked" for="remember_login">
+ <?php } ?>
+ <?php p($l->t('Stay logged in')); ?></label>
</div>
<?php endif; ?>
<input type="hidden" name="timezone-offset" id="timezone-offset"/>