mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: #7748, if reputation system is disabled, dont check min reputation
This commit is contained in:
@@ -34,14 +34,14 @@ editController.get = function (req, res, callback) {
|
|||||||
userData.maximumSignatureLength = meta.config.maximumSignatureLength;
|
userData.maximumSignatureLength = meta.config.maximumSignatureLength;
|
||||||
userData.maximumAboutMeLength = meta.config.maximumAboutMeLength;
|
userData.maximumAboutMeLength = meta.config.maximumAboutMeLength;
|
||||||
userData.maximumProfileImageSize = meta.config.maximumProfileImageSize;
|
userData.maximumProfileImageSize = meta.config.maximumProfileImageSize;
|
||||||
userData.allowProfilePicture = !userData.isSelf || userData.reputation >= meta.config['min:rep:profile-picture'];
|
userData.allowProfilePicture = !userData.isSelf || !!meta.config['reputation:disabled'] || userData.reputation >= meta.config['min:rep:profile-picture'];
|
||||||
userData.allowCoverPicture = !userData.isSelf || userData.reputation >= meta.config['min:rep:cover-picture'];
|
userData.allowCoverPicture = !userData.isSelf || !!meta.config['reputation:disabled'] || userData.reputation >= meta.config['min:rep:cover-picture'];
|
||||||
userData.allowProfileImageUploads = meta.config.allowProfileImageUploads;
|
userData.allowProfileImageUploads = meta.config.allowProfileImageUploads;
|
||||||
userData.allowMultipleBadges = meta.config.allowMultipleBadges === 1;
|
userData.allowMultipleBadges = meta.config.allowMultipleBadges === 1;
|
||||||
userData.allowAccountDelete = meta.config.allowAccountDelete === 1;
|
userData.allowAccountDelete = meta.config.allowAccountDelete === 1;
|
||||||
userData.allowWebsite = !userData.isSelf || userData.reputation >= meta.config['min:rep:website'];
|
userData.allowWebsite = !userData.isSelf || !!meta.config['reputation:disabled'] || userData.reputation >= meta.config['min:rep:website'];
|
||||||
userData.allowAboutMe = !userData.isSelf || userData.reputation >= meta.config['min:rep:aboutme'];
|
userData.allowAboutMe = !userData.isSelf || !!meta.config['reputation:disabled'] || userData.reputation >= meta.config['min:rep:aboutme'];
|
||||||
userData.allowSignature = results.canUseSignature && (!userData.isSelf || userData.reputation >= meta.config['min:rep:signature']);
|
userData.allowSignature = results.canUseSignature && (!userData.isSelf || !!meta.config['reputation:disabled'] || userData.reputation >= meta.config['min:rep:signature']);
|
||||||
userData.profileImageDimension = meta.config.profileImageDimension;
|
userData.profileImageDimension = meta.config.profileImageDimension;
|
||||||
userData.defaultAvatar = user.getDefaultAvatar();
|
userData.defaultAvatar = user.getDefaultAvatar();
|
||||||
|
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ profileController.get = function (req, res, callback) {
|
|||||||
userData.aboutme = translator.escape(results.aboutme);
|
userData.aboutme = translator.escape(results.aboutme);
|
||||||
userData.breadcrumbs = helpers.buildBreadcrumbs([{ text: userData.username }]);
|
userData.breadcrumbs = helpers.buildBreadcrumbs([{ text: userData.username }]);
|
||||||
userData.title = userData.username;
|
userData.title = userData.username;
|
||||||
userData.allowCoverPicture = !userData.isSelf || userData.reputation >= (meta.config['min:rep:cover-picture'] || 0);
|
userData.allowCoverPicture = !userData.isSelf || !!meta.config['reputation:disabled'] || userData.reputation >= meta.config['min:rep:cover-picture'];
|
||||||
|
|
||||||
if (!userData.profileviews) {
|
if (!userData.profileviews) {
|
||||||
userData.profileviews = 1;
|
userData.profileviews = 1;
|
||||||
|
|||||||
@@ -265,7 +265,7 @@ Flags.validate = function (payload, callback) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check if reporter meets rep threshold (or can edit the target post, in which case threshold does not apply)
|
// Check if reporter meets rep threshold (or can edit the target post, in which case threshold does not apply)
|
||||||
if (!editable.flag && data.reporter.reputation < meta.config['min:rep:flag']) {
|
if (!editable.flag && !meta.config['reputation:disabled'] && data.reporter.reputation < meta.config['min:rep:flag']) {
|
||||||
return callback(new Error('[[error:not-enough-reputation-to-flag]]'));
|
return callback(new Error('[[error:not-enough-reputation-to-flag]]'));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -280,7 +280,7 @@ Flags.validate = function (payload, callback) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check if reporter meets rep threshold (or can edit the target user, in which case threshold does not apply)
|
// Check if reporter meets rep threshold (or can edit the target user, in which case threshold does not apply)
|
||||||
if (!editable && data.reporter.reputation < meta.config['min:rep:flag']) {
|
if (!editable && !meta.config['reputation:disabled'] && data.reporter.reputation < meta.config['min:rep:flag']) {
|
||||||
return callback(new Error('[[error:not-enough-reputation-to-flag]]'));
|
return callback(new Error('[[error:not-enough-reputation-to-flag]]'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user