aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--login.go3
-rw-r--r--pim_http.go12
-rw-r--r--templates/pim_inspect.html19
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 @@
<div class="col-md-12 mt-3">
<div class="alert alert-danger">PAGE DE DEBUG, NON CONFORME POUR UNE MISE EN PRODUCTION</div>
</div>
- <pre>{{ . }}</pre>
+
+<pre>
+--- 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 }}
+</pre>
</div>
{{end}}