Search users by admin, privacy policy update

This commit is contained in:
Noah Petherbridge 2024-04-25 21:52:43 -07:00
parent ff2eb285eb
commit 106ca56198
4 changed files with 64 additions and 32 deletions

View File

@ -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,

View File

@ -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)

View File

@ -33,16 +33,7 @@
<div class="notification is-success is-light">
Currently searching within your <i class="fa fa-user-group"></i> Friends list.
</div>
{{else if not (eq .Sort "distance")}}
<div class="notification is-success is-light">
<strong>New feature:</strong> you can now see <strong>Who's Nearby!</strong>
{{if not .MyLocation.Source}}
You will need to <a href="/settings#location">set your location</a> first.
{{else}}
<a href="{{.Request.URL.Path}}?sort=distance">See who's nearby now!</a>
{{end}}
</div>
{{else}}
{{else if eq .Sort "distance"}}
<div class="notification is-success is-light content">
<p>
Showing you <i class="fa fa-location-dot mr-1"></i> <strong>Who's Nearby.</strong>
@ -64,6 +55,18 @@
{{end}}
</p>
</div>
{{else if eq .Certified "shy"}}
<div class="notification is-success is-light content">
<p>
Showing you <i class="fa fa-ghost"></i> <strong>Shy Accounts</strong>. 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.'
</p>
<p>
Shy Accounts are limited in the way they can interact with our non-shy members.
<a href="/faq#shy-faqs" target="_blank">Learn more <i class="fa fa-external-link"></i></a>
</p>
</div>
{{end}}
<div class="block">
@ -87,16 +90,24 @@
<label class="label">Status:</label>
<div class="select is-fullwidth">
<select id="certified" name="certified">
<optgroup label="Certification Status">
<option value="true">Only certified users</option>
<option value="false"{{if eq $Root.Certified "false"}} selected{{end}}>Non-certified only</option>
</optgroup>
<optgroup label="Profile Status">
<option value="shy"{{if eq $Root.Certified "shy"}} selected{{end}}>Shy Accounts</option>
{{if .CurrentUser.IsInnerCircle}}
<option value="circle"{{if eq $Root.Certified "circle"}} selected{{end}}>Inner circle only</option>
{{end}}
<option value="shy"{{if eq $Root.Certified "shy"}} selected{{end}}>Shy Accounts</option>
<option value="false"{{if eq $Root.Certified "false"}} selected{{end}}>Non-certified only</option>
<option value="all"{{if eq $Root.Certified "all"}} selected{{end}}>Show all users</option>
<option value="admin"{{if eq $Root.Certified "admin"}} selected{{end}}>Website administrators</option>
</optgroup>
{{if .CurrentUser.IsAdmin}}
<option value="banned"{{if eq $Root.Certified "banned"}} selected{{end}}>Banned or disabled</option>
<optgroup label="Admin Options">
<option value="banned"{{if eq $Root.Certified "banned"}} selected{{end}}>☮ Banned</option>
<option value="disabled"{{if eq $Root.Certified "disabled"}} selected{{end}}>☮ Disabled</option>
</optgroup>
{{end}}
<option value="all"{{if eq $Root.Certified "all"}} selected{{end}}>Show all users</option>
</select>
</div>
</div>

View File

@ -576,17 +576,22 @@
<strong>IP Address</strong>
<ul>
<li>
<strong>How we collect it:</strong>
Your IP address may appear as part of standard web server logs as you access and browse the
website - for example in HTTP access logs captured by our <a href="https://nginx.org">NGINX</a>
reverse proxy server. Your IP address in these logs is <strong>NOT</strong> associated with your
user account.
reverse proxy server. These logs are NOT associated with any specific user account, and
rotate on a regular basis.
</li>
<li>
<strong>How we store it:</strong>
Your IP address is logged during certain crucial account lifecycle events, such as when your
account is created and when you upload your certification photo, for the purpose of abuse and
fraud prevention.
Your IP address is logged to your account during certain crucial account lifecycle events, such
as when your account is first created and when you upload your certification photo, for the
purpose of detecting abuse and fraud prevention.
</li>
<li>
While logged in to your account, a list of the distinct IP addresses you have logged in from is
recorded (date/time of first and last visit, count of visits). This is expressly for record keeping
purposes in case it can assist with law enforcement, and is not displayed on the website (even to
admin users).
<span class="tag is-success">As of: Apr 25 2024</span>
</li>
</ul>
</li>