Skip to content

Node.js based forum software built for the modern web

merge

Barış Soner Uşaklı3a1eba25372b
diff --cc public/less/generics.less
index ef4c7bd627,777bfcdbd9..bab162e81f
--- a/public/less/generics.less
+++ b/public/less/generics.less
@@@ -107,11 -107,11 +107,17 @@@
}
&.avatar-lg {
+ width: 64px;
+ height: 64px;
+ .user-icon-style(64px, 4rem);
+ }
+
++ &.avatar-xl {
+ width: 128px;
+ height: 128px;
+ .user-icon-style(128px, 7.5rem);
+ }
+
&.avatar-xl {
width: 128px;
height: 128px;
diff --cc public/src/client/topic.js
index 832e6e9600,e4ba5a06a5..c88af60237
--- a/public/src/client/topic.js
+++ b/public/src/client/topic.js
@@@ -156,10 -158,10 +157,10 @@@ define('forum/topic',
timeout: 0,
type: 'info',
clickfn: function () {
- navigator.scrollToPost(parseInt(bookmark - 1, 10), true);
+ navigator.scrollToIndex(parseInt(bookmark - 1, 10), true);
},
closefn: function () {
- localStorage.removeItem('topic:' + tid + ':bookmark');
+ storage.removeItem('topic:' + tid + ':bookmark');
},
});
setTimeout(function () {
diff --cc src/controllers/authentication.js
index 77f0fb46b5,c06f1ee400..09cb5837b2
--- a/src/controllers/authentication.js
+++ b/src/controllers/authentication.js
@@@ -381,14 -380,26 +381,13 @@@ authenticationController.localLogin = f
return next(new Error('[[error:local-login-disabled]]'));
}
- if (!userData || !userData.password) {
- return next(new Error('[[error:invalid-user-data]]'));
- }
-
if (result.banned) {
- // Retrieve ban reason and show error
- return user.getLatestBanInfo(uid, function (err, banInfo) {
- if (err) {
- if (err.message === 'no-ban-info') {
- next(new Error('[[error:user-banned]]'));
- } else {
- next(err);
- }
- } else if (banInfo.reason) {
- next(new Error('[[error:user-banned-reason, ' + banInfo.reason + ']]'));
- } else {
- next(new Error('[[error:user-banned]]'));
- }
- });
+ return banUser(uid, next);
}
+ user.auth.logAttempt(uid, req.ip, next);
+ },
+ function (next) {
Password.compare(password, userData.password, next);
},
function (passwordMatch, next) {
@@@ -426,26 -437,3 +425,24 @@@ authenticationController.logout = funct
res.status(200).send('');
}
};
+
+function banUser(uid, next) {
+ user.getLatestBanInfo(uid, function (err, banInfo) {
+ if (err) {
+ if (err.message === 'no-ban-info') {
+ return next(new Error('[[error:user-banned]]'));
+ }
+
+ return next(err);
+ }
+
+ if (!banInfo.reason) {
+ translator.translate('[[user:info.banned-no-reason]]', function (translated) {
+ banInfo.reason = translated;
+ next(new Error(banInfo.expiry ? '[[error:user-banned-reason-until, ' + banInfo.expiry_readable + ', ' + banInfo.reason + ']]' : '[[error:user-banned-reason, ' + banInfo.reason + ']]'));
+ });
+ } else {
+ next(new Error(banInfo.expiry ? '[[error:user-banned-reason-until, ' + banInfo.expiry_readable + ', ' + banInfo.reason + ']]' : '[[error:user-banned-reason, ' + banInfo.reason + ']]'));
+ }
+ });
+}
-
- module.exports = authenticationController;
diff --cc src/groups/delete.js
index 6494eeb0ba,1a9f91ce0a..346b2e1ef5
--- a/src/groups/delete.js
+++ b/src/groups/delete.js
@@@ -26,17 -29,16 +27,17 @@@ module.exports = function (Groups)
async.apply(db.delete, 'group:' + groupName + ':pending'),
async.apply(db.delete, 'group:' + groupName + ':invited'),
async.apply(db.delete, 'group:' + groupName + ':owners'),
+ async.apply(db.delete, 'group:' + groupName + ':member:pids'),
async.apply(db.deleteObjectField, 'groupslug:groupname', utils.slugify(groupName)),
function (next) {
- db.getSortedSetRange('groups:createtime', 0, -1, function (err, groups) {
- if (err) {
- return next(err);
- }
- async.each(groups, function (group, next) {
- db.sortedSetRemove('group:' + group + ':members', groupName, next);
- }, next);
- });
+ batch.processSortedSet('groups:createtime', function (groupNames, next) {
+ var keys = groupNames.map(function (group) {
+ return 'group:' + group + ':members';
+ });
+ db.sortedSetsRemove(keys, groupName, next);
+ }, {
+ batch: 500,
+ }, next);
},
], function (err) {
if (err) {
diff --cc src/meta/js.js
index 889b4fcbc3,0fff87c6a1..f654d45644
--- a/src/meta/js.js
+++ b/src/meta/js.js
@@@ -77,7 -78,7 +77,8 @@@ module.exports = function (Meta)
'public/src/modules/taskbar.js',
'public/src/modules/helpers.js',
'public/src/modules/string.js',
+ 'public/src/modules/flags.js',
+ 'public/src/modules/storage.js',
],
// modules listed below are built (/src/modules) so they can be defined anonymously
diff --cc src/webserver.js
index f3ab28f630,412378883c..868eb4429c
--- a/src/webserver.js
+++ b/src/webserver.js
@@@ -158,12 -158,10 +161,14 @@@ function setupExpressApp(app, callback
var toobusy = require('toobusy-js');
toobusy.maxLag(parseInt(meta.config.eventLoopLagThreshold, 10) || 100);
toobusy.interval(parseInt(meta.config.eventLoopInterval, 10) || 500);
+
+ setupAutoLocale(app, callback);
}
+function ping(req, res) {
+ res.status(200).send(req.path === '/sping' ? 'healthy' : '200');
+}
+
function setupFavicon(app) {
var faviconPath = meta.config['brand:favicon'] || 'favicon.ico';
faviconPath = path.join(nconf.get('base_dir'), 'public', faviconPath.replace(/assets\/uploads/, 'uploads'));