GroupVerify: Verification page, overrides and public Verified tags
Shown only where GroupVerify is: staff get the Verification page once its gv_* tables are in the database, and the public site shows "Verified" only while it's on (enabled, with a group) and not missing from css_plugins list, which the poller reads once a minute over RCON. - Verification page: plugin state and version, Steam group, saved member list, overrides. - Overrides (@zio/verify, not on yourself unless Root): give, change, remove; player drawer shows why a player is or isn't verified. - Root sets the group and turns it on/off: saved to gv_settings, and sent as css_gv_* when the plugin is loaded so it applies at once. - gv_* times use GroupVerify's own timezone setting. - MySQL integration test (SAW_TEST_DSN), unit tests for plugin list parsing and the show rule.
This commit is contained in:
parent
b2b4698776
commit
9e4bc63201
15 changed files with 1270 additions and 13 deletions
|
|
@ -181,7 +181,9 @@ type meView struct {
|
|||
Rank *rankView `json:"rank,omitempty"`
|
||||
Perms []string `json:"perms,omitempty"`
|
||||
Immunity int `json:"immunity,omitempty"`
|
||||
Site string `json:"site"`
|
||||
// Verify is true when GroupVerify's tables are in the database, for the Verification page.
|
||||
Verify bool `json:"verify,omitempty"`
|
||||
Site string `json:"site"`
|
||||
}
|
||||
|
||||
func (s *Server) me(w http.ResponseWriter, r *http.Request) {
|
||||
|
|
@ -197,6 +199,10 @@ func (s *Server) me(w http.ResponseWriter, r *http.Request) {
|
|||
if id != nil {
|
||||
v.Staff, v.Name, v.Rank, v.Immunity = true, id.Name, s.rankOf(x, id.SteamID), id.Immunity
|
||||
v.Perms = id.Flags
|
||||
// Never fails the page: without the tables, or on an error, there's just no Verification page.
|
||||
if info, err := s.verifyInfo(r.Context()); err == nil {
|
||||
v.Verify = info.Tables
|
||||
}
|
||||
}
|
||||
writeJSON(w, http.StatusOK, v)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue