mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-17 22:10:23 +01:00
Compare commits
18 Commits
revert-pas
...
v0.6.x
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0c62b0a984 | ||
|
|
a1f49f6ccf | ||
|
|
7682b56d78 | ||
|
|
6858a250c9 | ||
|
|
176a2153d5 | ||
|
|
fe1c38605a | ||
|
|
37fe854f46 | ||
|
|
b603341af6 | ||
|
|
989262fb10 | ||
|
|
eec524e9f4 | ||
|
|
73429e8771 | ||
|
|
47adafb4d7 | ||
|
|
af0d7a5ce6 | ||
|
|
cb32d68e3a | ||
|
|
03ba90c648 | ||
|
|
dbb6a0be1c | ||
|
|
4686ae9923 | ||
|
|
616bc68ebd |
2751
npm-shrinkwrap.json
generated
Normal file
2751
npm-shrinkwrap.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -2,7 +2,7 @@
|
|||||||
"name": "nodebb",
|
"name": "nodebb",
|
||||||
"license": "GPLv3 or later",
|
"license": "GPLv3 or later",
|
||||||
"description": "NodeBB Forum",
|
"description": "NodeBB Forum",
|
||||||
"version": "0.6.1-dev",
|
"version": "0.6.1",
|
||||||
"homepage": "http://www.nodebb.org",
|
"homepage": "http://www.nodebb.org",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@@ -59,7 +59,7 @@
|
|||||||
"socket.io-redis": "^0.1.3",
|
"socket.io-redis": "^0.1.3",
|
||||||
"socketio-wildcard": "~0.1.1",
|
"socketio-wildcard": "~0.1.1",
|
||||||
"string": "^3.0.0",
|
"string": "^3.0.0",
|
||||||
"templates.js": "^0.1.15",
|
"templates.js": "^0.1.12",
|
||||||
"uglify-js": "git+https://github.com/julianlam/UglifyJS2.git",
|
"uglify-js": "git+https://github.com/julianlam/UglifyJS2.git",
|
||||||
"underscore": "~1.7.0",
|
"underscore": "~1.7.0",
|
||||||
"validator": "~3.28.0",
|
"validator": "~3.28.0",
|
||||||
|
|||||||
@@ -154,8 +154,8 @@ define('admin/manage/groups', [
|
|||||||
socket.emit('admin.user.search', {query: searchText}, function(err, results) {
|
socket.emit('admin.user.search', {query: searchText}, function(err, results) {
|
||||||
if (!err && results && results.users.length > 0) {
|
if (!err && results && results.users.length > 0) {
|
||||||
var numResults = results.users.length, x;
|
var numResults = results.users.length, x;
|
||||||
if (numResults > 4) {
|
if (numResults > 20) {
|
||||||
numResults = 4;
|
numResults = 20;
|
||||||
}
|
}
|
||||||
|
|
||||||
groupDetailsSearchResults.empty();
|
groupDetailsSearchResults.empty();
|
||||||
|
|||||||
@@ -7,11 +7,12 @@ define('forum/account/header', function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
function displayAccountMenus() {
|
function displayAccountMenus() {
|
||||||
$('.account-sub-links .plugin-link').each(function() {
|
if (!app.user.uid || app.user.uid !== parseInt(ajaxify.variables.get('theirid'), 10)) {
|
||||||
var $this = $(this);
|
$('.account-sub-links .plugin-link.private').each(function() {
|
||||||
$this.toggleClass('hide', $this.hasClass('private'));
|
$(this).addClass('hide');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function selectActivePill() {
|
function selectActivePill() {
|
||||||
$('.account-sub-links li').removeClass('active').each(function() {
|
$('.account-sub-links li').removeClass('active').each(function() {
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ module.exports = function(db, module) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
module.pexpire = function(key, ms, callback) {
|
module.pexpire = function(key, ms, callback) {
|
||||||
module.expireAt(key, Date.now() + parseInt(ms, 10), callback);
|
module.pexpireAt(key, Date.now() + parseInt(ms, 10), callback);
|
||||||
};
|
};
|
||||||
|
|
||||||
module.pexpireAt = function(key, timestamp, callback) {
|
module.pexpireAt = function(key, timestamp, callback) {
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ var async = require('async'),
|
|||||||
"dependencies": ["redis@~0.10.1", "connect-redis@~2.0.0"]
|
"dependencies": ["redis@~0.10.1", "connect-redis@~2.0.0"]
|
||||||
},
|
},
|
||||||
"mongo": {
|
"mongo": {
|
||||||
"dependencies": ["mongodb", "connect-mongo"]
|
"dependencies": ["mongodb@^1.4.30", "connect-mongo@^0.7.0"]
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ var nconf = require('nconf'),
|
|||||||
winston = require('winston'),
|
winston = require('winston'),
|
||||||
EventEmitter = require('events').EventEmitter;
|
EventEmitter = require('events').EventEmitter;
|
||||||
|
|
||||||
|
var channelName;
|
||||||
|
|
||||||
var PubSub = function() {
|
var PubSub = function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
if (nconf.get('redis')) {
|
if (nconf.get('redis')) {
|
||||||
@@ -13,10 +15,11 @@ var PubSub = function() {
|
|||||||
var subClient = redis.connect();
|
var subClient = redis.connect();
|
||||||
this.pubClient = redis.connect();
|
this.pubClient = redis.connect();
|
||||||
|
|
||||||
subClient.subscribe('pubsub_channel');
|
channelName = 'db:' + nconf.get('redis:database') + 'pubsub_channel';
|
||||||
|
subClient.subscribe(channelName);
|
||||||
|
|
||||||
subClient.on('message', function(channel, message) {
|
subClient.on('message', function(channel, message) {
|
||||||
if (channel !== 'pubsub_channel') {
|
if (channel !== channelName) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -34,7 +37,7 @@ util.inherits(PubSub, EventEmitter);
|
|||||||
|
|
||||||
PubSub.prototype.publish = function(event, data) {
|
PubSub.prototype.publish = function(event, data) {
|
||||||
if (this.pubClient) {
|
if (this.pubClient) {
|
||||||
this.pubClient.publish('pubsub_channel', JSON.stringify({event: event, data: data}));
|
this.pubClient.publish(channelName, JSON.stringify({event: event, data: data}));
|
||||||
} else {
|
} else {
|
||||||
this.emit(event, data);
|
this.emit(event, data);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,6 +57,10 @@ SocketMeta.rooms.enter = function(socket, data, callback) {
|
|||||||
return callback(new Error('[[error:invalid-data]]'));
|
return callback(new Error('[[error:invalid-data]]'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (data.enter && data.enter.startsWith('uid_') && data.enter !== 'uid_' + socket.uid) {
|
||||||
|
return callback(new Error('[[error:not-allowed]]'));
|
||||||
|
}
|
||||||
|
|
||||||
if (socket.currentRoom) {
|
if (socket.currentRoom) {
|
||||||
socket.leave(socket.currentRoom);
|
socket.leave(socket.currentRoom);
|
||||||
if (socket.currentRoom.indexOf('topic') !== -1) {
|
if (socket.currentRoom.indexOf('topic') !== -1) {
|
||||||
@@ -70,6 +74,10 @@ SocketMeta.rooms.enter = function(socket, data, callback) {
|
|||||||
socket.currentRoom = data.enter;
|
socket.currentRoom = data.enter;
|
||||||
if (data.enter.indexOf('topic') !== -1) {
|
if (data.enter.indexOf('topic') !== -1) {
|
||||||
data.uid = socket.uid;
|
data.uid = socket.uid;
|
||||||
|
data.picture = validator.escape(data.picture);
|
||||||
|
data.username = validator.escape(data.username);
|
||||||
|
data.userslug = validator.escape(data.userslug);
|
||||||
|
|
||||||
websockets.in(data.enter).emit('event:user_enter', data);
|
websockets.in(data.enter).emit('event:user_enter', data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
var async = require('async'),
|
var async = require('async'),
|
||||||
nconf = require('nconf'),
|
nconf = require('nconf'),
|
||||||
|
db = require('../database'),
|
||||||
user = require('../user'),
|
user = require('../user'),
|
||||||
groups = require('../groups'),
|
groups = require('../groups'),
|
||||||
topics = require('../topics'),
|
topics = require('../topics'),
|
||||||
@@ -13,6 +14,7 @@ var async = require('async'),
|
|||||||
websockets = require('./index'),
|
websockets = require('./index'),
|
||||||
meta = require('../meta'),
|
meta = require('../meta'),
|
||||||
events = require('../events'),
|
events = require('../events'),
|
||||||
|
emailer = require('../emailer'),
|
||||||
SocketUser = {};
|
SocketUser = {};
|
||||||
|
|
||||||
SocketUser.exists = function(socket, data, callback) {
|
SocketUser.exists = function(socket, data, callback) {
|
||||||
@@ -87,18 +89,38 @@ SocketUser.reset.valid = function(socket, code, callback) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
SocketUser.reset.commit = function(socket, data, callback) {
|
SocketUser.reset.commit = function(socket, data, callback) {
|
||||||
if(data && data.code && data.password) {
|
if (!data || !data.code || !data.password) {
|
||||||
user.reset.commit(data.code, data.password, function(err) {
|
return callback(new Error('[[error:invalid-data]]'));
|
||||||
|
}
|
||||||
|
|
||||||
|
async.parallel({
|
||||||
|
uid: async.apply(db.getObjectField, 'reset:uid', data.code),
|
||||||
|
reset: async.apply(user.reset.commit, data.code, data.password)
|
||||||
|
}, function(err, results) {
|
||||||
if (err) {
|
if (err) {
|
||||||
return callback(err);
|
return callback(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var uid = results.uid,
|
||||||
|
now = new Date(),
|
||||||
|
parsedDate = now.getFullYear() + '/' + (now.getMonth()+1) + '/' + now.getDate();
|
||||||
|
|
||||||
|
user.getUserField(uid, 'username', function(err, username) {
|
||||||
|
emailer.send('reset_notify', uid, {
|
||||||
|
username: username,
|
||||||
|
date: parsedDate,
|
||||||
|
site_title: meta.config.title || 'NodeBB',
|
||||||
|
subject: '[[email:reset.notify.subject]]'
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
events.log({
|
events.log({
|
||||||
type: 'password-reset',
|
type: 'password-reset',
|
||||||
uid: socket.uid,
|
uid: uid,
|
||||||
ip: socket.ip
|
ip: socket.ip
|
||||||
});
|
});
|
||||||
|
callback();
|
||||||
});
|
});
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
SocketUser.checkStatus = function(socket, uid, callback) {
|
SocketUser.checkStatus = function(socket, uid, callback) {
|
||||||
@@ -137,6 +159,7 @@ SocketUser.changePassword = function(socket, data, callback) {
|
|||||||
targetUid: data.uid,
|
targetUid: data.uid,
|
||||||
ip: socket.ip
|
ip: socket.ip
|
||||||
});
|
});
|
||||||
|
callback();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -250,11 +250,24 @@ Upgrade.upgrade = function(callback) {
|
|||||||
}, next);
|
}, next);
|
||||||
}
|
}
|
||||||
|
|
||||||
Groups.list({showSystemGroups: true}, function(err, groups) {
|
async.waterfall([
|
||||||
|
async.apply(db.getSetMembers, 'groups'),
|
||||||
|
function(groups, next) {
|
||||||
|
async.filter(groups, function(group, next) {
|
||||||
|
db.getObjectField('group:' + group, 'hidden', function(err, hidden) {
|
||||||
|
next(!parseInt(hidden, 10));
|
||||||
|
}, next);
|
||||||
|
}, function(groups) {
|
||||||
|
next(null, groups);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
], function(err, groups) {
|
||||||
if (err) {
|
if (err) {
|
||||||
return next(err);
|
return next(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
groups.push('administrators', 'registered-users');
|
||||||
|
|
||||||
async.eachLimit(cids, 50, function(cid, next) {
|
async.eachLimit(cids, 50, function(cid, next) {
|
||||||
upgradePrivileges(cid, groups, next);
|
upgradePrivileges(cid, groups, next);
|
||||||
}, next);
|
}, next);
|
||||||
@@ -441,12 +454,12 @@ Upgrade.upgrade = function(callback) {
|
|||||||
|
|
||||||
var now = Date.now();
|
var now = Date.now();
|
||||||
|
|
||||||
|
userSettings = userSettings.filter(function(setting) {
|
||||||
|
return setting && setting.dailyDigestFreq !== 'off';
|
||||||
|
});
|
||||||
|
|
||||||
async.eachLimit(userSettings, 50, function(setting, next) {
|
async.eachLimit(userSettings, 50, function(setting, next) {
|
||||||
if (setting.dailyDigestFreq !== 'off') {
|
|
||||||
db.sortedSetAdd('digest:' + setting.dailyDigestFreq + ':uids', now, setting.uid, next);
|
db.sortedSetAdd('digest:' + setting.dailyDigestFreq + ':uids', now, setting.uid, next);
|
||||||
} else {
|
|
||||||
next(false);
|
|
||||||
}
|
|
||||||
}, function(err) {
|
}, function(err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
winston.error('[2014/12/20] Error encountered while updating digest settings');
|
winston.error('[2014/12/20] Error encountered while updating digest settings');
|
||||||
|
|||||||
@@ -50,7 +50,7 @@
|
|||||||
<input type="number" class="form-control" value="8" data-field="minimumPostLength">
|
<input type="number" class="form-control" value="8" data-field="minimumPostLength">
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>Minimum Post Length</label>
|
<label>Maximum Post Length</label>
|
||||||
<input type="number" class="form-control" value="32767" data-field="maximumPostLength">
|
<input type="number" class="form-control" value="32767" data-field="maximumPostLength">
|
||||||
</div>
|
</div>
|
||||||
<div class="checkbox">
|
<div class="checkbox">
|
||||||
|
|||||||
Reference in New Issue
Block a user