|
|
|
@ -27,6 +27,7 @@ editController.get = function (req, res, callback) {
|
|
|
|
|
userData.maximumProfileImageSize = parseInt(meta.config.maximumProfileImageSize, 10);
|
|
|
|
|
userData.allowProfileImageUploads = parseInt(meta.config.allowProfileImageUploads) === 1;
|
|
|
|
|
userData.allowAccountDelete = parseInt(meta.config.allowAccountDelete, 10) === 1;
|
|
|
|
|
userData.profileImageDimension = parseInt(meta.config.profileImageDimension, 10) || 128;
|
|
|
|
|
|
|
|
|
|
userData.groups = userData.groups.filter(function (group) {
|
|
|
|
|
return group && group.userTitleEnabled && !groups.isPrivilegeGroup(group.name) && group.name !== 'registered-users';
|
|
|
|
@ -36,7 +37,12 @@ editController.get = function (req, res, callback) {
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
userData.title = '[[pages:account/edit, ' + userData.username + ']]';
|
|
|
|
|
userData.breadcrumbs = helpers.buildBreadcrumbs([{text: userData.username, url: '/user/' + userData.userslug}, {text: '[[user:edit]]'}]);
|
|
|
|
|
userData.breadcrumbs = helpers.buildBreadcrumbs([{
|
|
|
|
|
text: userData.username,
|
|
|
|
|
url: '/user/' + userData.userslug
|
|
|
|
|
}, {
|
|
|
|
|
text: '[[user:edit]]'
|
|
|
|
|
}]);
|
|
|
|
|
userData.editButtons = [];
|
|
|
|
|
|
|
|
|
|
plugins.fireHook('filter:user.account.edit', userData, function (err, userData) {
|
|
|
|
@ -75,11 +81,15 @@ function renderRoute(name, req, res, next) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
userData.title = '[[pages:account/edit/' + name + ', ' + userData.username + ']]';
|
|
|
|
|
userData.breadcrumbs = helpers.buildBreadcrumbs([
|
|
|
|
|
{text: userData.username, url: '/user/' + userData.userslug},
|
|
|
|
|
{text: '[[user:edit]]', url: '/user/' + userData.userslug + '/edit'},
|
|
|
|
|
{text: '[[user:' + name + ']]'}
|
|
|
|
|
]);
|
|
|
|
|
userData.breadcrumbs = helpers.buildBreadcrumbs([{
|
|
|
|
|
text: userData.username,
|
|
|
|
|
url: '/user/' + userData.userslug
|
|
|
|
|
}, {
|
|
|
|
|
text: '[[user:edit]]',
|
|
|
|
|
url: '/user/' + userData.userslug + '/edit'
|
|
|
|
|
}, {
|
|
|
|
|
text: '[[user:' + name + ']]'
|
|
|
|
|
}]);
|
|
|
|
|
|
|
|
|
|
res.render('account/edit/' + name, userData);
|
|
|
|
|
});
|
|
|
|
@ -139,7 +149,10 @@ editController.uploadPicture = function (req, res, next) {
|
|
|
|
|
return next(err);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
res.json([{name: userPhoto.name, url: image.url.startsWith('http') ? image.url : nconf.get('relative_path') + image.url}]);
|
|
|
|
|
res.json([{
|
|
|
|
|
name: userPhoto.name,
|
|
|
|
|
url: image.url.startsWith('http') ? image.url : nconf.get('relative_path') + image.url
|
|
|
|
|
}]);
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -154,8 +167,10 @@ editController.uploadCoverPicture = function (req, res, next) {
|
|
|
|
|
return next(err);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
res.json([{ url: image.url }]);
|
|
|
|
|
res.json([{
|
|
|
|
|
url: image.url
|
|
|
|
|
}]);
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
module.exports = editController;
|
|
|
|
|
module.exports = editController;
|
|
|
|
|