Skip to content

Commit

Permalink
Grab some more public facing lists for lockdown
Browse files Browse the repository at this point in the history
* Fix UI display missing libraries.

Post OpenUserJS#2048

NOTE: Thank you for whoever you are pointing this out in a very subtle manner.
  • Loading branch information
Martii committed Feb 25, 2025
1 parent 28f624b commit 87b8cb3
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions controllers/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,14 @@ exports.userCommentListPage = function (aReq, aRes, aNext) {
modelQuery.applyCommentListQueryDefaults(commentListQuery, options, aReq);
commentListQuery.sort('-created');

if (options.authToSearch) {
statusCodePage(aReq, aRes, aNext, {
statusCode: 403, // Forbidden
statusMessage: 'Please Sign In to Search'
});
return;
}

// commentListQuery: Pagination
pagination = options.pagination; // is set in modelQuery.apply___ListQueryDefaults

Expand All @@ -711,7 +719,7 @@ exports.userCommentListPage = function (aReq, aRes, aNext) {
});

// SearchBar
options.searchBarPlaceholder = 'Search Comments from ' + user.name;
options.searchBarPlaceholder = options.authRequired + 'Search Comments from ' + user.name;
options.searchBarFormAction = '';

//--- Tasks
Expand Down Expand Up @@ -885,12 +893,20 @@ exports.userScriptListPage = function (aReq, aRes, aNext) {
modelQuery.applyScriptListQueryDefaults(scriptListQuery, options, aReq);
}

if (options.authToSearch) {
statusCodePage(aReq, aRes, aNext, {
statusCode: 403, // Forbidden
statusMessage: 'Please Sign In to Search'
});
return;
}

// scriptListQuery: Pagination
pagination = options.pagination; // is set in modelQuery.apply___ListQueryDefaults

// SearchBar
options.searchBarPlaceholder = 'Search ' +
(options.librariesOnly ? 'Libraries' : 'Scripts') + ' from ' + user.name;
options.searchBarPlaceholder = options.authRequired + 'Search ' +
(librariesOnly ? 'Libraries' : 'Scripts') + ' from ' + user.name;
options.searchBarFormAction = '';

//--- Tasks
Expand Down

0 comments on commit 87b8cb3

Please sign in to comment.