Compare commits

...

21 Commits

Author SHA1 Message Date
barisusakli
9248f3b571 closes #3626 2015-11-11 13:57:02 -05:00
psychobunny
28a4703a4b acp remove logo fix 2015-10-13 13:12:10 -04:00
Barış Soner Uşaklı
1cf94c08ac Merge pull request #3636 from HorusGoul/HorusGoul
Added: 'filter:group.build' in group details controller.
2015-09-20 16:37:41 -04:00
Horus Lugo
a9b8a142df Changed filters name and solved a little mistake. 2015-09-19 05:34:07 +02:00
Horus Lugo
1097cce176 Added 'filter:groups.build' to groups controller 2015-09-19 05:25:36 +02:00
Julian Lam
4b4c226bd7 Merge remote-tracking branch 'origin/master' into v0.8.x 2015-09-16 15:01:13 -04:00
Julian Lam
f5bb6f048a updated shrinkwrap file 2015-09-16 15:01:01 -04:00
Julian Lam
3f9e3c9521 Merge remote-tracking branch 'origin/master' into v0.8.x 2015-09-16 14:55:49 -04:00
Julian Lam
39f1a345ff updated shrinkwrap file 2015-09-16 14:36:37 -04:00
Julian Lam
8825f704c1 Merge branch 'master' into v0.8.x 2015-09-16 14:32:21 -04:00
Julian Lam
6bf9e47c0e 0.8.2 2015-09-16 14:32:06 -04:00
Julian Lam
8ff79af6b9 0.8.1 2015-09-02 16:16:30 -04:00
Julian Lam
e97c5f6c15 updated shrinkwrap file 2015-09-02 16:14:55 -04:00
Julian Lam
3426ef75eb Merge branch 'master' into v0.8.x 2015-09-02 16:11:16 -04:00
psychobunny
796cf1bc35 if params.count is passed in, min should be 0 2015-08-27 17:39:25 -04:00
psychobunny
706bea723b changing function signature for messaging.getMessages
@julianlam should this be moved to 0.8.0?
2015-08-27 17:39:18 -04:00
Julian Lam
15ac9cb5c4 updated shrinkwrap file 2015-08-27 16:55:47 -04:00
Julian Lam
78d126a34e Merge remote-tracking branch 'origin/master' into v0.8.x 2015-08-27 16:52:34 -04:00
Julian Lam
85a609cae3 Merge branch 'master' into v0.8.x 2015-08-27 16:49:49 -04:00
Julian Lam
141999a97c Merge remote-tracking branch 'origin/master' into v0.8.x 2015-08-27 16:20:25 -04:00
Julian Lam
f11446e0bc added shrinkwrap file 2015-08-27 16:08:33 -04:00
10 changed files with 3699 additions and 31 deletions

3652
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": "GPL-3.0",
"description": "NodeBB Forum",
"version": "0.8.1",
"version": "0.8.2",
"homepage": "http://www.nodebb.org",
"repository": {
"type": "git",

View File

@@ -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('');
});
};

View File

@@ -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) {

View File

@@ -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();
}

View File

@@ -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);
});
});
});
};

View File

@@ -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)) {

View File

@@ -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, {

View File

@@ -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);
};

View File

@@ -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) {