|
|
|
@ -5,7 +5,8 @@ var user = require('./../user.js'),
|
|
|
|
|
utils = require('./../../public/src/utils.js'),
|
|
|
|
|
path = require('path'),
|
|
|
|
|
winston = require('winston'),
|
|
|
|
|
nconf = require('nconf');
|
|
|
|
|
nconf = require('nconf'),
|
|
|
|
|
meta = require('./../meta');
|
|
|
|
|
|
|
|
|
|
(function(User) {
|
|
|
|
|
User.create_routes = function(app) {
|
|
|
|
@ -136,9 +137,11 @@ var user = require('./../user.js'),
|
|
|
|
|
if (!req.user)
|
|
|
|
|
return res.redirect('/403');
|
|
|
|
|
|
|
|
|
|
if (req.files.userPhoto.size > 262144) {
|
|
|
|
|
var uploadSize = meta.config.maximumProfileImageSize || 256;
|
|
|
|
|
|
|
|
|
|
if (req.files.userPhoto.size > uploadSize * 1024) {
|
|
|
|
|
res.send({
|
|
|
|
|
error: 'Images must be smaller than 256kb!'
|
|
|
|
|
error: 'Images must be smaller than ' + uploadSize + ' kb!'
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|