Compare commits

...

18 Commits

Author SHA1 Message Date
Barış Soner Uşaklı
0c62b0a984 fix upgrade script 2015-08-21 16:06:27 -04:00
Barış Soner Uşaklı
a1f49f6ccf backport to 0.6.x 2015-05-14 13:56:12 -04:00
Barış Soner Uşaklı
7682b56d78 fix pubsub channels for multi dbs 2015-04-14 11:03:03 -04:00
Julian Lam
6858a250c9 hardcoding dependencies for mongodb modules for v0.6.x 2015-03-30 21:29:57 -04:00
barisusakli
176a2153d5 escape data on room enter 2015-03-25 10:57:23 -04:00
Barış Soner Uşaklı
fe1c38605a add missing emailer require 2015-03-19 16:07:29 -04:00
Barış Soner Uşaklı
37fe854f46 fix missing require db 2015-03-19 15:36:49 -04:00
Julian Lam
b603341af6 downgraded templates.js to 0.1.12, and updated shrinkwrap file to match 2015-03-18 16:08:47 -04:00
Barış Soner Uşaklı
989262fb10 Merge pull request #2861 from Ribesg/patch-3
Fix typo in admin Settings
2015-03-13 11:55:38 -04:00
Gael Ribes
eec524e9f4 Fix typo in admin Settings 2015-03-13 16:49:14 +01:00
Barış Soner Uşaklı
73429e8771 fix hidden links 2015-03-01 12:29:02 -05:00
Barış Soner Uşaklı
47adafb4d7 Conflicts:
src/database/mongo/main.js
2015-02-24 12:29:20 -05:00
Julian Lam
af0d7a5ce6 updated upgrade script so that it does not rely on Groups.list, as the method has changed between v0.5.0 and v0.6.0.
Also added setImmediate call so eachLimit doesn't explode
2015-02-19 19:48:06 -05:00
Barış Soner Uşaklı
cb32d68e3a up results to 20 2015-02-13 18:34:34 -05:00
Barış Soner Uşaklı
03ba90c648 update reset.commit 2015-02-11 21:56:45 -05:00
Barış Soner Uşaklı
dbb6a0be1c fix callbacks 2015-02-11 21:33:04 -05:00
Julian Lam
4686ae9923 0.6.1 2015-02-07 15:08:37 -05:00
Julian Lam
616bc68ebd added shrinkwrap file 2015-02-07 15:08:14 -05:00
11 changed files with 2833 additions and 34 deletions

