mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-05-06 13:26:25 +02:00
closes #5504
This commit is contained in:
@@ -241,22 +241,29 @@ define('forum/account/edit', ['forum/account/header', 'translator', 'components'
|
||||
uploadModal.find('.upload-btn').on('click', function () {
|
||||
var url = uploadModal.find('#uploadFromUrl').val();
|
||||
if (!url) {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
uploadModal.modal('hide');
|
||||
|
||||
pictureCropper.handleImageCrop({
|
||||
socket.emit('user.uploadProfileImageFromUrl', {
|
||||
uid: ajaxify.data.uid,
|
||||
url: url,
|
||||
socketMethod: 'user.uploadCroppedPicture',
|
||||
aspectRatio: '1 / 1',
|
||||
allowSkippingCrop: false,
|
||||
restrictImageDimension: true,
|
||||
imageDimension: ajaxify.data.profileImageDimension,
|
||||
paramName: 'uid',
|
||||
paramValue: ajaxify.data.theirid,
|
||||
}, onUploadComplete);
|
||||
}, function (err, url) {
|
||||
if (err) {
|
||||
return app.alertError(err);
|
||||
}
|
||||
|
||||
uploadModal.modal('hide');
|
||||
|
||||
pictureCropper.handleImageCrop({
|
||||
url: url,
|
||||
socketMethod: 'user.uploadCroppedPicture',
|
||||
aspectRatio: '1 / 1',
|
||||
allowSkippingCrop: false,
|
||||
restrictImageDimension: true,
|
||||
imageDimension: ajaxify.data.profileImageDimension,
|
||||
paramName: 'uid',
|
||||
paramValue: ajaxify.data.theirid,
|
||||
}, onUploadComplete);
|
||||
});
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
@@ -50,12 +50,7 @@ module.exports = function (User) {
|
||||
}, next);
|
||||
},
|
||||
function (image, next) {
|
||||
User.setUserFields(uid, {
|
||||
uploadedpicture: image.url,
|
||||
picture: image.url,
|
||||
}, function (err) {
|
||||
next(err, image);
|
||||
});
|
||||
next(null, image);
|
||||
},
|
||||
], callback);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user