v1.18.x
Barış Soner Uşaklı 8 years ago
parent 54a9e7eab9
commit 5e4b9479d4

@ -34,6 +34,8 @@
"registration.max-invites": "Maximum Invitations per User",
"max-invites": "Maximum Invitations per User",
"max-invites-help": "0 for no restriction. Admins get infinite invitations<br>Only applicable for \"Invite Only\"",
"invite-expiration": "Invite expiration",
"invite-expiration-help": "# of days invitations expire in.",
"min-username-length": "Minimum Username Length",
"max-username-length": "Maximum Username Length",
"min-password-length": "Minimum Password Length",

@ -50,7 +50,7 @@ module.exports = function (User) {
var token = utils.generateUUID();
var registerLink = nconf.get('url') + '/register?token=' + token + '&email=' + encodeURIComponent(email);
var oneDay = 86400000;
var expireIn = (parseInt(meta.config.inviteExpiration, 10) || 1) * 86400000;
async.waterfall([
function (next) {
@ -76,7 +76,7 @@ module.exports = function (User) {
db.set('invitation:email:' + email, token, next);
},
function (next) {
db.pexpireAt('invitation:email:' + email, Date.now() + oneDay, next);
db.pexpireAt('invitation:email:' + email, Date.now() + expireIn, next);
},
function (next) {
User.getUserField(uid, 'username', next);

@ -155,6 +155,13 @@
[[admin/settings/user:max-invites-help]]
</p>
</div>
<div class="form-group">
<label>[[admin/settings/user:invite-expiration]]</label>
<input type="number" class="form-control" data-field="inviteExpiration" placeholder="1">
<p class="help-block">
[[admin/settings/user:invite-expiration-help]]
</p>
</div>
<div class="form-group">
<label>[[admin/settings/user:min-username-length]]</label>
<input type="text" class="form-control" value="2" data-field="minimumUsernameLength">

Loading…
Cancel
Save