diff --git a/pkg/controller/account/search.go b/pkg/controller/account/search.go index bc02758..d5f65db 100644 --- a/pkg/controller/account/search.go +++ b/pkg/controller/account/search.go @@ -96,6 +96,8 @@ func Search() http.HandlerFunc { InnerCircle: isCertified == "circle", ShyAccounts: isCertified == "shy", IsBanned: isCertified == "banned", + IsDisabled: isCertified == "disabled", + IsAdmin: isCertified == "admin", Friends: friendSearch, AgeMin: ageMin, AgeMax: ageMax, diff --git a/pkg/models/user.go b/pkg/models/user.go index 4273aec..4491eae 100644 --- a/pkg/models/user.go +++ b/pkg/models/user.go @@ -263,6 +263,8 @@ type UserSearch struct { InnerCircle bool ShyAccounts bool IsBanned bool + IsDisabled bool + IsAdmin bool // search for admin users Friends bool AgeMin int AgeMax int @@ -362,14 +364,22 @@ func SearchUsers(user *User, search *UserSearch, pager *Pagination) ([]*User, er placeholders = append(placeholders, "here_for", "%"+search.HereFor+"%") } - // All user searches will show active accounts only, unless we are admin. - if user.IsAdmin && search.IsBanned { + // Only admin user can show disabled/banned users. + var statuses = []string{} + if user.IsAdmin { + if search.IsBanned { + statuses = append(statuses, UserStatusBanned) + } + if search.IsDisabled { + statuses = append(statuses, UserStatusDisabled) + } + } + + // Non-admin user only ever sees active accounts. + if user.IsAdmin && len(statuses) > 0 { wheres = append(wheres, "status IN ?") - placeholders = append(placeholders, []string{ - UserStatusBanned, - UserStatusDisabled, - }) - } else if !user.IsAdmin { + placeholders = append(placeholders, statuses) + } else { wheres = append(wheres, "status = ?") placeholders = append(placeholders, UserStatusActive) } @@ -386,6 +396,10 @@ func SearchUsers(user *User, search *UserSearch, pager *Pagination) ([]*User, er placeholders = append(placeholders, false) } + if search.IsAdmin { + wheres = append(wheres, "is_admin = true") + } + if search.InnerCircle { wheres = append(wheres, "inner_circle = ? OR is_admin = ?") placeholders = append(placeholders, true, true) diff --git a/web/templates/account/search.html b/web/templates/account/search.html index 0573c3e..245409f 100644 --- a/web/templates/account/search.html +++ b/web/templates/account/search.html @@ -33,16 +33,7 @@
Currently searching within your Friends list.
- {{else if not (eq .Sort "distance")}} -
- New feature: you can now see Who's Nearby! - {{if not .MyLocation.Source}} - You will need to set your location first. - {{else}} - See who's nearby now! - {{end}} -
- {{else}} + {{else if eq .Sort "distance"}}

Showing you Who's Nearby. @@ -64,6 +55,18 @@ {{end}}

+ {{else if eq .Certified "shy"}} +
+

+ Showing you Shy Accounts. These profiles may be marked as private or + have no photo available to you, as all of theirs are set to 'friends-only' or 'private.' +

+ +

+ Shy Accounts are limited in the way they can interact with our non-shy members. + Learn more +

+
{{end}}
@@ -87,16 +90,24 @@
diff --git a/web/templates/privacy.html b/web/templates/privacy.html index 9862b7f..e155b32 100644 --- a/web/templates/privacy.html +++ b/web/templates/privacy.html @@ -576,17 +576,22 @@ IP Address