FEATURE: new hide_user_profiles_from_public site setting

This commit is contained in:
Régis Hanol
2015-10-28 19:56:08 +01:00
parent d9997a6b9e
commit bb79e6aff7
11 changed files with 127 additions and 59 deletions

View File

@@ -379,6 +379,8 @@ class Search
end
def user_search
return if SiteSetting.hide_user_profiles_from_public && !@guardian.user
users = User.includes(:user_search_data)
.where("active = true AND user_search_data.search_data @@ #{ts_query("simple")}")
.order("CASE WHEN username_lower = '#{@original_term.downcase}' THEN 0 ELSE 1 END")