v1.18.x
barisusakli 10 years ago
parent ed173e0a32
commit 0ef2ccc130

@ -109,6 +109,10 @@
return (topic.index || 0) + 1;
};
helpers.displayUserSearch = function(data, allowGuestUserSearching) {
return data.loggedIn || allowGuestUserSearching === 'true';
};
// Groups helpers
helpers.membershipBtn = function(groupObj) {
if (groupObj.isMember) {

@ -42,6 +42,7 @@ apiController.getConfig = function(req, res, next) {
config.maximumAboutMeLength = meta.config.maximumAboutMeLength || 1000;
config.useOutgoingLinksPage = parseInt(meta.config.useOutgoingLinksPage, 10) === 1;
config.allowGuestSearching = parseInt(meta.config.allowGuestSearching, 10) === 1;
config.allowGuestUserSearching = parseInt(meta.config.allowGuestUserSearching, 10) === 1;
config.allowGuestHandles = parseInt(meta.config.allowGuestHandles, 10) === 1;
config.allowFileUploads = parseInt(meta.config.allowFileUploads, 10) === 1;
config.allowProfileImageUploads = parseInt(meta.config.allowProfileImageUploads) === 1;

@ -97,7 +97,7 @@ usersController.getUsersAndCount = function(set, uid, start, stop, callback) {
};
usersController.getUsersForSearch = function(req, res, next) {
if (!req.uid) {
if (!req.uid && parseInt(meta.config.allowGuestUserSearching, 10) !== 1) {
return helpers.notAllowed(req, res);
}
var resultsPerPage = parseInt(meta.config.userSearchResultsPerPage, 10) || 20;

@ -69,7 +69,7 @@ SocketUser.search = function(socket, data, callback) {
if (!data) {
return callback(new Error('[[error:invalid-data]]'));
}
if (!socket.uid) {
if (!socket.uid && parseInt(meta.config.allowGuestUserSearching, 10) !== 1) {
return callback(new Error('[[error:not-logged-in]]'));
}
user.search({

@ -54,11 +54,6 @@
<div class="panel-heading">Miscellaneous</div>
<div class="panel-body">
<form>
<div class="checkbox">
<label>
<input type="checkbox" data-field="allowGuestSearching"> <strong>Allow guests to search without logging in</strong>
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" data-field="useOutgoingLinksPage"> <strong>Use Outgoing Links Warning Page</strong>

@ -18,7 +18,21 @@
</p>
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" data-field="allowGuestSearching"> <strong>Allow guests to search without logging in</strong>
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" data-field="allowGuestUserSearching"> <strong>Allow guests to search users logging in</strong>
</label>
</div>
</form>
</div>
</div>

Loading…
Cancel
Save