dont allow priv group names

v1.18.x
barisusakli 9 years ago
parent 1e142a44cd
commit cbd637b2a2

@ -5,8 +5,10 @@ var groups = require('../../groups'),
Groups = {};
Groups.create = function(socket, data, callback) {
if(!data) {
if (!data) {
return callback(new Error('[[error:invalid-data]]'));
} else if (groups.isPrivilegeGroup(data.name)) {
return callback(new Error('[[error:invalid-group-name]]'));
}
groups.create({

@ -170,6 +170,8 @@ SocketGroups.create = function(socket, data, callback) {
return callback(new Error('[[error:no-privileges]]'));
} else if (parseInt(meta.config.allowGroupCreation, 10) !== 1) {
return callback(new Error('[[error:group-creation-disabled]]'));
} else if (groups.isPrivilegeGroup(data.name)) {
return callback(new Error('[[error:invalid-group-name]]'));
}

Loading…
Cancel
Save