v1.18.x
barisusakli 10 years ago
parent f7a3aef322
commit d5dd48ecc8

@ -94,5 +94,9 @@
{
"field": "requireEmailConfirmation",
"value": 0
},
{
"field": "profile:allowProfileImageUploads",
"value": 1
}
]

@ -44,6 +44,7 @@ apiController.getConfig = function(req, res, next) {
config.allowGuestSearching = parseInt(meta.config.allowGuestSearching, 10) === 1;
config.allowGuestHandles = parseInt(meta.config.allowGuestHandles, 10) === 1;
config.allowFileUploads = parseInt(meta.config.allowFileUploads, 10) === 1;
config.allowProfileImageUploads = parseInt(meta.config.allowProfileImageUploads) === 1;
config.allowTopicsThumbnail = parseInt(meta.config.allowTopicsThumbnail, 10) === 1;
config.allowAccountDelete = parseInt(meta.config.allowAccountDelete, 10) === 1;
config.privateUserInfo = parseInt(meta.config.privateUserInfo, 10) === 1;

@ -24,6 +24,9 @@ module.exports = function(User) {
var convertToPNG = parseInt(meta.config['profile:convertProfileImageToPNG'], 10) === 1;
async.waterfall([
function(next) {
next(parseInt(meta.config.allowProfileImageUploads) !== 1 ? new Error('[[error:profile-image-uploads-disabled]]') : null);
},
function(next) {
next(picture.size > uploadSize * 1024 ? new Error('[[error:file-too-big, ' + uploadSize + ']]') : null);
},
@ -44,7 +47,6 @@ module.exports = function(User) {
}
}
], function(err, result) {
function done(err, image) {
if (err) {
return callback(err);

@ -46,6 +46,12 @@
<div class="panel-heading">Avatars</div>
<div class="panel-body">
<form>
<div class="checkbox">
<label>
<input type="checkbox" data-field="allowProfileImageUploads"> <strong>Allow users to upload profile images</strong>
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" data-field="profile:convertProfileImageToPNG"> <strong>Convert profile image uploads to PNG</strong>

Loading…
Cancel
Save