diff --git a/main.go b/main.go index 85badf9..79aa464 100644 --- a/main.go +++ b/main.go @@ -225,6 +225,19 @@ func adminHandler(w http.ResponseWriter, r *http.Request) { } } +func settingsHandler(w http.ResponseWriter, r *http.Request) { + user := r.Header.Get("Remote-User") + groups := r.Header.Get("Remote-Groups") + isAdmin := strings.Contains(groups, "admins") + + tmpl := template.Must(template.New("settings").Parse(settingsHTML)) + w.Header().Set("Content-Type", "text/html; charset=utf-8") + tmpl.Execute(w, map[string]interface{}{ + "User": user, + "IsAdmin": isAdmin, + }) +} + // --- Templates --- const landingPageHTML = ` @@ -316,9 +329,9 @@ const launcherHTML = `
{{.Description}}
-