diff --git a/public/language/en_GB/error.json b/public/language/en_GB/error.json index 7e239fb5e2..25e3afa69f 100644 --- a/public/language/en_GB/error.json +++ b/public/language/en_GB/error.json @@ -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-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-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-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-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", "group-name-too-short": "Group name too short", + "group-name-too-long": "Group name too long", "group-already-exists": "Group already exists", "group-name-change-not-allowed": "Group name change not allowed", "group-already-member": "Already part of this group", diff --git a/src/groups/create.js b/src/groups/create.js index 2910d96294..353c0aca49 100644 --- a/src/groups/create.js +++ b/src/groups/create.js @@ -1,10 +1,10 @@ 'use strict'; -var async = require('async'), - meta = require('../meta'), - plugins = require('../plugins'), - utils = require('../../public/src/utils'), - db = require('../database'); +var async = require('async'); +var meta = require('../meta'); +var plugins = require('../plugins'); +var utils = require('../../public/src/utils'); +var db = require('../database'); module.exports = function(Groups) { @@ -79,6 +79,10 @@ module.exports = function(Groups) { 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) { return callback(new Error('[[error:invalid-group-name]]')); } diff --git a/src/views/admin/settings/group.tpl b/src/views/admin/settings/group.tpl index 13b5121b24..8e1ee54b3f 100644 --- a/src/views/admin/settings/group.tpl +++ b/src/views/admin/settings/group.tpl @@ -28,6 +28,9 @@
If enabled, users can create groups (Default: disabled)
+ + +