v1.18.x
barisusakli 9 years ago
parent 596af5d82b
commit 1102a685d9

@ -53,10 +53,10 @@
"post-edit-duration-expired-minutes": "You are only allowed to edit posts for %1 minute(s) after posting", "post-edit-duration-expired-minutes": "You are only allowed to edit posts for %1 minute(s) after posting",
"post-edit-duration-expired-minutes-seconds": "You are only allowed to edit posts for %1 minute(s) %2 second(s) after posting", "post-edit-duration-expired-minutes-seconds": "You are only allowed to edit posts for %1 minute(s) %2 second(s) after posting",
"post-edit-duration-expired-hours": "You are only allowed to edit posts for %1 hour(s) after posting", "post-edit-duration-expired-hours": "You are only allowed to edit posts for %1 hour(s) after posting",
"post-edit-duration-expired-hours-minutes": "You are only allowed to edit posts for %1 hour(s) %2 minute(s) after posting", "post-edit-duration-expired-hours-minutes": "You are only allowed to edit posts for %1 hour(s) %2 minute(s) after posting",
"post-edit-duration-expired-days": "You are only allowed to edit posts for %1 day(s) after posting", "post-edit-duration-expired-days": "You are only allowed to edit posts for %1 day(s) after posting",
"post-edit-duration-expired-days-hours": "You are only allowed to edit posts for %1 day(s) %2 hour(s) after posting", "post-edit-duration-expired-days-hours": "You are only allowed to edit posts for %1 day(s) %2 hour(s) after posting",
"content-too-short": "Please enter a longer post. Posts should contain at least %1 character(s).", "content-too-short": "Please enter a longer post. Posts should contain at least %1 character(s).",
"content-too-long": "Please enter a shorter post. Posts can't be longer than %1 character(s).", "content-too-long": "Please enter a shorter post. Posts can't be longer than %1 character(s).",
@ -86,6 +86,7 @@
"invalid-file-type": "Invalid file type. Allowed types are: %1", "invalid-file-type": "Invalid file type. Allowed types are: %1",
"group-name-too-short": "Group name too short", "group-name-too-short": "Group name too short",
"group-name-too-long": "Group name too long",
"group-already-exists": "Group already exists", "group-already-exists": "Group already exists",
"group-name-change-not-allowed": "Group name change not allowed", "group-name-change-not-allowed": "Group name change not allowed",
"group-already-member": "Already part of this group", "group-already-member": "Already part of this group",

@ -1,10 +1,10 @@
'use strict'; 'use strict';
var async = require('async'), var async = require('async');
meta = require('../meta'), var meta = require('../meta');
plugins = require('../plugins'), var plugins = require('../plugins');
utils = require('../../public/src/utils'), var utils = require('../../public/src/utils');
db = require('../database'); var db = require('../database');
module.exports = function(Groups) { module.exports = function(Groups) {
@ -79,6 +79,10 @@ module.exports = function(Groups) {
return callback(new Error('[[error:group-name-too-short]]')); return callback(new Error('[[error:group-name-too-short]]'));
} }
if (name.length > (parseInt(meta.config.maximumGroupNameLength, 10) || 255)) {
return callback(new Error('[[error:group-name-too-long]]'));
}
if (name.indexOf('/') !== -1) { if (name.indexOf('/') !== -1) {
return callback(new Error('[[error:invalid-group-name]]')); return callback(new Error('[[error:invalid-group-name]]'));
} }

@ -28,6 +28,9 @@
<p class="help-block"> <p class="help-block">
If enabled, users can create groups <em>(Default: disabled)</em> If enabled, users can create groups <em>(Default: disabled)</em>
</p> </p>
<label>Maximum Group Name Length</label>
<input class="form-control" type="text" placeholder="255" data-field="maximumGroupNameLength" />
</form> </form>
</div> </div>
</div> </div>

Loading…
Cancel
Save