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