v1.18.x
Barış Soner Uşaklı 7 years ago
parent 5ee4529a8e
commit 2e579ee0f9

@ -111,5 +111,6 @@
"hsts-preload": 0, "hsts-preload": 0,
"hsts-enabled": 0, "hsts-enabled": 0,
"eventLoopLagThreshold": 100, "eventLoopLagThreshold": 100,
"eventLoopInterval": 500 "eventLoopInterval": 500,
"onlineCutoff": 30
} }

@ -27,6 +27,8 @@
"lockout-duration": "Account Lockout Duration (minutes)", "lockout-duration": "Account Lockout Duration (minutes)",
"login-days": "Days to remember user login sessions", "login-days": "Days to remember user login sessions",
"password-expiry-days": "Force password reset after a set number of days", "password-expiry-days": "Force password reset after a set number of days",
"online-cutoff": "Minutes after user is considered inactive",
"online-cutoff-help": "If user performs no actions for this duration, they are considered inactive and they do not receive realtime updates.",
"registration": "User Registration", "registration": "User Registration",
"registration-type": "Registration Type", "registration-type": "Registration Type",
"registration-type.normal": "Normal", "registration-type.normal": "Normal",

@ -43,7 +43,7 @@ User.getUidsFromSet = function (set, start, stop, callback) {
if (set === 'users:online') { if (set === 'users:online') {
var count = parseInt(stop, 10) === -1 ? stop : stop - start + 1; var count = parseInt(stop, 10) === -1 ? stop : stop - start + 1;
var now = Date.now(); var now = Date.now();
db.getSortedSetRevRangeByScore(set, start, count, '+inf', now - 300000, callback); db.getSortedSetRevRangeByScore(set, start, count, '+inf', now - (meta.config.onlineCutoff * 60000), callback);
} else { } else {
db.getSortedSetRevRange(set, start, stop, callback); db.getSortedSetRevRange(set, start, stop, callback);
} }

@ -144,6 +144,9 @@
<input type="text" class="form-control" data-field="loginSeconds" placeholder="Seconds" /> <input type="text" class="form-control" data-field="loginSeconds" placeholder="Seconds" />
<p class="help-block">Note that only one of these values will be used. If there is no <i>seconds</i> value we fall back to <i>days</i>. If <p class="help-block">Note that only one of these values will be used. If there is no <i>seconds</i> value we fall back to <i>days</i>. If
there is no <i>days</i> value we default to <i>14 days</i>.</p> there is no <i>days</i> value we default to <i>14 days</i>.</p>
<label>[[admin/settings/user:online-cutoff]]</label>
<input type="text" class="form-control" data-field="onlineCutoff">
<p class="help-block">[[admin/settings/user:online-cutoff-help]]</p>
</div> </div>
</form> </form>
</div> </div>

Loading…
Cancel
Save