MFA fix, added IP blacklist, update webmail client
This commit is contained in:
@@ -1,12 +1,15 @@
|
||||
package webui
|
||||
|
||||
import "net/http"
|
||||
import (
|
||||
"net/http"
|
||||
"time"
|
||||
)
|
||||
|
||||
// navCounts are the small per-resource counts shown as sidebar badges on every page
|
||||
// (and reused by the dashboard's own stat tiles, which use the same numbers) — scoped
|
||||
// to the current admin exactly like every list page already is.
|
||||
type navCounts struct {
|
||||
DomainCount, SenderCount, MailboxCount, IPCount, DKIMCount int
|
||||
DomainCount, SenderCount, MailboxCount, IPCount, DKIMCount, BlacklistCount int
|
||||
}
|
||||
|
||||
func (a *App) computeNavCounts(r *http.Request) navCounts {
|
||||
@@ -17,6 +20,14 @@ func (a *App) computeNavCounts(r *http.Request) navCounts {
|
||||
c.DomainCount, _ = a.DB.CountActiveDomains()
|
||||
c.SenderCount, _ = a.DB.CountActiveSenders()
|
||||
c.DKIMCount, _ = a.DB.CountActiveDKIMKeys()
|
||||
if entries, err := a.DB.ListBlacklist(); err == nil {
|
||||
now := time.Now()
|
||||
for _, e := range entries {
|
||||
if e.ExpiresAt.After(now) {
|
||||
c.BlacklistCount++
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
domains, _ := a.DB.ListDomains()
|
||||
for _, d := range domains {
|
||||
|
||||
Reference in New Issue
Block a user