mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
chore(deps): update dependency eslint-config-airbnb-base to v13 (#6599)
* chore(deps): update dependency eslint-config-airbnb-base to v13 * chore: #6599, linting 😬
This commit is contained in:
committed by
Julian Lam
parent
eb0a322d7f
commit
64b9dabff8
@@ -40,6 +40,7 @@
|
|||||||
"avoidEscape": true,
|
"avoidEscape": true,
|
||||||
"allowTemplateLiterals": true
|
"allowTemplateLiterals": true
|
||||||
}],
|
}],
|
||||||
|
"no-else-return": [ "error", { "allowElseIf": true } ],
|
||||||
|
|
||||||
// ES6
|
// ES6
|
||||||
"prefer-rest-params": "off",
|
"prefer-rest-params": "off",
|
||||||
|
|||||||
1
app.js
1
app.js
@@ -89,4 +89,3 @@ if (nconf.get('setup') || nconf.get('install')) {
|
|||||||
} else {
|
} else {
|
||||||
require('./src/start').start();
|
require('./src/start').start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -127,7 +127,7 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"coveralls": "3.0.2",
|
"coveralls": "3.0.2",
|
||||||
"eslint": "5.8.0",
|
"eslint": "5.8.0",
|
||||||
"eslint-config-airbnb-base": "12.1.0",
|
"eslint-config-airbnb-base": "13.1.0",
|
||||||
"eslint-plugin-import": "2.14.0",
|
"eslint-plugin-import": "2.14.0",
|
||||||
"grunt": "1.0.3",
|
"grunt": "1.0.3",
|
||||||
"grunt-contrib-watch": "1.1.0",
|
"grunt-contrib-watch": "1.1.0",
|
||||||
|
|||||||
@@ -99,9 +99,9 @@
|
|||||||
} else {
|
} else {
|
||||||
var matches = url.match(/admin\/(.+?)\/(.+?)$/);
|
var matches = url.match(/admin\/(.+?)\/(.+?)$/);
|
||||||
mainTitle = '[[admin/menu:' + matches[1] + '/' + matches[2] + ']]';
|
mainTitle = '[[admin/menu:' + matches[1] + '/' + matches[2] + ']]';
|
||||||
pageTitle = '[[admin/menu:section-' +
|
pageTitle = '[[admin/menu:section-'
|
||||||
(matches[1] === 'development' ? 'advanced' : matches[1]) +
|
+ (matches[1] === 'development' ? 'advanced' : matches[1])
|
||||||
']]' + (matches[2] ? (' > ' + mainTitle) : '');
|
+ ']]' + (matches[2] ? (' > ' + mainTitle) : '');
|
||||||
if (matches[2] === 'settings') {
|
if (matches[2] === 'settings') {
|
||||||
mainTitle = translator.compile('admin/menu:settings.page-title', mainTitle);
|
mainTitle = translator.compile('admin/menu:settings.page-title', mainTitle);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,22 +62,22 @@ define('admin/general/dashboard', ['semver', 'Chart', 'translator', 'benchpress'
|
|||||||
|
|
||||||
graphData.rooms = data;
|
graphData.rooms = data;
|
||||||
|
|
||||||
var html = '<div class="text-center pull-left">' +
|
var html = '<div class="text-center pull-left">'
|
||||||
'<span class="formatted-number">' + data.onlineRegisteredCount + '</span>' +
|
+ '<span class="formatted-number">' + data.onlineRegisteredCount + '</span>'
|
||||||
'<div class="stat">[[admin/general/dashboard:active-users.users]]</div>' +
|
+ '<div class="stat">[[admin/general/dashboard:active-users.users]]</div>'
|
||||||
'</div>' +
|
+ '</div>'
|
||||||
'<div class="text-center pull-left">' +
|
+ '<div class="text-center pull-left">'
|
||||||
'<span class="formatted-number">' + data.onlineGuestCount + '</span>' +
|
+ '<span class="formatted-number">' + data.onlineGuestCount + '</span>'
|
||||||
'<div class="stat">[[admin/general/dashboard:active-users.guests]]</div>' +
|
+ '<div class="stat">[[admin/general/dashboard:active-users.guests]]</div>'
|
||||||
'</div>' +
|
+ '</div>'
|
||||||
'<div class="text-center pull-left">' +
|
+ '<div class="text-center pull-left">'
|
||||||
'<span class="formatted-number">' + (data.onlineRegisteredCount + data.onlineGuestCount) + '</span>' +
|
+ '<span class="formatted-number">' + (data.onlineRegisteredCount + data.onlineGuestCount) + '</span>'
|
||||||
'<div class="stat">[[admin/general/dashboard:active-users.total]]</div>' +
|
+ '<div class="stat">[[admin/general/dashboard:active-users.total]]</div>'
|
||||||
'</div>' +
|
+ '</div>'
|
||||||
'<div class="text-center pull-left">' +
|
+ '<div class="text-center pull-left">'
|
||||||
'<span class="formatted-number">' + data.socketCount + '</span>' +
|
+ '<span class="formatted-number">' + data.socketCount + '</span>'
|
||||||
'<div class="stat">[[admin/general/dashboard:active-users.connections]]</div>' +
|
+ '<div class="stat">[[admin/general/dashboard:active-users.connections]]</div>'
|
||||||
'</div>';
|
+ '</div>';
|
||||||
|
|
||||||
updateRegisteredGraph(data.onlineRegisteredCount, data.onlineGuestCount);
|
updateRegisteredGraph(data.onlineRegisteredCount, data.onlineGuestCount);
|
||||||
updatePresenceGraph(data.users);
|
updatePresenceGraph(data.users);
|
||||||
@@ -506,10 +506,10 @@ define('admin/general/dashboard', ['semver', 'Chart', 'translator', 'benchpress'
|
|||||||
topics.forEach(function (topic, i) {
|
topics.forEach(function (topic, i) {
|
||||||
var label = topic.count === '0' ? topic.title : '<a title="' + topic.title + '"href="' + RELATIVE_PATH + '/topic/' + topic.tid + '" target="_blank"> ' + topic.title + '</a>';
|
var label = topic.count === '0' ? topic.title : '<a title="' + topic.title + '"href="' + RELATIVE_PATH + '/topic/' + topic.tid + '" target="_blank"> ' + topic.title + '</a>';
|
||||||
|
|
||||||
html += '<li>' +
|
html += '<li>'
|
||||||
'<div style="background-color: ' + topicColors[i] + ';"></div>' +
|
+ '<div style="background-color: ' + topicColors[i] + ';"></div>'
|
||||||
'<span>' + label + '</span>' +
|
+ '<span>' + label + '</span>'
|
||||||
'</li>';
|
+ '</li>';
|
||||||
});
|
});
|
||||||
legend.translateHtml(html);
|
legend.translateHtml(html);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,15 +32,15 @@ define('admin/modules/search', ['mousetrap'], function (mousetrap) {
|
|||||||
'$1<span class="search-match">$2</span>$3'
|
'$1<span class="search-match">$2</span>$3'
|
||||||
);
|
);
|
||||||
|
|
||||||
return '<li role="presentation" class="result">' +
|
return '<li role="presentation" class="result">'
|
||||||
'<a role= "menuitem" href= "' + config.relative_path + '/' + namespace + '" >' +
|
+ '<a role= "menuitem" href= "' + config.relative_path + '/' + namespace + '" >'
|
||||||
title +
|
+ title
|
||||||
'<br>' + (!results ? '' :
|
+ '<br>' + (!results ? ''
|
||||||
('<small><code>' +
|
: ('<small><code>'
|
||||||
results +
|
+ results
|
||||||
'</small></code>')) +
|
+ '</small></code>'))
|
||||||
'</a>' +
|
+ '</a>'
|
||||||
'</li>';
|
+ '</li>';
|
||||||
}).join('');
|
}).join('');
|
||||||
return html;
|
return html;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,8 +70,8 @@ define('forum/chats/messages', ['components', 'sounds', 'translator', 'benchpres
|
|||||||
var lastSpeaker = parseInt(chatContentEl.find('.chat-message').last().attr('data-uid'), 10);
|
var lastSpeaker = parseInt(chatContentEl.find('.chat-message').last().attr('data-uid'), 10);
|
||||||
var lasttimestamp = parseInt(chatContentEl.find('.chat-message').last().attr('data-timestamp'), 10);
|
var lasttimestamp = parseInt(chatContentEl.find('.chat-message').last().attr('data-timestamp'), 10);
|
||||||
if (!Array.isArray(data)) {
|
if (!Array.isArray(data)) {
|
||||||
data.newSet = lastSpeaker !== parseInt(data.fromuid, 10) ||
|
data.newSet = lastSpeaker !== parseInt(data.fromuid, 10)
|
||||||
parseInt(data.timestamp, 10) > parseInt(lasttimestamp, 10) + (1000 * 60 * 3);
|
|| parseInt(data.timestamp, 10) > parseInt(lasttimestamp, 10) + (1000 * 60 * 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
messages.parseMessage(data, function (html) {
|
messages.parseMessage(data, function (html) {
|
||||||
|
|||||||
@@ -58,10 +58,10 @@ define('forum/chats/search', ['components'], function (components) {
|
|||||||
|
|
||||||
function displayUser(chatsListEl, userObj) {
|
function displayUser(chatsListEl, userObj) {
|
||||||
function createUserImage() {
|
function createUserImage() {
|
||||||
return (userObj.picture ?
|
return (userObj.picture
|
||||||
'<img src="' + userObj.picture + '" title="' + userObj.username + '" />' :
|
? '<img src="' + userObj.picture + '" title="' + userObj.username + '" />'
|
||||||
'<div class="user-icon" style="background-color: ' + userObj['icon:bgColor'] + '">' + userObj['icon:text'] + '</div>') +
|
: '<div class="user-icon" style="background-color: ' + userObj['icon:bgColor'] + '">' + userObj['icon:text'] + '</div>')
|
||||||
'<i class="fa fa-circle status ' + userObj.status + '"></i> ' + userObj.username;
|
+ '<i class="fa fa-circle status ' + userObj.status + '"></i> ' + userObj.username;
|
||||||
}
|
}
|
||||||
|
|
||||||
var chatEl = $('<li component="chat/search/user" />')
|
var chatEl = $('<li component="chat/search/user" />')
|
||||||
|
|||||||
@@ -71,8 +71,8 @@ define('forum/topic/posts', [
|
|||||||
ajaxify.data.pagination.pageCount = Math.max(1, Math.ceil(posts[0].topic.postcount / config.postsPerPage));
|
ajaxify.data.pagination.pageCount = Math.max(1, Math.ceil(posts[0].topic.postcount / config.postsPerPage));
|
||||||
var direction = config.topicPostSort === 'oldest_to_newest' || config.topicPostSort === 'most_votes' ? 1 : -1;
|
var direction = config.topicPostSort === 'oldest_to_newest' || config.topicPostSort === 'most_votes' ? 1 : -1;
|
||||||
|
|
||||||
var isPostVisible = (ajaxify.data.pagination.currentPage === ajaxify.data.pagination.pageCount && direction === 1) ||
|
var isPostVisible = (ajaxify.data.pagination.currentPage === ajaxify.data.pagination.pageCount && direction === 1)
|
||||||
(ajaxify.data.pagination.currentPage === 1 && direction === -1);
|
|| (ajaxify.data.pagination.currentPage === 1 && direction === -1);
|
||||||
|
|
||||||
if (isPostVisible) {
|
if (isPostVisible) {
|
||||||
createNewPosts(data, components.get('post').not('[data-index=0]'), direction, scrollToPost);
|
createNewPosts(data, components.get('post').not('[data-index=0]'), direction, scrollToPost);
|
||||||
|
|||||||
@@ -66,4 +66,3 @@ define('categorySelector', ['benchpress', 'translator'], function (Benchpress, t
|
|||||||
|
|
||||||
return categorySelector;
|
return categorySelector;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -42,10 +42,10 @@
|
|||||||
var properties = item.properties;
|
var properties = item.properties;
|
||||||
var loggedIn = data.config ? data.config.loggedIn : false;
|
var loggedIn = data.config ? data.config.loggedIn : false;
|
||||||
if (properties) {
|
if (properties) {
|
||||||
if ((properties.loggedIn && !loggedIn) ||
|
if ((properties.loggedIn && !loggedIn)
|
||||||
(properties.guestOnly && loggedIn) ||
|
|| (properties.guestOnly && loggedIn)
|
||||||
(properties.globalMod && !data.isGlobalMod && !data.isAdmin) ||
|
|| (properties.globalMod && !data.isGlobalMod && !data.isAdmin)
|
||||||
(properties.adminOnly && !data.isAdmin)) {
|
|| (properties.adminOnly && !data.isAdmin)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -125,11 +125,11 @@
|
|||||||
category.children.forEach(function (child) {
|
category.children.forEach(function (child) {
|
||||||
if (child && !child.isSection) {
|
if (child && !child.isSection) {
|
||||||
var link = child.link ? child.link : (relative_path + '/category/' + child.slug);
|
var link = child.link ? child.link : (relative_path + '/category/' + child.slug);
|
||||||
html += '<span class="category-children-item pull-left">' +
|
html += '<span class="category-children-item pull-left">'
|
||||||
'<div class="icon pull-left" style="' + generateCategoryBackground(child) + '">' +
|
+ '<div class="icon pull-left" style="' + generateCategoryBackground(child) + '">'
|
||||||
'<i class="fa fa-fw ' + child.icon + '"></i>' +
|
+ '<i class="fa fa-fw ' + child.icon + '"></i>'
|
||||||
'</div>' +
|
+ '</div>'
|
||||||
'<a href="' + link + '"><small>' + child.name + '</small></a></span>';
|
+ '<a href="' + link + '"><small>' + child.name + '</small></a></span>';
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
html = html ? ('<span class="category-children">' + html + '</span>') : html;
|
html = html ? ('<span class="category-children">' + html + '</span>') : html;
|
||||||
|
|||||||
@@ -117,4 +117,3 @@ define('iconSelect', ['benchpress'], function (Benchpress) {
|
|||||||
|
|
||||||
return iconSelect;
|
return iconSelect;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ define('scrollStop', function () {
|
|||||||
var elementHeight = Math.round(this.getBoundingClientRect().height);
|
var elementHeight = Math.round(this.getBoundingClientRect().height);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
(e.originalEvent.deltaY < 0 && scrollTop === 0) || // scroll up
|
(e.originalEvent.deltaY < 0 && scrollTop === 0) // scroll up
|
||||||
(e.originalEvent.deltaY > 0 && (elementHeight + scrollTop) >= scrollHeight) // scroll down
|
|| (e.originalEvent.deltaY > 0 && (elementHeight + scrollTop) >= scrollHeight) // scroll down
|
||||||
) {
|
) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -116,11 +116,11 @@ define('taskbar', ['benchpress', 'translator'], function (Benchpress, translator
|
|||||||
|
|
||||||
var taskbarEl = $('<li />')
|
var taskbarEl = $('<li />')
|
||||||
.addClass(data.options.className)
|
.addClass(data.options.className)
|
||||||
.html('<a href="#">' +
|
.html('<a href="#">'
|
||||||
(data.options.icon ? '<i class="fa ' + data.options.icon + '"></i> ' : '') +
|
+ (data.options.icon ? '<i class="fa ' + data.options.icon + '"></i> ' : '')
|
||||||
(data.options.image ? '<img src="' + data.options.image + '"/> ' : '') +
|
+ (data.options.image ? '<img src="' + data.options.image + '"/> ' : '')
|
||||||
'<span component="taskbar/title">' + title + '</span>' +
|
+ '<span component="taskbar/title">' + title + '</span>'
|
||||||
'</a>')
|
+ '</a>')
|
||||||
.attr({
|
.attr({
|
||||||
title: title,
|
title: title,
|
||||||
'data-module': data.module,
|
'data-module': data.module,
|
||||||
|
|||||||
@@ -65,9 +65,9 @@ define('topicList', ['forum/infinitescroll', 'handleBack', 'topicSelect'], funct
|
|||||||
};
|
};
|
||||||
|
|
||||||
function onNewTopic(data) {
|
function onNewTopic(data) {
|
||||||
if ((ajaxify.data.selectedCids && ajaxify.data.selectedCids.indexOf(parseInt(data.cid, 10)) === -1) ||
|
if ((ajaxify.data.selectedCids && ajaxify.data.selectedCids.indexOf(parseInt(data.cid, 10)) === -1)
|
||||||
(ajaxify.data.selectedFilter && ajaxify.data.selectedFilter.filter === 'watched') ||
|
|| (ajaxify.data.selectedFilter && ajaxify.data.selectedFilter.filter === 'watched')
|
||||||
(ajaxify.data.template.category && parseInt(ajaxify.data.cid, 10) !== parseInt(data.cid, 10))) {
|
|| (ajaxify.data.template.category && parseInt(ajaxify.data.cid, 10) !== parseInt(data.cid, 10))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -82,11 +82,11 @@ define('topicList', ['forum/infinitescroll', 'handleBack', 'topicSelect'], funct
|
|||||||
}
|
}
|
||||||
|
|
||||||
var post = data.posts[0];
|
var post = data.posts[0];
|
||||||
if ((!post || !post.topic) ||
|
if ((!post || !post.topic)
|
||||||
(parseInt(post.topic.mainPid, 10) === parseInt(post.pid, 10)) ||
|
|| (parseInt(post.topic.mainPid, 10) === parseInt(post.pid, 10))
|
||||||
(ajaxify.data.selectedCids && ajaxify.data.selectedCids.indexOf(parseInt(post.topic.cid, 10)) === -1) ||
|
|| (ajaxify.data.selectedCids && ajaxify.data.selectedCids.indexOf(parseInt(post.topic.cid, 10)) === -1)
|
||||||
(ajaxify.data.selectedFilter && ajaxify.data.selectedFilter.filter === 'new') ||
|
|| (ajaxify.data.selectedFilter && ajaxify.data.selectedFilter.filter === 'new')
|
||||||
(ajaxify.data.template.category && parseInt(ajaxify.data.cid, 10) !== parseInt(post.topic.cid, 10))) {
|
|| (ajaxify.data.template.category && parseInt(ajaxify.data.cid, 10) !== parseInt(post.topic.cid, 10))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -181,8 +181,8 @@
|
|||||||
cursor += 1;
|
cursor += 1;
|
||||||
// a space or comma was found before the name
|
// a space or comma was found before the name
|
||||||
// this isn't a translation string, so back out
|
// this isn't a translation string, so back out
|
||||||
} else if (!(textBeforeColonFound && colonFound && textAfterColonFound && commaAfterNameFound) &&
|
} else if (!(textBeforeColonFound && colonFound && textAfterColonFound && commaAfterNameFound)
|
||||||
invalidTextRegex.test(char0)) {
|
&& invalidTextRegex.test(char0)) {
|
||||||
cursor += 1;
|
cursor += 1;
|
||||||
lastBreak -= 2;
|
lastBreak -= 2;
|
||||||
// no longer in a token
|
// no longer in a token
|
||||||
|
|||||||
@@ -625,10 +625,10 @@
|
|||||||
var rect = el.getBoundingClientRect();
|
var rect = el.getBoundingClientRect();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
rect.top >= 0 &&
|
rect.top >= 0
|
||||||
rect.left >= 0 &&
|
&& rect.left >= 0
|
||||||
rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) && /* or $(window).height() */
|
&& rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) /* or $(window).height() */
|
||||||
rect.right <= (window.innerWidth || document.documentElement.clientWidth) /* or $(window).width() */
|
&& rect.right <= (window.innerWidth || document.documentElement.clientWidth) /* or $(window).width() */
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -731,10 +731,10 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
isInternalURI: function (targetLocation, referenceLocation, relative_path) {
|
isInternalURI: function (targetLocation, referenceLocation, relative_path) {
|
||||||
return targetLocation.host === '' || // Relative paths are always internal links
|
return targetLocation.host === '' // Relative paths are always internal links
|
||||||
(
|
|| (
|
||||||
targetLocation.host === referenceLocation.host && targetLocation.protocol === referenceLocation.protocol && // Otherwise need to check if protocol and host match
|
targetLocation.host === referenceLocation.host && targetLocation.protocol === referenceLocation.protocol // Otherwise need to check if protocol and host match
|
||||||
(relative_path.length > 0 ? targetLocation.pathname.indexOf(relative_path) === 0 : true) // Subfolder installs need this additional check
|
&& (relative_path.length > 0 ? targetLocation.pathname.indexOf(relative_path) === 0 : true) // Subfolder installs need this additional check
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -18,10 +18,10 @@ function filterDirectories(directories) {
|
|||||||
// exclude partials
|
// exclude partials
|
||||||
// only include subpaths
|
// only include subpaths
|
||||||
// exclude category.tpl, group.tpl, category-analytics.tpl
|
// exclude category.tpl, group.tpl, category-analytics.tpl
|
||||||
return !dir.endsWith('.js') &&
|
return !dir.endsWith('.js')
|
||||||
!dir.includes('/partials/') &&
|
&& !dir.includes('/partials/')
|
||||||
/\/.*\//.test(dir) &&
|
&& /\/.*\//.test(dir)
|
||||||
!/manage\/(category|group|category-analytics)$/.test(dir);
|
&& !/manage\/(category|group|category-analytics)$/.test(dir);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -138,10 +138,10 @@ function initDict(language, callback) {
|
|||||||
title = '[[admin/menu:general/dashboard]]';
|
title = '[[admin/menu:general/dashboard]]';
|
||||||
} else {
|
} else {
|
||||||
title = title.match(/admin\/(.+?)\/(.+?)$/);
|
title = title.match(/admin\/(.+?)\/(.+?)$/);
|
||||||
title = '[[admin/menu:section-' +
|
title = '[[admin/menu:section-'
|
||||||
(title[1] === 'development' ? 'advanced' : title[1]) +
|
+ (title[1] === 'development' ? 'advanced' : title[1])
|
||||||
']]' + (title[2] ? (' > [[admin/menu:' +
|
+ ']]' + (title[2] ? (' > [[admin/menu:'
|
||||||
title[1] + '/' + title[2] + ']]') : '');
|
+ title[1] + '/' + title[2] + ']]') : '');
|
||||||
}
|
}
|
||||||
|
|
||||||
translator.translate(title).then(function (title) {
|
translator.translate(title).then(function (title) {
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ var async = require('async');
|
|||||||
var winston = require('winston');
|
var winston = require('winston');
|
||||||
var nconf = require('nconf');
|
var nconf = require('nconf');
|
||||||
var crypto = require('crypto');
|
var crypto = require('crypto');
|
||||||
|
var LRU = require('lru-cache');
|
||||||
|
|
||||||
var db = require('./database');
|
var db = require('./database');
|
||||||
var plugins = require('./plugins');
|
var plugins = require('./plugins');
|
||||||
@@ -25,7 +26,6 @@ var uniquevisitors = 0;
|
|||||||
* the cache could be exhausted continuously if there are more than 500 concurrently
|
* the cache could be exhausted continuously if there are more than 500 concurrently
|
||||||
* active users
|
* active users
|
||||||
*/
|
*/
|
||||||
var LRU = require('lru-cache');
|
|
||||||
var ipCache = LRU({
|
var ipCache = LRU({
|
||||||
max: 500,
|
max: 500,
|
||||||
length: function () { return 1; },
|
length: function () { return 1; },
|
||||||
|
|||||||
@@ -244,4 +244,3 @@ module.exports = function (Categories) {
|
|||||||
], callback);
|
], callback);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -65,9 +65,9 @@ Command.prototype.usage = function () {
|
|||||||
return humanReadableArgName(arg);
|
return humanReadableArgName(arg);
|
||||||
});
|
});
|
||||||
|
|
||||||
var usage = '[options]'[optionColor] +
|
var usage = '[options]'[optionColor]
|
||||||
(this.commands.length ? ' [command]' : '')[subCommandColor] +
|
+ (this.commands.length ? ' [command]' : '')[subCommandColor]
|
||||||
(this._args.length ? ' ' + args.join(' ') : '')[argColor];
|
+ (this._args.length ? ' ' + args.join(' ') : '')[argColor];
|
||||||
|
|
||||||
return usage;
|
return usage;
|
||||||
};
|
};
|
||||||
@@ -90,10 +90,10 @@ Command.prototype.commandHelp = function () {
|
|||||||
}).join(' ');
|
}).join(' ');
|
||||||
|
|
||||||
return [
|
return [
|
||||||
cmd._name[subCommandColor] +
|
cmd._name[subCommandColor]
|
||||||
(cmd._alias ? ' | ' + cmd._alias : '')[subCommandColor] +
|
+ (cmd._alias ? ' | ' + cmd._alias : '')[subCommandColor]
|
||||||
(cmd.options.length ? ' [options]' : '')[subOptionColor] +
|
+ (cmd.options.length ? ' [options]' : '')[subOptionColor]
|
||||||
' ' + args[subArgColor],
|
+ ' ' + args[subArgColor],
|
||||||
cmd._description,
|
cmd._description,
|
||||||
];
|
];
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -65,7 +65,9 @@ try {
|
|||||||
}
|
}
|
||||||
|
|
||||||
require('colors');
|
require('colors');
|
||||||
|
// eslint-disable-next-line
|
||||||
var nconf = require('nconf');
|
var nconf = require('nconf');
|
||||||
|
// eslint-disable-next-line
|
||||||
var program = require('commander');
|
var program = require('commander');
|
||||||
|
|
||||||
var pkg = require('../../package.json');
|
var pkg = require('../../package.json');
|
||||||
|
|||||||
@@ -27,10 +27,10 @@ function buildTargets() {
|
|||||||
return ' ' + _.padEnd('"' + tuple[0] + '"', length + 2).magenta + ' | ' + tuple[1];
|
return ' ' + _.padEnd('"' + tuple[0] + '"', length + 2).magenta + ' | ' + tuple[1];
|
||||||
}).join('\n');
|
}).join('\n');
|
||||||
console.log(
|
console.log(
|
||||||
'\n\n Build targets:\n' +
|
'\n\n Build targets:\n'
|
||||||
('\n ' + _.padEnd('Target', length + 2) + ' | Aliases').green +
|
+ ('\n ' + _.padEnd('Target', length + 2) + ' | Aliases').green
|
||||||
'\n ------------------------------------------------------\n'.blue +
|
+ '\n ------------------------------------------------------\n'.blue
|
||||||
output + '\n'
|
+ output + '\n'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -88,8 +88,8 @@ function runUpgrade(upgrades, options) {
|
|||||||
|
|
||||||
if (upgrades === true) {
|
if (upgrades === true) {
|
||||||
var tasks = Object.keys(steps);
|
var tasks = Object.keys(steps);
|
||||||
if (options.package || options.install ||
|
if (options.package || options.install
|
||||||
options.plugins || options.schema || options.build) {
|
|| options.plugins || options.schema || options.build) {
|
||||||
tasks = tasks.filter(function (key) {
|
tasks = tasks.filter(function (key) {
|
||||||
return options[key];
|
return options[key];
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -133,4 +133,3 @@ profileController.get = function (req, res, callback) {
|
|||||||
},
|
},
|
||||||
], callback);
|
], callback);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -47,4 +47,3 @@ eventsController.get = function (req, res, next) {
|
|||||||
},
|
},
|
||||||
], next);
|
], next);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -29,4 +29,3 @@ hooksController.get = function (req, res) {
|
|||||||
|
|
||||||
res.render('admin/advanced/hooks', { hooks: hooks });
|
res.render('admin/advanced/hooks', { hooks: hooks });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -24,4 +24,3 @@ languagesController.get = function (req, res, next) {
|
|||||||
},
|
},
|
||||||
], next);
|
], next);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -46,4 +46,3 @@ themesController.get = function (req, res, next) {
|
|||||||
},
|
},
|
||||||
], next);
|
], next);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -317,4 +317,3 @@ function uploadImage(filename, folder, uploadedFile, req, res, next) {
|
|||||||
res.json([{ name: uploadedFile.name, url: image.url.startsWith('http') ? image.url : nconf.get('relative_path') + image.url }]);
|
res.json([{ name: uploadedFile.name, url: image.url.startsWith('http') ? image.url : nconf.get('relative_path') + image.url }]);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -249,10 +249,10 @@ Controllers.robots = function (req, res) {
|
|||||||
if (meta.config['robots:txt']) {
|
if (meta.config['robots:txt']) {
|
||||||
res.send(meta.config['robots:txt']);
|
res.send(meta.config['robots:txt']);
|
||||||
} else {
|
} else {
|
||||||
res.send('User-agent: *\n' +
|
res.send('User-agent: *\n'
|
||||||
'Disallow: ' + nconf.get('relative_path') + '/admin/\n' +
|
+ 'Disallow: ' + nconf.get('relative_path') + '/admin/\n'
|
||||||
'Disallow: ' + nconf.get('relative_path') + '/reset/\n' +
|
+ 'Disallow: ' + nconf.get('relative_path') + '/reset/\n'
|
||||||
'Sitemap: ' + nconf.get('url') + '/sitemap.xml');
|
+ 'Sitemap: ' + nconf.get('url') + '/sitemap.xml');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -184,4 +184,3 @@ modsController.postQueue = function (req, res, next) {
|
|||||||
},
|
},
|
||||||
], next);
|
], next);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -54,4 +54,3 @@ function sendSitemap(method, res, callback) {
|
|||||||
},
|
},
|
||||||
], callback);
|
], callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
|
||||||
var meta = require('./meta');
|
|
||||||
var nconf = require('nconf');
|
var nconf = require('nconf');
|
||||||
|
var meta = require('./meta');
|
||||||
|
|
||||||
var coverPhoto = module.exports;
|
var coverPhoto = module.exports;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var pubsub = require('../pubsub');
|
|
||||||
var LRU = require('lru-cache');
|
var LRU = require('lru-cache');
|
||||||
|
var pubsub = require('../pubsub');
|
||||||
|
|
||||||
var cache = LRU({
|
var cache = LRU({
|
||||||
max: 40000,
|
max: 40000,
|
||||||
|
|||||||
@@ -77,9 +77,9 @@ module.exports = function (Groups) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
function isSystemGroup(data) {
|
function isSystemGroup(data) {
|
||||||
return data.system === true || parseInt(data.system, 10) === 1 ||
|
return data.system === true || parseInt(data.system, 10) === 1
|
||||||
data.name === 'administrators' || data.name === 'registered-users' || data.name === 'Global Moderators' ||
|
|| data.name === 'administrators' || data.name === 'registered-users' || data.name === 'Global Moderators'
|
||||||
Groups.isPrivilegeGroup(data.name);
|
|| Groups.isPrivilegeGroup(data.name);
|
||||||
}
|
}
|
||||||
|
|
||||||
function validateGroupName(name, callback) {
|
function validateGroupName(name, callback) {
|
||||||
|
|||||||
@@ -134,8 +134,8 @@ module.exports = function (Messaging) {
|
|||||||
Messaging.getMessageFields(mid, ['fromuid', 'timestamp'], next);
|
Messaging.getMessageFields(mid, ['fromuid', 'timestamp'], next);
|
||||||
},
|
},
|
||||||
function (fields, next) {
|
function (fields, next) {
|
||||||
if ((messages[0].timestamp > fields.timestamp + Messaging.newMessageCutoff) ||
|
if ((messages[0].timestamp > fields.timestamp + Messaging.newMessageCutoff)
|
||||||
(messages[0].fromuid !== fields.fromuid)) {
|
|| (messages[0].fromuid !== fields.fromuid)) {
|
||||||
// If it's been 5 minutes, this is a new set of messages
|
// If it's been 5 minutes, this is a new set of messages
|
||||||
messages[0].newSet = true;
|
messages[0].newSet = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,9 +80,9 @@ Blacklist.test = function (clientIp, callback) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
!Blacklist._rules.ipv4.includes(clientIp) && // not explicitly specified in ipv4 list
|
!Blacklist._rules.ipv4.includes(clientIp) // not explicitly specified in ipv4 list
|
||||||
!Blacklist._rules.ipv6.includes(clientIp) && // not explicitly specified in ipv6 list
|
&& !Blacklist._rules.ipv6.includes(clientIp) // not explicitly specified in ipv6 list
|
||||||
!Blacklist._rules.cidr.some(function (subnet) {
|
&& !Blacklist._rules.cidr.some(function (subnet) {
|
||||||
var cidr = ipaddr.parseCIDR(subnet);
|
var cidr = ipaddr.parseCIDR(subnet);
|
||||||
if (addr.kind() !== cidr[0].kind()) {
|
if (addr.kind() !== cidr[0].kind()) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -273,4 +273,3 @@ module.exports = function (middleware) {
|
|||||||
return title;
|
return title;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -61,4 +61,3 @@ module.exports = function (middleware) {
|
|||||||
next();
|
next();
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -89,11 +89,11 @@ module.exports = function (middleware) {
|
|||||||
}, next);
|
}, next);
|
||||||
},
|
},
|
||||||
function (results, next) {
|
function (results, next) {
|
||||||
var str = results.header +
|
var str = results.header
|
||||||
(res.locals.postHeader || '') +
|
+ (res.locals.postHeader || '')
|
||||||
results.content + '<script id="ajaxify-data"></script>' +
|
+ results.content + '<script id="ajaxify-data"></script>'
|
||||||
(res.locals.preFooter || '') +
|
+ (res.locals.preFooter || '')
|
||||||
results.footer;
|
+ results.footer;
|
||||||
|
|
||||||
translate(str, req, res, next);
|
translate(str, req, res, next);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -106,16 +106,16 @@ function getStaticDirectories(pluginData, callback) {
|
|||||||
|
|
||||||
async.each(dirs, function (route, next) {
|
async.each(dirs, function (route, next) {
|
||||||
if (!validMappedPath.test(route)) {
|
if (!validMappedPath.test(route)) {
|
||||||
winston.warn('[plugins/' + pluginData.id + '] Invalid mapped path specified: ' +
|
winston.warn('[plugins/' + pluginData.id + '] Invalid mapped path specified: '
|
||||||
route + '. Path must adhere to: ' + validMappedPath.toString());
|
+ route + '. Path must adhere to: ' + validMappedPath.toString());
|
||||||
return next();
|
return next();
|
||||||
}
|
}
|
||||||
|
|
||||||
var dirPath = path.join(pluginData.path, pluginData.staticDirs[route]);
|
var dirPath = path.join(pluginData.path, pluginData.staticDirs[route]);
|
||||||
fs.stat(dirPath, function (err, stats) {
|
fs.stat(dirPath, function (err, stats) {
|
||||||
if (err && err.code === 'ENOENT') {
|
if (err && err.code === 'ENOENT') {
|
||||||
winston.warn('[plugins/' + pluginData.id + '] Mapped path \'' +
|
winston.warn('[plugins/' + pluginData.id + '] Mapped path \''
|
||||||
route + ' => ' + dirPath + '\' not found.');
|
+ route + ' => ' + dirPath + '\' not found.');
|
||||||
return next();
|
return next();
|
||||||
}
|
}
|
||||||
if (err) {
|
if (err) {
|
||||||
@@ -123,8 +123,8 @@ function getStaticDirectories(pluginData, callback) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!stats.isDirectory()) {
|
if (!stats.isDirectory()) {
|
||||||
winston.warn('[plugins/' + pluginData.id + '] Mapped path \'' +
|
winston.warn('[plugins/' + pluginData.id + '] Mapped path \''
|
||||||
route + ' => ' + dirPath + '\' is not a directory.');
|
+ route + ' => ' + dirPath + '\' is not a directory.');
|
||||||
return next();
|
return next();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -135,8 +135,8 @@ function getStaticDirectories(pluginData, callback) {
|
|||||||
if (err) {
|
if (err) {
|
||||||
return callback(err);
|
return callback(err);
|
||||||
}
|
}
|
||||||
winston.verbose('[plugins] found ' + Object.keys(staticDirs).length +
|
winston.verbose('[plugins] found ' + Object.keys(staticDirs).length
|
||||||
' static directories for ' + pluginData.id);
|
+ ' static directories for ' + pluginData.id);
|
||||||
callback(null, staticDirs);
|
callback(null, staticDirs);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,10 +34,10 @@ module.exports = function (Plugins) {
|
|||||||
var method;
|
var method;
|
||||||
|
|
||||||
if (Object.keys(Plugins.deprecatedHooks).includes(data.hook)) {
|
if (Object.keys(Plugins.deprecatedHooks).includes(data.hook)) {
|
||||||
winston.warn('[plugins/' + id + '] Hook `' + data.hook + '` is deprecated, ' +
|
winston.warn('[plugins/' + id + '] Hook `' + data.hook + '` is deprecated, '
|
||||||
(Plugins.deprecatedHooks[data.hook] ?
|
+ (Plugins.deprecatedHooks[data.hook]
|
||||||
'please use `' + Plugins.deprecatedHooks[data.hook] + '` instead.' :
|
? 'please use `' + Plugins.deprecatedHooks[data.hook] + '` instead.'
|
||||||
'there is no alternative.'
|
: 'there is no alternative.'
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -114,4 +114,3 @@ module.exports = function (Posts) {
|
|||||||
], callback);
|
], callback);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -70,4 +70,3 @@ module.exports = function (Posts) {
|
|||||||
], callback);
|
], callback);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -141,8 +141,8 @@ module.exports = function (privileges) {
|
|||||||
},
|
},
|
||||||
function (results, next) {
|
function (results, next) {
|
||||||
cids = cids.filter(function (cid, index) {
|
cids = cids.filter(function (cid, index) {
|
||||||
return !results.categories[index].disabled &&
|
return !results.categories[index].disabled
|
||||||
(results.allowedTo[index] || results.isAdmin || results.isModerators[index]);
|
&& (results.allowedTo[index] || results.isAdmin || results.isModerators[index]);
|
||||||
});
|
});
|
||||||
|
|
||||||
next(null, cids.filter(Boolean));
|
next(null, cids.filter(Boolean));
|
||||||
|
|||||||
@@ -115,15 +115,15 @@ module.exports = function (privileges) {
|
|||||||
var isModOf = {};
|
var isModOf = {};
|
||||||
cids = cids.filter(function (cid, index) {
|
cids = cids.filter(function (cid, index) {
|
||||||
isModOf[cid] = results.isModerators[index];
|
isModOf[cid] = results.isModerators[index];
|
||||||
return !results.categories[index].disabled &&
|
return !results.categories[index].disabled
|
||||||
(results.allowedTo[index] || results.isAdmin || results.isModerators[index]);
|
&& (results.allowedTo[index] || results.isAdmin || results.isModerators[index]);
|
||||||
});
|
});
|
||||||
|
|
||||||
const cidsSet = new Set(cids);
|
const cidsSet = new Set(cids);
|
||||||
|
|
||||||
pids = postData.filter(function (post) {
|
pids = postData.filter(function (post) {
|
||||||
return post.topic && cidsSet.has(post.topic.cid) &&
|
return post.topic && cidsSet.has(post.topic.cid)
|
||||||
((!post.topic.deleted && !post.deleted) || results.isAdmin || isModOf[post.cid]);
|
&& ((!post.topic.deleted && !post.deleted) || results.isAdmin || isModOf[post.cid]);
|
||||||
}).map(post => post.pid);
|
}).map(post => post.pid);
|
||||||
|
|
||||||
plugins.fireHook('filter:privileges.posts.filter', {
|
plugins.fireHook('filter:privileges.posts.filter', {
|
||||||
|
|||||||
@@ -92,15 +92,15 @@ module.exports = function (privileges) {
|
|||||||
var isModOf = {};
|
var isModOf = {};
|
||||||
cids = cids.filter(function (cid, index) {
|
cids = cids.filter(function (cid, index) {
|
||||||
isModOf[cid] = results.isModerators[index];
|
isModOf[cid] = results.isModerators[index];
|
||||||
return !results.categories[index].disabled &&
|
return !results.categories[index].disabled
|
||||||
(results.allowedTo[index] || results.isAdmin || results.isModerators[index]);
|
&& (results.allowedTo[index] || results.isAdmin || results.isModerators[index]);
|
||||||
});
|
});
|
||||||
|
|
||||||
const cidsSet = new Set(cids);
|
const cidsSet = new Set(cids);
|
||||||
|
|
||||||
tids = topicsData.filter(function (topic) {
|
tids = topicsData.filter(function (topic) {
|
||||||
return cidsSet.has(topic.cid) &&
|
return cidsSet.has(topic.cid)
|
||||||
(!topic.deleted || results.isAdmin || isModOf[topic.cid]);
|
&& (!topic.deleted || results.isAdmin || isModOf[topic.cid]);
|
||||||
}).map(topic => topic.tid);
|
}).map(topic => topic.tid);
|
||||||
|
|
||||||
plugins.fireHook('filter:privileges.topics.filter', {
|
plugins.fireHook('filter:privileges.topics.filter', {
|
||||||
@@ -144,8 +144,8 @@ module.exports = function (privileges) {
|
|||||||
},
|
},
|
||||||
function (results, next) {
|
function (results, next) {
|
||||||
uids = uids.filter(function (uid, index) {
|
uids = uids.filter(function (uid, index) {
|
||||||
return !results.disabled &&
|
return !results.disabled
|
||||||
((results.allowedTo[index] && !topicData.deleted) || results.isAdmins[index] || results.isModerators[index]);
|
&& ((results.allowedTo[index] && !topicData.deleted) || results.isAdmins[index] || results.isModerators[index]);
|
||||||
});
|
});
|
||||||
|
|
||||||
next(null, uids);
|
next(null, uids);
|
||||||
@@ -193,9 +193,9 @@ module.exports = function (privileges) {
|
|||||||
|
|
||||||
var preventTopicDeleteAfterReplies = meta.config.preventTopicDeleteAfterReplies;
|
var preventTopicDeleteAfterReplies = meta.config.preventTopicDeleteAfterReplies;
|
||||||
if (preventTopicDeleteAfterReplies && (topicData.postcount - 1) >= preventTopicDeleteAfterReplies) {
|
if (preventTopicDeleteAfterReplies && (topicData.postcount - 1) >= preventTopicDeleteAfterReplies) {
|
||||||
var langKey = preventTopicDeleteAfterReplies > 1 ?
|
var langKey = preventTopicDeleteAfterReplies > 1
|
||||||
'[[error:cant-delete-topic-has-replies, ' + meta.config.preventTopicDeleteAfterReplies + ']]' :
|
? '[[error:cant-delete-topic-has-replies, ' + meta.config.preventTopicDeleteAfterReplies + ']]'
|
||||||
'[[error:cant-delete-topic-has-reply]]';
|
: '[[error:cant-delete-topic-has-reply]]';
|
||||||
return next(new Error(langKey));
|
return next(new Error(langKey));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
|
||||||
|
var async = require('async');
|
||||||
var db = require('../database');
|
var db = require('../database');
|
||||||
var plugins = require('../plugins');
|
var plugins = require('../plugins');
|
||||||
var async = require('async');
|
|
||||||
|
|
||||||
var rewards = module.exports;
|
var rewards = module.exports;
|
||||||
|
|
||||||
|
|||||||
@@ -39,4 +39,3 @@ module.exports = function (app, middleware, controllers) {
|
|||||||
router.post('/user/:userslug/uploadcover', middlewares.concat([middleware.authenticate, middleware.checkGlobalPrivacySettings, middleware.checkAccountPermissions]), controllers.accounts.edit.uploadCoverPicture);
|
router.post('/user/:userslug/uploadcover', middlewares.concat([middleware.authenticate, middleware.checkGlobalPrivacySettings, middleware.checkAccountPermissions]), controllers.accounts.edit.uploadCoverPicture);
|
||||||
router.post('/groups/uploadpicture', middlewares.concat([middleware.authenticate]), controllers.groups.uploadCover);
|
router.post('/groups/uploadpicture', middlewares.concat([middleware.authenticate]), controllers.groups.uploadCover);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -171,8 +171,8 @@ module.exports = function (app, middleware, callback) {
|
|||||||
// DEPRECATED (v1.12.0)
|
// DEPRECATED (v1.12.0)
|
||||||
app.use(relativePath + '/assets/stylesheet.css', function (req, res) {
|
app.use(relativePath + '/assets/stylesheet.css', function (req, res) {
|
||||||
if (!warned.has(req.path)) {
|
if (!warned.has(req.path)) {
|
||||||
winston.warn('[deprecated] Accessing `/assets/stylesheet.css` is deprecated to be REMOVED in NodeBB v1.12.0. ' +
|
winston.warn('[deprecated] Accessing `/assets/stylesheet.css` is deprecated to be REMOVED in NodeBB v1.12.0. '
|
||||||
'Use `/assets/client.css` to access this file');
|
+ 'Use `/assets/client.css` to access this file');
|
||||||
warned.add(req.path);
|
warned.add(req.path);
|
||||||
}
|
}
|
||||||
res.redirect(relativePath + '/assets/client.css?' + meta.config['cache-buster']);
|
res.redirect(relativePath + '/assets/client.css?' + meta.config['cache-buster']);
|
||||||
|
|||||||
@@ -42,8 +42,8 @@ sitemap.render = function (callback) {
|
|||||||
|
|
||||||
sitemap.getPages = function (callback) {
|
sitemap.getPages = function (callback) {
|
||||||
if (
|
if (
|
||||||
sitemap.maps.pages &&
|
sitemap.maps.pages
|
||||||
Date.now() < parseInt(sitemap.maps.pages.cacheSetTimestamp, 10) + parseInt(sitemap.maps.pages.cacheResetPeriod, 10)
|
&& Date.now() < parseInt(sitemap.maps.pages.cacheSetTimestamp, 10) + parseInt(sitemap.maps.pages.cacheResetPeriod, 10)
|
||||||
) {
|
) {
|
||||||
return sitemap.maps.pages.toXML(callback);
|
return sitemap.maps.pages.toXML(callback);
|
||||||
}
|
}
|
||||||
@@ -82,8 +82,8 @@ sitemap.getPages = function (callback) {
|
|||||||
|
|
||||||
sitemap.getCategories = function (callback) {
|
sitemap.getCategories = function (callback) {
|
||||||
if (
|
if (
|
||||||
sitemap.maps.categories &&
|
sitemap.maps.categories
|
||||||
Date.now() < parseInt(sitemap.maps.categories.cacheSetTimestamp, 10) + parseInt(sitemap.maps.categories.cacheResetPeriod, 10)
|
&& Date.now() < parseInt(sitemap.maps.categories.cacheSetTimestamp, 10) + parseInt(sitemap.maps.categories.cacheResetPeriod, 10)
|
||||||
) {
|
) {
|
||||||
return sitemap.maps.categories.toXML(callback);
|
return sitemap.maps.categories.toXML(callback);
|
||||||
}
|
}
|
||||||
@@ -124,8 +124,8 @@ sitemap.getTopicPage = function (page, callback) {
|
|||||||
var max = min + numTopics;
|
var max = min + numTopics;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
sitemap.maps.topics[page - 1] &&
|
sitemap.maps.topics[page - 1]
|
||||||
Date.now() < parseInt(sitemap.maps.topics[page - 1].cacheSetTimestamp, 10) + parseInt(sitemap.maps.topics[page - 1].cacheResetPeriod, 10)
|
&& Date.now() < parseInt(sitemap.maps.topics[page - 1].cacheSetTimestamp, 10) + parseInt(sitemap.maps.topics[page - 1].cacheResetPeriod, 10)
|
||||||
) {
|
) {
|
||||||
return sitemap.maps.topics[page - 1].toXML(callback);
|
return sitemap.maps.topics[page - 1].toXML(callback);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
var async = require('async');
|
||||||
var plugins = require('./plugins');
|
var plugins = require('./plugins');
|
||||||
var db = require('./database');
|
var db = require('./database');
|
||||||
var async = require('async');
|
|
||||||
|
|
||||||
var social = module.exports;
|
var social = module.exports;
|
||||||
|
|
||||||
|
|||||||
@@ -10,4 +10,3 @@ SocketRewards.save = function (socket, data, callback) {
|
|||||||
SocketRewards.delete = function (socket, data, callback) {
|
SocketRewards.delete = function (socket, data, callback) {
|
||||||
rewardsAdmin.delete(data, callback);
|
rewardsAdmin.delete(data, callback);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -249,10 +249,10 @@ SocketGroups.create = function (socket, data, callback) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
SocketGroups.delete = isOwner(function (socket, data, callback) {
|
SocketGroups.delete = isOwner(function (socket, data, callback) {
|
||||||
if (data.groupName === 'administrators' ||
|
if (data.groupName === 'administrators'
|
||||||
data.groupName === 'registered-users' ||
|
|| data.groupName === 'registered-users'
|
||||||
data.groupName === 'guests' ||
|
|| data.groupName === 'guests'
|
||||||
data.groupName === 'Global Moderators') {
|
|| data.groupName === 'Global Moderators') {
|
||||||
return callback(new Error('[[error:not-allowed]]'));
|
return callback(new Error('[[error:not-allowed]]'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -70,8 +70,8 @@ function filterTidCidIgnorers(uids, tid, cid, callback) {
|
|||||||
},
|
},
|
||||||
function (results, next) {
|
function (results, next) {
|
||||||
uids = uids.filter(function (uid, index) {
|
uids = uids.filter(function (uid, index) {
|
||||||
return results.topicFollowed[index] ||
|
return results.topicFollowed[index]
|
||||||
(!results.topicFollowed[index] && !results.topicIgnored[index] && !results.categoryIgnored[index]);
|
|| (!results.topicFollowed[index] && !results.topicIgnored[index] && !results.categoryIgnored[index]);
|
||||||
});
|
});
|
||||||
next(null, uids);
|
next(null, uids);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -259,4 +259,3 @@ Sockets.reqFromSocket = function (socket, payload, event) {
|
|||||||
headers: headers,
|
headers: headers,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -148,4 +148,3 @@ module.exports = function (SocketUser) {
|
|||||||
], callback);
|
], callback);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -4,9 +4,9 @@
|
|||||||
var async = require('async');
|
var async = require('async');
|
||||||
var validator = require('validator');
|
var validator = require('validator');
|
||||||
|
|
||||||
|
var _ = require('lodash');
|
||||||
var db = require('../database');
|
var db = require('../database');
|
||||||
var meta = require('../meta');
|
var meta = require('../meta');
|
||||||
var _ = require('lodash');
|
|
||||||
var plugins = require('../plugins');
|
var plugins = require('../plugins');
|
||||||
var utils = require('../utils');
|
var utils = require('../utils');
|
||||||
var batch = require('../batch');
|
var batch = require('../batch');
|
||||||
|
|||||||
@@ -464,9 +464,9 @@ module.exports = function (Topics) {
|
|||||||
function (results, next) {
|
function (results, next) {
|
||||||
var cutoff = Topics.unreadCutoff();
|
var cutoff = Topics.unreadCutoff();
|
||||||
var result = tids.map(function (tid, index) {
|
var result = tids.map(function (tid, index) {
|
||||||
var read = !results.tids_unread[index] &&
|
var read = !results.tids_unread[index]
|
||||||
(results.topicScores[index] < cutoff ||
|
&& (results.topicScores[index] < cutoff
|
||||||
!!(results.userScores[index] && results.userScores[index] >= results.topicScores[index]));
|
|| !!(results.userScores[index] && results.userScores[index] >= results.topicScores[index]));
|
||||||
return { tid: tid, read: read, index: index };
|
return { tid: tid, read: read, index: index };
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -217,4 +217,3 @@ Upgrade.incrementProgress = function (value) {
|
|||||||
readline.cursorTo(process.stdout, 0);
|
readline.cursorTo(process.stdout, 0);
|
||||||
process.stdout.write(' [' + (filled ? new Array(filled).join('#') : '') + new Array(unfilled).join(' ') + '] (' + this.current + '/' + (this.total || '??') + ') ' + percentage + ' ');
|
process.stdout.write(' [' + (filled ? new Array(filled).join('#') : '') + new Array(unfilled).join(' ') + '] (' + this.current + '/' + (this.total || '??') + ') ' + percentage + ' ');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
var async = require('async');
|
||||||
var db = require('../../database');
|
var db = require('../../database');
|
||||||
|
|
||||||
var async = require('async');
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'Chat room hashes',
|
name: 'Chat room hashes',
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var db = require('../../database');
|
|
||||||
|
|
||||||
var async = require('async');
|
var async = require('async');
|
||||||
var winston = require('winston');
|
var winston = require('winston');
|
||||||
|
var db = require('../../database');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'Upgrading chats',
|
name: 'Upgrading chats',
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
var async = require('async');
|
||||||
var db = require('../../database');
|
var db = require('../../database');
|
||||||
|
|
||||||
var async = require('async');
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'Social: Post Sharing',
|
name: 'Social: Post Sharing',
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
var async = require('async');
|
||||||
var db = require('../../database');
|
var db = require('../../database');
|
||||||
|
|
||||||
var async = require('async');
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'Adding theme to active plugins sorted set',
|
name: 'Adding theme to active plugins sorted set',
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var db = require('../../database');
|
|
||||||
|
|
||||||
var async = require('async');
|
var async = require('async');
|
||||||
var winston = require('winston');
|
var winston = require('winston');
|
||||||
|
var db = require('../../database');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'Creating user best post sorted sets',
|
name: 'Creating user best post sorted sets',
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var db = require('../../database');
|
|
||||||
|
|
||||||
var async = require('async');
|
var async = require('async');
|
||||||
var winston = require('winston');
|
var winston = require('winston');
|
||||||
|
var db = require('../../database');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'Creating users:notvalidated',
|
name: 'Creating users:notvalidated',
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var db = require('../../database');
|
|
||||||
|
|
||||||
var async = require('async');
|
var async = require('async');
|
||||||
var winston = require('winston');
|
var winston = require('winston');
|
||||||
|
var db = require('../../database');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'Giving topics:read privs to any group that was previously allowed to Find & Access Category',
|
name: 'Giving topics:read privs to any group that was previously allowed to Find & Access Category',
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var db = require('../../database');
|
|
||||||
|
|
||||||
var async = require('async');
|
var async = require('async');
|
||||||
var winston = require('winston');
|
var winston = require('winston');
|
||||||
|
var db = require('../../database');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'Dismiss flags from deleted topics',
|
name: 'Dismiss flags from deleted topics',
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var db = require('../../database');
|
|
||||||
|
|
||||||
var async = require('async');
|
var async = require('async');
|
||||||
var winston = require('winston');
|
var winston = require('winston');
|
||||||
|
var db = require('../../database');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'Group title from settings to user profile',
|
name: 'Group title from settings to user profile',
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var db = require('../../database');
|
|
||||||
|
|
||||||
var async = require('async');
|
var async = require('async');
|
||||||
var winston = require('winston');
|
var winston = require('winston');
|
||||||
|
var db = require('../../database');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'Store upvotes/downvotes separately',
|
name: 'Store upvotes/downvotes separately',
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var db = require('../../database');
|
|
||||||
|
|
||||||
var async = require('async');
|
var async = require('async');
|
||||||
var winston = require('winston');
|
var winston = require('winston');
|
||||||
|
var db = require('../../database');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'Users post count per tid',
|
name: 'Users post count per tid',
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var db = require('../../database');
|
|
||||||
|
|
||||||
var async = require('async');
|
var async = require('async');
|
||||||
var winston = require('winston');
|
var winston = require('winston');
|
||||||
|
var db = require('../../database');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'Removing best posts with negative scores',
|
name: 'Removing best posts with negative scores',
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
var async = require('async');
|
||||||
var db = require('../../database');
|
var db = require('../../database');
|
||||||
|
|
||||||
var async = require('async');
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'Giving upload privileges',
|
name: 'Giving upload privileges',
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var db = require('../../database');
|
|
||||||
var batch = require('../../batch');
|
|
||||||
|
|
||||||
var async = require('async');
|
var async = require('async');
|
||||||
var crypto = require('crypto');
|
var crypto = require('crypto');
|
||||||
var nconf = require('nconf');
|
var nconf = require('nconf');
|
||||||
|
var batch = require('../../batch');
|
||||||
|
var db = require('../../database');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'Hash all IP addresses stored in Recent IPs zset',
|
name: 'Hash all IP addresses stored in Recent IPs zset',
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
var async = require('async');
|
||||||
var db = require('../../database');
|
var db = require('../../database');
|
||||||
|
|
||||||
var async = require('async');
|
|
||||||
var batch = require('../../batch');
|
var batch = require('../../batch');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
var async = require('async');
|
||||||
var db = require('../../database');
|
var db = require('../../database');
|
||||||
|
|
||||||
var async = require('async');
|
|
||||||
var batch = require('../../batch');
|
var batch = require('../../batch');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
var async = require('async');
|
||||||
var db = require('../../database');
|
var db = require('../../database');
|
||||||
|
|
||||||
var async = require('async');
|
|
||||||
var batch = require('../../batch');
|
var batch = require('../../batch');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var db = require('../../database');
|
|
||||||
var nconf = require('nconf');
|
var nconf = require('nconf');
|
||||||
|
var db = require('../../database');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'Optimize PostgreSQL sessions',
|
name: 'Optimize PostgreSQL sessions',
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
var async = require('async');
|
||||||
var db = require('../../database');
|
var db = require('../../database');
|
||||||
|
|
||||||
var async = require('async');
|
|
||||||
var batch = require('../../batch');
|
var batch = require('../../batch');
|
||||||
// var user = require('../../user');
|
// var user = require('../../user');
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
var async = require('async');
|
||||||
var db = require('../../database');
|
var db = require('../../database');
|
||||||
|
|
||||||
var async = require('async');
|
|
||||||
var batch = require('../../batch');
|
var batch = require('../../batch');
|
||||||
var user = require('../../user');
|
var user = require('../../user');
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
var async = require('async');
|
||||||
var db = require('../../database');
|
var db = require('../../database');
|
||||||
|
|
||||||
var async = require('async');
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'Rename maximumImageWidth to resizeImageWidth',
|
name: 'Rename maximumImageWidth to resizeImageWidth',
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
var async = require('async');
|
||||||
var db = require('../../database');
|
var db = require('../../database');
|
||||||
|
|
||||||
var async = require('async');
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'Category recent tids',
|
name: 'Category recent tids',
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var db = require('../../database');
|
|
||||||
|
|
||||||
var async = require('async');
|
var async = require('async');
|
||||||
var winston = require('winston');
|
var winston = require('winston');
|
||||||
|
var db = require('../../database');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'Granting edit/delete/delete topic on existing categories',
|
name: 'Granting edit/delete/delete topic on existing categories',
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
var async = require('async');
|
||||||
var db = require('../../database');
|
var db = require('../../database');
|
||||||
|
|
||||||
var async = require('async');
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'Favourites to Bookmarks',
|
name: 'Favourites to Bookmarks',
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var db = require('../../database');
|
|
||||||
|
|
||||||
var async = require('async');
|
var async = require('async');
|
||||||
var winston = require('winston');
|
var winston = require('winston');
|
||||||
|
var db = require('../../database');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'Sorted sets for post replies',
|
name: 'Sorted sets for post replies',
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
var async = require('async');
|
||||||
var db = require('../../database');
|
var db = require('../../database');
|
||||||
|
|
||||||
var async = require('async');
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'Update global and user language keys',
|
name: 'Update global and user language keys',
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var db = require('../../database');
|
|
||||||
|
|
||||||
var async = require('async');
|
var async = require('async');
|
||||||
var winston = require('winston');
|
var winston = require('winston');
|
||||||
|
var db = require('../../database');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'Sorted set for pinned topics',
|
name: 'Sorted set for pinned topics',
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
var async = require('async');
|
||||||
var db = require('../../database');
|
var db = require('../../database');
|
||||||
|
|
||||||
var async = require('async');
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'Upgrading config urls to use assets route',
|
name: 'Upgrading config urls to use assets route',
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
var async = require('async');
|
||||||
var db = require('../../database');
|
var db = require('../../database');
|
||||||
|
|
||||||
var async = require('async');
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'Update global and user sound settings',
|
name: 'Update global and user sound settings',
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
var async = require('async');
|
||||||
var db = require('../../database');
|
var db = require('../../database');
|
||||||
|
|
||||||
var async = require('async');
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'Migrating flags to new schema',
|
name: 'Migrating flags to new schema',
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
var async = require('async');
|
||||||
var db = require('../../database');
|
var db = require('../../database');
|
||||||
var batch = require('../../batch');
|
var batch = require('../../batch');
|
||||||
|
|
||||||
var async = require('async');
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'Update moderation notes to zset',
|
name: 'Update moderation notes to zset',
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
var async = require('async');
|
||||||
var db = require('../../database');
|
var db = require('../../database');
|
||||||
|
|
||||||
var async = require('async');
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'New sorted set posts:votes',
|
name: 'New sorted set posts:votes',
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
var async = require('async');
|
||||||
var db = require('../../database');
|
var db = require('../../database');
|
||||||
var batch = require('../../batch');
|
var batch = require('../../batch');
|
||||||
|
|
||||||
var async = require('async');
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'Remove relative_path from uploaded profile cover urls',
|
name: 'Remove relative_path from uploaded profile cover urls',
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var meta = require('../../meta');
|
|
||||||
|
|
||||||
var async = require('async');
|
var async = require('async');
|
||||||
var crypto = require('crypto');
|
var crypto = require('crypto');
|
||||||
|
var meta = require('../../meta');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'Clearing stale digest templates that were accidentally saved as custom',
|
name: 'Clearing stale digest templates that were accidentally saved as custom',
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var image = require('../../image');
|
|
||||||
var meta = require('../../meta');
|
|
||||||
|
|
||||||
var async = require('async');
|
var async = require('async');
|
||||||
var path = require('path');
|
var path = require('path');
|
||||||
var nconf = require('nconf');
|
var nconf = require('nconf');
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
|
var meta = require('../../meta');
|
||||||
|
var image = require('../../image');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'Generate email logo for use in email header',
|
name: 'Generate email logo for use in email header',
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
var async = require('async');
|
||||||
var db = require('../../database');
|
var db = require('../../database');
|
||||||
|
|
||||||
var async = require('async');
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'Revising minimum password strength to 1 (from 0)',
|
name: 'Revising minimum password strength to 1 (from 0)',
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
var async = require('async');
|
||||||
var db = require('../../database');
|
var db = require('../../database');
|
||||||
const batch = require('../../batch');
|
const batch = require('../../batch');
|
||||||
|
|
||||||
var async = require('async');
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'Reformatting post diffs to be stored in lists and hash instead of single zset',
|
name: 'Reformatting post diffs to be stored in lists and hash instead of single zset',
|
||||||
|
|||||||
@@ -244,11 +244,11 @@ module.exports = function (User) {
|
|||||||
function (next) {
|
function (next) {
|
||||||
request({
|
request({
|
||||||
method: 'get',
|
method: 'get',
|
||||||
url: 'http://api.stopforumspam.org/api' +
|
url: 'http://api.stopforumspam.org/api'
|
||||||
'?ip=' + encodeURIComponent(user.ip) +
|
+ '?ip=' + encodeURIComponent(user.ip)
|
||||||
'&email=' + encodeURIComponent(user.email) +
|
+ '&email=' + encodeURIComponent(user.email)
|
||||||
'&username=' + encodeURIComponent(user.username) +
|
+ '&username=' + encodeURIComponent(user.username)
|
||||||
'&f=json',
|
+ '&f=json',
|
||||||
json: true,
|
json: true,
|
||||||
}, next);
|
}, next);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -109,9 +109,9 @@ module.exports = function (User) {
|
|||||||
var expired;
|
var expired;
|
||||||
|
|
||||||
sessions = sessions.filter(function (sessionObj, idx) {
|
sessions = sessions.filter(function (sessionObj, idx) {
|
||||||
expired = !sessionObj || !sessionObj.hasOwnProperty('passport') ||
|
expired = !sessionObj || !sessionObj.hasOwnProperty('passport')
|
||||||
!sessionObj.passport.hasOwnProperty('user') ||
|
|| !sessionObj.passport.hasOwnProperty('user')
|
||||||
parseInt(sessionObj.passport.user, 10) !== parseInt(uid, 10);
|
|| parseInt(sessionObj.passport.user, 10) !== parseInt(uid, 10);
|
||||||
|
|
||||||
if (expired) {
|
if (expired) {
|
||||||
expiredSids.push(_sids[idx]);
|
expiredSids.push(_sids[idx]);
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user