From e9aa8d2c88faf123eb49896e9ad7e697b0294f5e Mon Sep 17 00:00:00 2001 From: Jordan Date: Thu, 30 Jan 2014 15:15:12 -0600 Subject: [PATCH] Updated settings template and route to show basic user info --- controllers/route.go | 7 +++++-- templates/settings.html | 9 ++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/controllers/route.go b/controllers/route.go index 1937da87..b1752efe 100644 --- a/controllers/route.go +++ b/controllers/route.go @@ -84,7 +84,6 @@ func Base(w http.ResponseWriter, r *http.Request) { Title string Flashes []interface{} }{Title: "Dashboard", User: ctx.Get(r, "user").(models.User)} - fmt.Println(params.User.Username) getTemplate(w, "dashboard").ExecuteTemplate(w, "base", params) } @@ -93,7 +92,11 @@ func Users(w http.ResponseWriter, r *http.Request) { } func Settings(w http.ResponseWriter, r *http.Request) { - getTemplate(w, "settings").ExecuteTemplate(w, "base", nil) + params := struct { + User models.User + Title string + }{Title: "Settings", User: ctx.Get(r, "user").(models.User)} + getTemplate(w, "settings").ExecuteTemplate(w, "base", params) } func Campaigns(w http.ResponseWriter, r *http.Request) { diff --git a/templates/settings.html b/templates/settings.html index 9e0da64f..17995579 100644 --- a/templates/settings.html +++ b/templates/settings.html @@ -1,4 +1,4 @@ -{{define "content"}} {{template "nav"}} +{{define "content"}} {{template "nav" .User}}

@@ -20,10 +20,9 @@

-

Gophish API

-

Gophish runs on top of a RESTful API which allows developers to automate phishing campaigns easily. The following documentation and examples demonstrate the API functionality

-

/api/campaigns

-

Test.

+

User Settings

+

Username: {{.User.Username}}

+

Api Key: {{.User.APIKey}}

{{end}}