diff --git a/core/config.js b/core/config.js index 28d00c4f..6808857f 100644 --- a/core/config.js +++ b/core/config.js @@ -83,7 +83,7 @@ function getDefaultConfig() { newUserNames : [ 'new', 'apply' ], // Names reserved for applying // :TODO: Mystic uses TRASHCAN.DAT for this -- is there a reason to support something like that? - badUserNames : [ 'sysop', 'admin', 'administrator', 'root' ], + badUserNames : [ 'sysop', 'admin', 'administrator', 'root', 'all' ], }, // :TODO: better name for "defaults"... which is redundant here! diff --git a/core/message_area.js b/core/message_area.js index 7444ede0..7a22b5b0 100644 --- a/core/message_area.js +++ b/core/message_area.js @@ -78,8 +78,13 @@ function changeMessageArea(client, areaName, cb) { } }, function validateAccess(area, callback) { - // :TODO: validate user has access to |area| -- must belong to group(s) specified - callback(null, area); + if(_.isArray(area.groups) && ! + client.user.isGroupMember(area.groups)) + { + callback(new Error('User does not have access to this area')); + } else { + callback(null, area); + } }, function changeArea(area, callback) { client.user.persistProperty('message_area_name', area.name, function persisted(err) { diff --git a/core/user.js b/core/user.js index c39a8435..ea5246c8 100644 --- a/core/user.js +++ b/core/user.js @@ -48,8 +48,18 @@ function User() { this.isSysOp = this.isRoot; // alias - this.isGroupMember = function(groupName) { - return self.groups.indexOf(groupName) > -1; + this.isGroupMember = function(groupNames) { + if(_.isString(groupNames)) { + groupNames = [ groupNames ]; + } + + groupNames.forEach(function groupEntry(groupName) { + if(-1 === self.groups.indexOf(groupName)) { + return false; + } + }); + + return true; }; this.getLegacySecurityLevel = function() { diff --git a/mods/art/WELCOME2.ANS b/mods/art/WELCOME2.ANS new file mode 100644 index 00000000..cfc3ed42 Binary files /dev/null and b/mods/art/WELCOME2.ANS differ diff --git a/mods/menu.hjson b/mods/menu.hjson index 3b70f49a..8bb35190 100644 --- a/mods/menu.hjson +++ b/mods/menu.hjson @@ -1066,7 +1066,7 @@ } { value: { 1: 1 } - action: @menu:messageArea + action: @systemMethod:prevMenu } { value: { 1: 2 } diff --git a/mods/msg_list.js b/mods/msg_list.js index 97b4a5ea..2404aef9 100644 --- a/mods/msg_list.js +++ b/mods/msg_list.js @@ -144,7 +144,7 @@ MessageListModule.prototype.mciReady = function(mciData, cb) { to : mle.toUserName, ts : moment(mle.modTimestamp).format(dateTimeFormat), newIndicator : mle.messageId > self.lastReadId ? newIndicator : '', - } + }; } msgListView.setItems(_.map(self.messageList, function formatMsgListEntry(mle) {