add user templates
This commit is contained in:
parent
0c347eda8e
commit
0b86f1f4bb
22
config.go
22
config.go
@ -25,16 +25,17 @@ type MailConfig struct {
|
||||
}
|
||||
|
||||
type Config struct {
|
||||
Ldap *LdapConfig
|
||||
Mail *MailConfig
|
||||
Secret string
|
||||
TplPath string
|
||||
Tls bool
|
||||
Key string
|
||||
Cert string
|
||||
Port string
|
||||
MaxID int
|
||||
lock sync.Mutex
|
||||
Ldap *LdapConfig
|
||||
Mail *MailConfig
|
||||
Secret string
|
||||
TplPath string
|
||||
UserTplPath string
|
||||
Tls bool
|
||||
Key string
|
||||
Cert string
|
||||
Port string
|
||||
MaxID int
|
||||
lock sync.Mutex
|
||||
}
|
||||
|
||||
func validateConfigEntry(entry string, name string) bool {
|
||||
@ -74,6 +75,7 @@ func LoadConfig() (*Config, error) {
|
||||
c.Key = viper.GetString("tls_key")
|
||||
c.Cert = viper.GetString("tls_cert")
|
||||
c.TplPath = viper.GetString("templates_path")
|
||||
c.UserTplPath = viper.GetString("user_templates_path")
|
||||
m.SmtpServer = viper.GetString("SmtpServer")
|
||||
m.Username = viper.GetString("SmtpUsername")
|
||||
m.Password = viper.GetString("SmtpPassword")
|
||||
|
4
main.go
4
main.go
@ -41,6 +41,10 @@ func main() {
|
||||
router.HandleFunc("/reset/error", resetErrorPage).Methods("GET")
|
||||
log.Printf("Registering templates from %v/\n", Conf.TplPath)
|
||||
tpl = template.Must(template.ParseGlob(Conf.TplPath + "/*"))
|
||||
if Conf.UserTplPath != "" {
|
||||
log.Printf("Registering user templates from %v/\n", Conf.UsrTplPath)
|
||||
tpl = template.Must(tpl.ParseGlob(Conf.UserTplPath + "/*"))
|
||||
}
|
||||
log.Println("Performing LDAP checks")
|
||||
log.Println("Loading max employeeNumber for account creation")
|
||||
i, err := findLDAPMaxID()
|
||||
|
Loading…
Reference in New Issue
Block a user