mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-16 05:20:24 +01:00
Compare commits
21 Commits
ea1309e690
...
v0.8.x
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9248f3b571 | ||
|
|
28a4703a4b | ||
|
|
1cf94c08ac | ||
|
|
a9b8a142df | ||
|
|
1097cce176 | ||
|
|
4b4c226bd7 | ||
|
|
f5bb6f048a | ||
|
|
3f9e3c9521 | ||
|
|
39f1a345ff | ||
|
|
8825f704c1 | ||
|
|
6bf9e47c0e | ||
|
|
8ff79af6b9 | ||
|
|
e97c5f6c15 | ||
|
|
3426ef75eb | ||
|
|
796cf1bc35 | ||
|
|
706bea723b | ||
|
|
15ac9cb5c4 | ||
|
|
78d126a34e | ||
|
|
85a609cae3 | ||
|
|
141999a97c | ||
|
|
f11446e0bc |
3652
npm-shrinkwrap.json
generated
Normal file
3652
npm-shrinkwrap.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -2,7 +2,7 @@
|
||||
"name": "nodebb",
|
||||
"license": "GPL-3.0",
|
||||
"description": "NodeBB Forum",
|
||||
"version": "0.8.1",
|
||||
"version": "0.8.2",
|
||||
"homepage": "http://www.nodebb.org",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
||||
@@ -6,9 +6,7 @@ define('admin/settings/general', ['admin/settings'], function(Settings) {
|
||||
|
||||
Module.init = function() {
|
||||
$('button[data-action="removeLogo"]').on('click', function() {
|
||||
socket.emit('admin.settings.removeLogo', function() {
|
||||
app.alertSuccess('Logo removed');
|
||||
});
|
||||
$('input[data-field="brand:logo"]').val('');
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -4,15 +4,14 @@ var async = require('async'),
|
||||
db = require('../database'),
|
||||
batch = require('../batch'),
|
||||
plugins = require('../plugins'),
|
||||
threadTools = require('../threadTools');
|
||||
|
||||
topics = require('../topics');
|
||||
|
||||
module.exports = function(Categories) {
|
||||
|
||||
Categories.purge = function(cid, callback) {
|
||||
batch.processSortedSet('cid:' + cid + ':tids', function(tids, next) {
|
||||
async.eachLimit(tids, 10, function(tid, next) {
|
||||
threadTools.purge(tid, 0, next);
|
||||
topics.purgePostsAndTopic(tid, next);
|
||||
}, next);
|
||||
}, {alwaysStartAt: 0}, function(err) {
|
||||
if (err) {
|
||||
|
||||
@@ -91,9 +91,6 @@ categoriesController.get = function(req, res, callback) {
|
||||
async.waterfall([
|
||||
function(next) {
|
||||
async.parallel({
|
||||
exists: function(next) {
|
||||
categories.exists(cid, next);
|
||||
},
|
||||
categoryData: function(next) {
|
||||
categories.getCategoryFields(cid, ['slug', 'disabled', 'topic_count'], next);
|
||||
},
|
||||
@@ -108,7 +105,7 @@ categoriesController.get = function(req, res, callback) {
|
||||
function(results, next) {
|
||||
userPrivileges = results.privileges;
|
||||
|
||||
if (!results.exists || (results.categoryData && parseInt(results.categoryData.disabled, 10) === 1)) {
|
||||
if (!results.categoryData.slug || (results.categoryData && parseInt(results.categoryData.disabled, 10) === 1)) {
|
||||
return callback();
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ var async = require('async'),
|
||||
groups = require('../groups'),
|
||||
user = require('../user'),
|
||||
helpers = require('./helpers'),
|
||||
plugins = require('../plugins'),
|
||||
groupsController = {};
|
||||
|
||||
groupsController.list = function(req, res, next) {
|
||||
@@ -93,7 +94,13 @@ groupsController.details = function(req, res, callback) {
|
||||
|
||||
results.title = '[[pages:group, ' + results.group.displayName + ']]';
|
||||
results.breadcrumbs = helpers.buildBreadcrumbs([{text: '[[pages:groups]]', url: '/groups' }, {text: results.group.displayName}]);
|
||||
res.render('groups/details', results);
|
||||
|
||||
plugins.fireHook('filter:group.build', { req: req, res: res, templateData: results }, function (err, results) {
|
||||
if(err) {
|
||||
return callback(err);
|
||||
}
|
||||
res.render('groups/details', results.templateData);
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
@@ -40,6 +40,11 @@ topicsController.get = function(req, res, callback) {
|
||||
}, next);
|
||||
},
|
||||
function (results, next) {
|
||||
|
||||
if (!results.topic.slug) {
|
||||
return callback();
|
||||
}
|
||||
|
||||
userPrivileges = results.privileges;
|
||||
|
||||
if (!userPrivileges.read || (parseInt(results.topic.deleted, 10) && !userPrivileges.view_deleted)) {
|
||||
|
||||
@@ -203,10 +203,6 @@ SocketAdmin.settings.clearSitemapCache = function(socket, data, callback) {
|
||||
callback();
|
||||
};
|
||||
|
||||
SocketAdmin.settings.removeLogo = function(socket, data, callback) {
|
||||
db.setObjectField('config', 'brand:logo', '', callback);
|
||||
};
|
||||
|
||||
SocketAdmin.email.test = function(socket, data, callback) {
|
||||
if (plugins.hasListeners('action:email.send')) {
|
||||
emailer.send('test', socket.uid, {
|
||||
|
||||
@@ -66,7 +66,7 @@ var async = require('async'),
|
||||
}
|
||||
|
||||
ThreadTools.purge = function(tid, uid, callback) {
|
||||
var topic;
|
||||
var cid;
|
||||
async.waterfall([
|
||||
function(next) {
|
||||
topics.exists(tid, next);
|
||||
@@ -82,23 +82,15 @@ var async = require('async'),
|
||||
return next(new Error('[[error:no-privileges]]'));
|
||||
}
|
||||
|
||||
topics.getTopicFields(tid, ['mainPid', 'cid'], next);
|
||||
topics.getTopicField(tid, 'cid', next);
|
||||
},
|
||||
function (_topic, next) {
|
||||
topic = _topic;
|
||||
function (_cid, next) {
|
||||
cid = _cid;
|
||||
|
||||
batch.processSortedSet('tid:' + tid + ':posts', function(pids, next) {
|
||||
async.eachLimit(pids, 10, posts.purge, next);
|
||||
}, {alwaysStartAt: 0}, next);
|
||||
topics.purgePostsAndTopic(tid, next);
|
||||
},
|
||||
function (next) {
|
||||
posts.purge(topic.mainPid, next);
|
||||
},
|
||||
function (next) {
|
||||
topics.purge(tid, next);
|
||||
},
|
||||
function (next) {
|
||||
next(null, {tid: tid, cid: topic.cid, uid: uid});
|
||||
next(null, {tid: tid, cid: cid, uid: uid});
|
||||
}
|
||||
], callback);
|
||||
};
|
||||
|
||||
@@ -5,7 +5,8 @@ var async = require('async'),
|
||||
|
||||
user = require('../user'),
|
||||
posts = require('../posts'),
|
||||
plugins = require('../plugins');
|
||||
plugins = require('../plugins'),
|
||||
batch = require('../batch');
|
||||
|
||||
|
||||
module.exports = function(Topics) {
|
||||
@@ -80,6 +81,27 @@ module.exports = function(Topics) {
|
||||
});
|
||||
};
|
||||
|
||||
Topics.purgePostsAndTopic = function(tid, callback) {
|
||||
var mainPid;
|
||||
async.waterfall([
|
||||
function (next) {
|
||||
Topics.getTopicField(tid, 'mainPid', next);
|
||||
},
|
||||
function (_mainPid, next) {
|
||||
mainPid = _mainPid;
|
||||
batch.processSortedSet('tid:' + tid + ':posts', function(pids, next) {
|
||||
async.eachLimit(pids, 10, posts.purge, next);
|
||||
}, {alwaysStartAt: 0}, next);
|
||||
},
|
||||
function (next) {
|
||||
posts.purge(mainPid, next);
|
||||
},
|
||||
function (next) {
|
||||
Topics.purge(tid, next);
|
||||
}
|
||||
], callback);
|
||||
};
|
||||
|
||||
Topics.purge = function(tid, callback) {
|
||||
async.parallel([
|
||||
function(next) {
|
||||
|
||||
Reference in New Issue
Block a user