From aff7efd726cfedd66f1d60a7104657d5154e1d3c Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Mon, 12 Feb 2024 19:52:19 +0100 Subject: [PATCH] Improve inspect page --- login.go | 3 +++ pim_http.go | 12 +++++++++++- templates/pim_inspect.html | 19 ++++++++++++++++++- 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/login.go b/login.go index 62a72c1..686b07b 100644 --- a/login.go +++ b/login.go @@ -225,6 +225,9 @@ func (lu *LoggedUser) WelcomeName() string { } return ret } +func (lu *LoggedUser) Email() string { + return lu.Entry.GetAttributeValue("mail") +} func (lu *LoggedUser) S3KeyInfo() (*garage.KeyInfo, error) { var err error var keyPair *garage.KeyInfo diff --git a/pim_http.go b/pim_http.go index e04c702..93c6ad6 100644 --- a/pim_http.go +++ b/pim_http.go @@ -6,6 +6,11 @@ import ( "net/http" ) +type PimInspectView struct { + User *LoggedUser + Debug string +} + func handlePimInspect(w http.ResponseWriter, r *http.Request) { user := RequireUserHtml(w, r) if user == nil { @@ -24,8 +29,13 @@ func handlePimInspect(w http.ResponseWriter, r *http.Request) { return } + view := PimInspectView { + User: user, + Debug: string(pim_json), + } + tKey := getTemplate("pim_inspect.html") - tKey.Execute(w, string(pim_json)) + tKey.Execute(w, view) } func handlePimSetup(w http.ResponseWriter, r *http.Request) { diff --git a/templates/pim_inspect.html b/templates/pim_inspect.html index 7d86f9b..e4508b8 100644 --- a/templates/pim_inspect.html +++ b/templates/pim_inspect.html @@ -10,7 +10,24 @@
PAGE DE DEBUG, NON CONFORME POUR UNE MISE EN PRODUCTION
-
{{ . }}
+ +
+--- login info ---
+email: {{ .User.Email }}
+username: {{ .User.Login.Info.Username }}
+password: ********
+
+--- autodiscovery ---
+Implemented: RFC6186 DNS SRV autodiscovery + Thunderbird Autoconfig
+Not implemented: Microsoft Autodiscover + Apple Mobileconfig
+
+--- manual configuration ---
+IMAP: imap.saint-ex.deuxfleurs.org:993 (TLS)
+SMTP: smtp.saint-ex.deuxfleurs.org:465 (TLS)
+
+--- dump PIM controller ---
+{{ .Debug }}
+
{{end}}