Admin: auto enable contact when an email is added
"Contact through email" is now automatically enabled when adding an email address to an account without one on the admin page. Solves #233.
This commit is contained in:
+8
-1
@@ -1023,9 +1023,16 @@ func (app *appContext) ModifyEmails(gc *gin.Context) {
|
||||
id := jfUser.ID
|
||||
if address, ok := req[id]; ok {
|
||||
var emailStore = EmailAddress{}
|
||||
if oldEmail, ok := app.storage.emails[id]; ok {
|
||||
oldEmail, ok := app.storage.emails[id]
|
||||
if ok {
|
||||
emailStore = oldEmail
|
||||
}
|
||||
// Auto enable contact by email for newly added addresses
|
||||
if !ok || oldEmail.Addr == "" {
|
||||
emailStore.Contact = true
|
||||
app.storage.storeEmails()
|
||||
}
|
||||
|
||||
emailStore.Addr = address
|
||||
app.storage.emails[id] = emailStore
|
||||
if ombiEnabled {
|
||||
|
||||
Reference in New Issue
Block a user