Added the version to the settings page.

pull/260/head
Jordan Wright 2016-08-06 18:58:34 -05:00
parent 576aa469e9
commit 33df3c3868
3 changed files with 13 additions and 1 deletions

View File

@ -41,6 +41,9 @@ type Config struct {
// Conf contains the initialized configuration struct // Conf contains the initialized configuration struct
var Conf Config var Conf Config
// Version contains the current gophish version
var Version = "0.2alpha"
func init() { func init() {
// Get the config file // Get the config file
config_file, err := ioutil.ReadFile("./config.json") config_file, err := ioutil.ReadFile("./config.json")

View File

@ -13,6 +13,7 @@ import (
"strings" "strings"
"github.com/gophish/gophish/auth" "github.com/gophish/gophish/auth"
"github.com/gophish/gophish/config"
mid "github.com/gophish/gophish/middleware" mid "github.com/gophish/gophish/middleware"
"github.com/gophish/gophish/models" "github.com/gophish/gophish/models"
ctx "github.com/gorilla/context" ctx "github.com/gorilla/context"
@ -371,7 +372,8 @@ func Settings(w http.ResponseWriter, r *http.Request) {
Title string Title string
Flashes []interface{} Flashes []interface{}
Token string 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) getTemplate(w, "settings").ExecuteTemplate(w, "base", params)
case r.Method == "POST": case r.Method == "POST":
err := auth.ChangePassword(r) err := auth.ChangePassword(r)

View File

@ -31,6 +31,13 @@
<h1 class="page-header">Settings</h1> <h1 class="page-header">Settings</h1>
</div> </div>
<div id="flashes" class="row"></div> <div id="flashes" class="row"></div>
<div class="row">
<label class="col-sm-2 control-label form-label">Gophish version</label>
<div class="col-md-6">
<label class="form-label">{{.Version}}</label>
</div>
</div>
<br/>
<div class="row"> <div class="row">
<label class="col-sm-2 control-label form-label">Register a New User</label> <label class="col-sm-2 control-label form-label">Register a New User</label>
<div class="col-md-6"> <div class="col-md-6">