mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 11:35:55 +01:00
closes #2927
This commit is contained in:
@@ -41,10 +41,7 @@
|
||||
"enabled": true,
|
||||
"iconClass": "fa-user",
|
||||
"textClass": "visible-xs-inline",
|
||||
"text": "\\[\\[global:header.users\\]\\]",
|
||||
"properties": {
|
||||
"loggedIn": true
|
||||
}
|
||||
"text": "\\[\\[global:header.users\\]\\]"
|
||||
},
|
||||
{
|
||||
"route": "/groups",
|
||||
|
||||
@@ -21,10 +21,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
if (item.route.match('/users')) {
|
||||
if (data.privateUserInfo && !data.isAdmin) {
|
||||
if (item.route.match('/users') && data.privateUserInfo && !data.loggedIn) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (item.route.match('/tags') && data.privateTagListing && !data.loggedIn) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -48,6 +48,7 @@ apiController.getConfig = function(req, res, next) {
|
||||
config.allowTopicsThumbnail = parseInt(meta.config.allowTopicsThumbnail, 10) === 1;
|
||||
config.allowAccountDelete = parseInt(meta.config.allowAccountDelete, 10) === 1;
|
||||
config.privateUserInfo = parseInt(meta.config.privateUserInfo, 10) === 1;
|
||||
config.privateTagListing = parseInt(meta.config.privateTagListing, 10) === 1;
|
||||
config.usePagination = parseInt(meta.config.usePagination, 10) === 1;
|
||||
config.disableSocialButtons = parseInt(meta.config.disableSocialButtons, 10) === 1;
|
||||
config.disableChat = parseInt(meta.config.disableChat, 10) === 1;
|
||||
|
||||
@@ -487,11 +487,11 @@ middleware.maintenanceMode = function(req, res, next) {
|
||||
});
|
||||
};
|
||||
|
||||
middleware.publicTagListing = function(req, res, next) {
|
||||
if (req.user || parseInt(meta.config.publicTagListing, 10) === 1) {
|
||||
next();
|
||||
} else {
|
||||
middleware.privateTagListing = function(req, res, next) {
|
||||
if (!req.user && parseInt(meta.config.privateTagListing, 10) === 1) {
|
||||
controllers.helpers.notAllowed(req, res);
|
||||
} else {
|
||||
next();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -46,8 +46,8 @@ function topicRoutes(app, middleware, controllers) {
|
||||
}
|
||||
|
||||
function tagRoutes(app, middleware, controllers) {
|
||||
setupPageRoute(app, '/tags/:tag', middleware, [middleware.publicTagListing], controllers.tags.getTag);
|
||||
setupPageRoute(app, '/tags', middleware, [middleware.publicTagListing], controllers.tags.getTags);
|
||||
setupPageRoute(app, '/tags/:tag', middleware, [middleware.privateTagListing], controllers.tags.getTag);
|
||||
setupPageRoute(app, '/tags', middleware, [middleware.privateTagListing], controllers.tags.getTags);
|
||||
}
|
||||
|
||||
function categoryRoutes(app, middleware, controllers) {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<form>
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" data-field="publicTagListing"> Make the tags list publically viewable
|
||||
<input type="checkbox" data-field="privateTagListing"> Make the tags list private
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
||||
Reference in New Issue
Block a user