Member Search: Usually apply certified-only filter

Always filter for certified members unless the user specifically
searches for non-certified or "all users".

Admin searches for banned/disabled also search all users.
This commit is contained in:
Noah Petherbridge 2024-06-19 15:03:58 -07:00
parent 02ec0a9116
commit 88663d48a4

View File

@ -82,6 +82,13 @@ func Search() http.HandlerFunc {
isCertified = "true" isCertified = "true"
} }
// Always filter for certified-only users unless the request specifically looked for non-certified.
// Searches for disabled/banned users (admin only) should also reveal ALL users including non-certified.
var certifiedOnly = true
if isCertified == "false" || isCertified == "all" || isCertified == "disabled" || isCertified == "banned" {
certifiedOnly = false
}
pager := &models.Pagination{ pager := &models.Pagination{
PerPage: config.PageSizeMemberSearch, PerPage: config.PageSizeMemberSearch,
Sort: sort, Sort: sort,
@ -95,7 +102,7 @@ func Search() http.HandlerFunc {
MaritalStatus: maritalStatus, MaritalStatus: maritalStatus,
HereFor: hereFor, HereFor: hereFor,
ProfileText: search, ProfileText: search,
Certified: isCertified == "true", Certified: certifiedOnly,
NotCertified: isCertified == "false", NotCertified: isCertified == "false",
InnerCircle: isCertified == "circle", InnerCircle: isCertified == "circle",
ShyAccounts: isCertified == "shy", ShyAccounts: isCertified == "shy",