27 lines
549 B
Go
27 lines
549 B
Go
package routes
|
|
|
|
import (
|
|
"net/http"
|
|
paas "proxmoxaas-common-lib"
|
|
"proxmoxaas-dashboard/app/common"
|
|
)
|
|
|
|
func HandleGETSettings(w http.ResponseWriter, r *http.Request) {
|
|
auth, err := common.GetAuthFromRequest(r)
|
|
if err == nil {
|
|
_, err := GetUserBasic(auth)
|
|
if err != nil {
|
|
common.HandleNonFatalError(w, err)
|
|
return
|
|
}
|
|
|
|
paas.HTTPExecuteHTMLTemplate(w, common.TMPL, "html/settings.html", map[string]any{
|
|
"global": common.Global,
|
|
"page": "settings",
|
|
})
|
|
} else {
|
|
http.Redirect(w, r, "/login", http.StatusFound)
|
|
return
|
|
}
|
|
}
|