2751
npm-shrinkwrap.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -2,7 +2,7 @@
"name": "nodebb",
"license": "GPLv3 or later",
"description": "NodeBB Forum",
"version": "0.6.1-dev",
"version": "0.6.1",
"homepage": "http://www.nodebb.org",
"repository": {
"type": "git",
@@ -59,7 +59,7 @@
"socket.io-redis": "^0.1.3",
"socketio-wildcard": "~0.1.1",
"string": "^3.0.0",
"templates.js": "^0.1.15",
"templates.js": "^0.1.12",
"uglify-js": "git+https://github.com/julianlam/UglifyJS2.git",
"underscore": "~1.7.0",
"validator": "~3.28.0",

View File

@@ -154,8 +154,8 @@ define('admin/manage/groups', [
socket.emit('admin.user.search', {query: searchText}, function(err, results) {
if (!err && results && results.users.length > 0) {
var numResults = results.users.length, x;
if (numResults > 4) {
numResults = 4;
if (numResults > 20) {
numResults = 20;
}
groupDetailsSearchResults.empty();

View File

@@ -7,10 +7,11 @@ define('forum/account/header', function() {
};
function displayAccountMenus() {
$('.account-sub-links .plugin-link').each(function() {
var $this = $(this);
$this.toggleClass('hide', $this.hasClass('private'));
});
if (!app.user.uid || app.user.uid !== parseInt(ajaxify.variables.get('theirid'), 10)) {
$('.account-sub-links .plugin-link.private').each(function() {
$(this).addClass('hide');
});
}
}
function selectActivePill() {

View File

@@ -138,7 +138,7 @@ module.exports = function(db, module) {
};
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) {

View File

@@ -13,7 +13,7 @@ var async = require('async'),
"dependencies": ["redis@~0.10.1", "connect-redis@~2.0.0"]
},
"mongo": {
"dependencies": ["mongodb", "connect-mongo"]
"dependencies": ["mongodb@^1.4.30", "connect-mongo@^0.7.0"]
}
};

View File

@@ -6,17 +6,20 @@ var nconf = require('nconf'),
winston = require('winston'),
EventEmitter = require('events').EventEmitter;
var channelName;
var PubSub = function() {
var self = this;
if (nconf.get('redis')) {
var redis = require('./database/redis');
var subClient = 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) {
if (channel !== 'pubsub_channel') {
if (channel !== channelName) {
return;
}
@@ -34,7 +37,7 @@ util.inherits(PubSub, EventEmitter);
PubSub.prototype.publish = function(event, data) {
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 {
this.emit(event, data);
}
@@ -42,4 +45,4 @@ PubSub.prototype.publish = function(event, data) {
var pubsub = new PubSub();
module.exports = pubsub;
module.exports = pubsub;

View File

@@ -57,6 +57,10 @@ SocketMeta.rooms.enter = function(socket, data, callback) {
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) {
socket.leave(socket.currentRoom);
if (socket.currentRoom.indexOf('topic') !== -1) {
@@ -70,6 +74,10 @@ SocketMeta.rooms.enter = function(socket, data, callback) {
socket.currentRoom = data.enter;
if (data.enter.indexOf('topic') !== -1) {
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);
}
}

View File

@@ -2,6 +2,7 @@
var async = require('async'),
nconf = require('nconf'),
db = require('../database'),
user = require('../user'),
groups = require('../groups'),
topics = require('../topics'),
@@ -13,6 +14,7 @@ var async = require('async'),
websockets = require('./index'),
meta = require('../meta'),
events = require('../events'),
emailer = require('../emailer'),
SocketUser = {};
SocketUser.exists = function(socket, data, callback) {
@@ -87,18 +89,38 @@ SocketUser.reset.valid = function(socket, code, callback) {
};
SocketUser.reset.commit = function(socket, data, callback) {
if(data && data.code && data.password) {
user.reset.commit(data.code, data.password, function(err) {
if (err) {
return callback(err);
}
events.log({
type: 'password-reset',
uid: socket.uid,
ip: socket.ip
if (!data || !data.code || !data.password) {
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) {
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({
type: 'password-reset',
uid: uid,
ip: socket.ip
});
callback();
});
};
SocketUser.checkStatus = function(socket, uid, callback) {
@@ -137,6 +159,7 @@ SocketUser.changePassword = function(socket, data, callback) {
targetUid: data.uid,
ip: socket.ip
});
callback();
});
};

View File

@@ -250,11 +250,24 @@ Upgrade.upgrade = function(callback) {
}, 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) {
return next(err);
}
groups.push('administrators', 'registered-users');
async.eachLimit(cids, 50, function(cid, next) {
upgradePrivileges(cid, groups, next);
}, next);
@@ -440,13 +453,13 @@ Upgrade.upgrade = function(callback) {
}
var now = Date.now();
userSettings = userSettings.filter(function(setting) {
return setting && setting.dailyDigestFreq !== 'off';
});
async.eachLimit(userSettings, 50, function(setting, next) {
if (setting.dailyDigestFreq !== 'off') {
db.sortedSetAdd('digest:' + setting.dailyDigestFreq + ':uids', now, setting.uid, next);
} else {
next(false);
}
db.sortedSetAdd('digest:' + setting.dailyDigestFreq + ':uids', now, setting.uid, next);
}, function(err) {
if (err) {
winston.error('[2014/12/20] Error encountered while updating digest settings');

View File

@@ -50,7 +50,7 @@
<input type="number" class="form-control" value="8" data-field="minimumPostLength">
</div>
<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">
</div>
<div class="checkbox">
@@ -152,4 +152,4 @@
</div>
</div>
<!-- IMPORT admin/settings/footer.tpl -->
<!-- IMPORT admin/settings/footer.tpl -->