From d8be895eb08127d2217f82d526e943b7f7b36a8b Mon Sep 17 00:00:00 2001 From: Martin Geno Date: Wed, 4 Oct 2017 12:32:07 +0200 Subject: [PATCH] [BUGFIX] [host] edit web and mail --- lib/api/main.go | 2 +- lib/log/main.go | 2 +- modul/host/apimail.go | 2 ++ modul/host/apiweb.go | 1 + modul/host/lib.go | 2 +- 5 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/api/main.go b/lib/api/main.go index d093c8a..3b72e26 100644 --- a/lib/api/main.go +++ b/lib/api/main.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - log "github.com/Sirupsen/logrus" // TODO-Bad + log "github.com/sirupsen/logrus" // TODO-Bad libsession "dev.sum7.eu/sum7/warehost/lib/session" ) diff --git a/lib/log/main.go b/lib/log/main.go index 7fd9986..061a8a9 100644 --- a/lib/log/main.go +++ b/lib/log/main.go @@ -3,7 +3,7 @@ package log import ( "net/http" - log "github.com/Sirupsen/logrus" + log "github.com/sirupsen/logrus" "github.com/rifflock/lfshook" ) diff --git a/modul/host/apimail.go b/modul/host/apimail.go index 32ebe24..9290f12 100644 --- a/modul/host/apimail.go +++ b/modul/host/apimail.go @@ -121,6 +121,7 @@ func mailEdit(w http.ResponseWriter, r *http.Request) { mail.Name = mailRequest.Name mail.LoginID = mailRequest.LoginID + mail.Domain = nil idsStay := map[int64]struct{}{} idsStay[0] = struct{}{} @@ -146,6 +147,7 @@ func mailEdit(w http.ResponseWriter, r *http.Request) { libapi.JSONWrite(w, r, false, &libapi.ErrorResult{Message: "Internal Database Error with Database"}) return } + if err := dbconnection.Save(mail).Error; err != nil { logger.Error("database: during modify host mail: ", err) w.WriteHeader(http.StatusInternalServerError) diff --git a/modul/host/apiweb.go b/modul/host/apiweb.go index 2fbc4f8..ab45d4a 100644 --- a/modul/host/apiweb.go +++ b/modul/host/apiweb.go @@ -143,6 +143,7 @@ func webEdit(w http.ResponseWriter, r *http.Request) { web.SSLRedirect = webRequest.SSLRedirect web.Redirect = webRequest.Redirect web.Proxy = webRequest.Proxy + web.Domain = nil idsOld := map[int64]struct{}{} for _, item := range web.HTTPAccess { diff --git a/modul/host/lib.go b/modul/host/lib.go index f7204e8..0798503 100644 --- a/modul/host/lib.go +++ b/modul/host/lib.go @@ -3,7 +3,7 @@ package host import ( "net/http" - "github.com/Sirupsen/logrus" + "github.com/sirupsen/logrus" "context"