diff --git a/cmd/server/config/config.go b/cmd/server/config/config.go index 0046e7f..d38cbfb 100644 --- a/cmd/server/config/config.go +++ b/cmd/server/config/config.go @@ -7,8 +7,9 @@ import ( ) type Config struct { - HTTP HTTPConfig - LDAP LDAPConfig + HTTP HTTPConfig + LDAP LDAPConfig + Contact ContactConfig } type HTTPConfig struct { @@ -23,6 +24,11 @@ type LDAPConfig struct { UserSearchFilterPattern string } +type ContactConfig struct { + Email string + Subject string +} + // NewFromFile retrieves the configuration from the given file func NewFromFile(filepath string) (*Config, error) { config := NewDefault() @@ -48,6 +54,10 @@ func NewDefault() *Config { BaseDN: "o=org,c=fr", UserSearchFilterPattern: "(&(objectClass=person)(uid=%s))", }, + Contact: ContactConfig{ + Email: "contact@cadoles-profile.local", + Subject: "[Cadoles Profile] Help needed", + }, } } diff --git a/cmd/server/route.go b/cmd/server/route.go index 49c99fc..b8ce81d 100644 --- a/cmd/server/route.go +++ b/cmd/server/route.go @@ -196,10 +196,12 @@ func serveProfilePage(w http.ResponseWriter, r *http.Request) { } tmpl := template.Must(ctn) + config := config.Must(ctn) data := extendTemplateData(w, r, template.Data{ "EntryAttributes": results.Entries[0].Attributes, csrf.TemplateTag: csrf.TemplateField(r), + "Contact": config.Contact, }) if err := tmpl.RenderPage(w, "profile.html.tmpl", data); err != nil { diff --git a/cmd/server/templates/layouts/profile.html.tmpl b/cmd/server/templates/layouts/profile.html.tmpl index e84c209..ccbdcfc 100644 --- a/cmd/server/templates/layouts/profile.html.tmpl +++ b/cmd/server/templates/layouts/profile.html.tmpl @@ -49,6 +49,9 @@ +

+ Une question, un problème ? Contacter le support +