52 lines
982 B
Go
52 lines
982 B
Go
package main
|
|
|
|
import (
|
|
"html/template"
|
|
"time"
|
|
)
|
|
|
|
type Person struct {
|
|
FirstName string
|
|
LastName string
|
|
Email string
|
|
Department string
|
|
Phones []Phone
|
|
RawPhoneNumber string
|
|
InternalPhone string
|
|
IsContact bool // Neues Feld zur Unterscheidung zwischen Benutzern und Kontakten
|
|
}
|
|
|
|
type Phone struct {
|
|
PhoneNumber string
|
|
Type string
|
|
}
|
|
|
|
type Config struct {
|
|
PhoneRules struct {
|
|
Country struct {
|
|
Prefix string `yaml:"prefix"`
|
|
AreaCodes []string `yaml:"area_codes"`
|
|
InternalPrefix string `yaml:"internal_prefix"`
|
|
} `yaml:"country"`
|
|
InvalidNumber string `yaml:"invalid_number"`
|
|
} `yaml:"phone_rules"`
|
|
}
|
|
|
|
type LDAPConfig struct {
|
|
Server string
|
|
Port string
|
|
BindDN string
|
|
BindPassword string
|
|
BaseDN string
|
|
Filter string
|
|
}
|
|
|
|
var (
|
|
cachedData []Person
|
|
lastUpdate time.Time
|
|
tmpl *template.Template
|
|
ldapConfig LDAPConfig
|
|
serverPort string
|
|
config Config
|
|
)
|