diff --git a/public/src/forum/login.js b/public/src/forum/login.js index 563db9d64e..4c8b3a0128 100644 --- a/public/src/forum/login.js +++ b/public/src/forum/login.js @@ -6,6 +6,7 @@ define(function() { var loginData = { 'username': $('#username').val(), 'password': $('#password').val(), + 'remember': $('#remember').prop('checked'), '_csrf': $('#csrf-token').val() }; diff --git a/public/templates/admin/settings.tpl b/public/templates/admin/settings.tpl index 823ce09112..294ac35ebd 100644 --- a/public/templates/admin/settings.tpl +++ b/public/templates/admin/settings.tpl @@ -84,18 +84,34 @@ Convert profile image uploads to PNG - -
- Minimum Username Length
-
- Maximum Username Length
-
- Minimum Password Length
-
- Maximum Signature Length
-
- Forum Terms of Use (Leave blank to disable)
-
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
diff --git a/public/templates/login.tpl b/public/templates/login.tpl index 8f7807421d..c566d3e4a1 100644 --- a/public/templates/login.tpl +++ b/public/templates/login.tpl @@ -29,15 +29,15 @@ - +

diff --git a/src/routes/authentication.js b/src/routes/authentication.js index 289a165e76..970e28ecbf 100644 --- a/src/routes/authentication.js +++ b/src/routes/authentication.js @@ -113,6 +113,14 @@ message: info.message }); } + + // Alter user cookie depending on passed-in option + if (req.body.remember === 'true') { + req.session.cookie.maxAge = 60*60*24*parseInt(meta.configs.loginDays || 14, 10); + } else { + req.session.cookie.expires = false; + } + req.login({ uid: user.uid }, function() {