diff --git a/server/plugin/plg_authenticate_simple/auth.go b/server/plugin/plg_authenticate_simple/auth.go index 7c54ff2e..e26f6f81 100644 --- a/server/plugin/plg_authenticate_simple/auth.go +++ b/server/plugin/plg_authenticate_simple/auth.go @@ -12,16 +12,17 @@ import ( type SimpleAuth struct{} func (this SimpleAuth) Setup() Form { - n := 0 - a := 0 + nUsers := 0 + aUsers := 0 if users, err := getUsers(); err == nil { - n = len(users) + nUsers = len(users) for i := range users { if users[i].Disabled == false { - a += 1 + aUsers += 1 } } } + return Form{ Elmnts: []FormElement{ { @@ -33,7 +34,11 @@ STATS: ┌─────────────┐ ┌──────────────┐ │ TOTAL USERS │ │ ACTIVE USERS │ | %.4d │ | %.4d │ -└─────────────┘ └──────────────┘`, n, a), +└─────────────┘ └──────────────┘ + +MANAGEMENT GUI: /admin/simple-user-management +EMAIL SERVER : %t +`, nUsers, aUsers, isEmailSetup()), }, { Name: "type", diff --git a/server/plugin/plg_authenticate_simple/notify.go b/server/plugin/plg_authenticate_simple/notify.go index 7886cac8..6f6723ee 100644 --- a/server/plugin/plg_authenticate_simple/notify.go +++ b/server/plugin/plg_authenticate_simple/notify.go @@ -10,6 +10,25 @@ import ( "gopkg.in/gomail.v2" ) +func isEmailSetup() bool { + if Config.Get("email.from").String() == "" { + return false + } + if Config.Get("email.server").String() == "" { + return false + } + if Config.Get("email.port").Int() == 0 { + return false + } + if Config.Get("email.username").String() == "" { + return false + } + if Config.Get("email.password").String() == "" { + return false + } + return true +} + func sendInvitateMail(user User) error { cfg, err := getPluginData() if err != nil {