|
@@ -13,14 +13,14 @@ import (
|
|
|
type Checkbox bool
|
|
|
|
|
|
type Credential struct {
|
|
|
- Name string
|
|
|
- Surname string
|
|
|
+ Name string `csv:"firstname"`
|
|
|
+ Surname string `csv:"lastname"`
|
|
|
Password string
|
|
|
PlainPassword string
|
|
|
- Email string
|
|
|
+ Email string `csv:"email"`
|
|
|
AltEmail string
|
|
|
- FromDate time.Time
|
|
|
- ToDate time.Time
|
|
|
+ DateFrom time.Time
|
|
|
+ DateTo time.Time
|
|
|
TelephoneNumber string
|
|
|
|
|
|
Regenerate bool `schema:"Regenerate" sql:"default: false"`
|
|
@@ -54,3 +54,7 @@ func (c *Credential) GeneratePassword() (string, error) {
|
|
|
func (c *Credential) CompleteName() string {
|
|
|
return fmt.Sprintf("%s, %s", c.Name, c.Surname)
|
|
|
}
|
|
|
+
|
|
|
+func (c *Credential) MailAddress(domain string) string {
|
|
|
+ return fmt.Sprintf("%s@%s", c.Username(), domain)
|
|
|
+}
|