diff --git a/public/templates/admin/settings.tpl b/public/templates/admin/settings.tpl index c048730ca1..68fbacd632 100644 --- a/public/templates/admin/settings.tpl +++ b/public/templates/admin/settings.tpl @@ -9,7 +9,9 @@
- +
+ + diff --git a/src/install.js b/src/install.js index 7889a94aec..4a4ef9351f 100644 --- a/src/install.js +++ b/src/install.js @@ -113,6 +113,9 @@ var async = require('async'), }, { field: 'imgurClientID', value: '' + }, { + field: 'maximumProfileImageSize', + value: 256 }]; async.each(defaults, function (configObj, next) { diff --git a/src/routes/user.js b/src/routes/user.js index cd8e60de1e..78cd6da6c6 100644 --- a/src/routes/user.js +++ b/src/routes/user.js @@ -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) { @@ -135,10 +136,12 @@ var user = require('./../user.js'), app.post('/user/uploadpicture', function(req, res) { if (!req.user) return res.redirect('/403'); + + var uploadSize = meta.config.maximumProfileImageSize || 256; - if (req.files.userPhoto.size > 262144) { + 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; }