From 33df3c38685d4419a9cba468663264dc3ca74069 Mon Sep 17 00:00:00 2001 From: Jordan Wright Date: Sat, 6 Aug 2016 18:58:34 -0500 Subject: [PATCH] Added the version to the settings page. --- config/config.go | 3 +++ controllers/route.go | 4 +++- templates/settings.html | 7 +++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/config/config.go b/config/config.go index d4062050..b64fad32 100644 --- a/config/config.go +++ b/config/config.go @@ -41,6 +41,9 @@ type Config struct { // Conf contains the initialized configuration struct var Conf Config +// Version contains the current gophish version +var Version = "0.2alpha" + func init() { // Get the config file config_file, err := ioutil.ReadFile("./config.json") diff --git a/controllers/route.go b/controllers/route.go index 6a6fc6d6..77efae10 100644 --- a/controllers/route.go +++ b/controllers/route.go @@ -13,6 +13,7 @@ import ( "strings" "github.com/gophish/gophish/auth" + "github.com/gophish/gophish/config" mid "github.com/gophish/gophish/middleware" "github.com/gophish/gophish/models" ctx "github.com/gorilla/context" @@ -371,7 +372,8 @@ func Settings(w http.ResponseWriter, r *http.Request) { Title string Flashes []interface{} Token string - }{Title: "Settings", User: ctx.Get(r, "user").(models.User), Token: nosurf.Token(r)} + Version string + }{Title: "Settings", Version: config.Version, User: ctx.Get(r, "user").(models.User), Token: nosurf.Token(r)} getTemplate(w, "settings").ExecuteTemplate(w, "base", params) case r.Method == "POST": err := auth.ChangePassword(r) diff --git a/templates/settings.html b/templates/settings.html index 761ad163..6bfa2a51 100644 --- a/templates/settings.html +++ b/templates/settings.html @@ -31,6 +31,13 @@

Settings

+
+ +
+ +
+
+