2014-01-09 06:42:05 +00:00
|
|
|
package models
|
2013-12-12 06:27:43 +00:00
|
|
|
|
2014-01-13 03:36:26 +00:00
|
|
|
import (
|
|
|
|
"net/mail"
|
|
|
|
|
|
|
|
// SMTPServer is used to provide a default SMTP server preference.
|
|
|
|
"time"
|
|
|
|
|
|
|
|
"github.com/jordan-wright/email"
|
|
|
|
)
|
|
|
|
|
2013-12-12 06:27:43 +00:00
|
|
|
type SMTPServer struct {
|
|
|
|
Host string `json:"host"`
|
|
|
|
User string `json:"user"`
|
|
|
|
Password string `json:"password"`
|
|
|
|
}
|
|
|
|
|
2014-01-10 03:21:54 +00:00
|
|
|
// Config represents the configuration information.
|
2013-12-12 06:27:43 +00:00
|
|
|
type Config struct {
|
2014-01-06 06:09:41 +00:00
|
|
|
URL string `json:"url"`
|
|
|
|
SMTP SMTPServer `json:"smtp"`
|
|
|
|
DBPath string `json:"dbpath"`
|
2013-12-12 06:27:43 +00:00
|
|
|
}
|
2013-12-12 07:00:22 +00:00
|
|
|
|
2014-01-10 03:21:54 +00:00
|
|
|
// User represents the user model for gophish.
|
2013-12-12 07:00:22 +00:00
|
|
|
type User struct {
|
2014-01-13 02:00:20 +00:00
|
|
|
Id int `json:"id"`
|
|
|
|
Username string `json:"username"`
|
|
|
|
Hash string `json:"-"`
|
|
|
|
APIKey string `json:"apikey"`
|
2013-12-12 07:00:22 +00:00
|
|
|
}
|
2014-01-10 03:21:54 +00:00
|
|
|
|
|
|
|
// Flash is used to hold flash information for use in templates.
|
|
|
|
type Flash struct {
|
|
|
|
Type string
|
|
|
|
Message string
|
|
|
|
}
|
2014-01-13 03:36:26 +00:00
|
|
|
|
|
|
|
//Campaign is a struct representing a created campaign
|
|
|
|
type Campaign struct {
|
|
|
|
Id int `json:"id"`
|
|
|
|
Name string `json:"name"`
|
|
|
|
CreatedDate time.Time `json:"created_date"`
|
|
|
|
CompletedDate time.Time `json:"completed_date"`
|
|
|
|
Targets []mail.Address `json:"targets"`
|
|
|
|
Template email.Email `json:"template"`
|
|
|
|
Status string `json:"status"`
|
|
|
|
}
|