userpage: allow manual disable of pwr through username/email/contact

Checkboxes added to userpage settings allowing enabling/disabling of
specific ways of starting a PWR. For #312.
This commit is contained in:
Harvey Tindall
2023-12-20 18:18:39 +00:00
parent 213b1e7f9e
commit 1a6897637f
7 changed files with 121 additions and 41 deletions
+5
View File
@@ -234,6 +234,11 @@ func (app *appContext) MyUserPage(gc *gin.Context) {
data["discordServerName"] = app.discord.serverName
data["discordInviteLink"] = app.discord.inviteChannelName != ""
}
if data["linkResetEnabled"].(bool) {
data["resetPasswordUsername"] = app.config.Section("user_page").Key("allow_pwr_username").MustBool(true)
data["resetPasswordEmail"] = app.config.Section("user_page").Key("allow_pwr_email").MustBool(true)
data["resetPasswordContactMethod"] = app.config.Section("user_page").Key("allow_pwr_contact_method").MustBool(true)
}
pageMessagesExist := map[string]bool{}
pageMessages := map[string]CustomContent{}