[BUGFIX] [host] edit web and mail
This commit is contained in:
parent
b69c90d6c6
commit
d8be895eb0
|
@ -5,7 +5,7 @@ import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
log "github.com/Sirupsen/logrus" // TODO-Bad
|
log "github.com/sirupsen/logrus" // TODO-Bad
|
||||||
|
|
||||||
libsession "dev.sum7.eu/sum7/warehost/lib/session"
|
libsession "dev.sum7.eu/sum7/warehost/lib/session"
|
||||||
)
|
)
|
||||||
|
|
|
@ -3,7 +3,7 @@ package log
|
||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
log "github.com/Sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
"github.com/rifflock/lfshook"
|
"github.com/rifflock/lfshook"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -121,6 +121,7 @@ func mailEdit(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
mail.Name = mailRequest.Name
|
mail.Name = mailRequest.Name
|
||||||
mail.LoginID = mailRequest.LoginID
|
mail.LoginID = mailRequest.LoginID
|
||||||
|
mail.Domain = nil
|
||||||
|
|
||||||
idsStay := map[int64]struct{}{}
|
idsStay := map[int64]struct{}{}
|
||||||
idsStay[0] = 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"})
|
libapi.JSONWrite(w, r, false, &libapi.ErrorResult{Message: "Internal Database Error with Database"})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := dbconnection.Save(mail).Error; err != nil {
|
if err := dbconnection.Save(mail).Error; err != nil {
|
||||||
logger.Error("database: during modify host mail: ", err)
|
logger.Error("database: during modify host mail: ", err)
|
||||||
w.WriteHeader(http.StatusInternalServerError)
|
w.WriteHeader(http.StatusInternalServerError)
|
||||||
|
|
|
@ -143,6 +143,7 @@ func webEdit(w http.ResponseWriter, r *http.Request) {
|
||||||
web.SSLRedirect = webRequest.SSLRedirect
|
web.SSLRedirect = webRequest.SSLRedirect
|
||||||
web.Redirect = webRequest.Redirect
|
web.Redirect = webRequest.Redirect
|
||||||
web.Proxy = webRequest.Proxy
|
web.Proxy = webRequest.Proxy
|
||||||
|
web.Domain = nil
|
||||||
|
|
||||||
idsOld := map[int64]struct{}{}
|
idsOld := map[int64]struct{}{}
|
||||||
for _, item := range web.HTTPAccess {
|
for _, item := range web.HTTPAccess {
|
||||||
|
|
|
@ -3,7 +3,7 @@ package host
|
||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/Sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
|
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
|
|
Reference in New Issue