Browse Source

config: restore defaults for smtp templates path

It was mistakenly deleted in the previous commit

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
Nicola Murino 3 years ago
parent
commit
79857a8733
2 changed files with 2 additions and 1 deletions
  1. 1 0
      config/config.go
  2. 1 1
      httpd/server.go

+ 1 - 0
config/config.go

@@ -1603,6 +1603,7 @@ func setViperDefaults() {
 	viper.SetDefault("smtp.auth_type", globalConf.SMTPConfig.AuthType)
 	viper.SetDefault("smtp.auth_type", globalConf.SMTPConfig.AuthType)
 	viper.SetDefault("smtp.encryption", globalConf.SMTPConfig.Encryption)
 	viper.SetDefault("smtp.encryption", globalConf.SMTPConfig.Encryption)
 	viper.SetDefault("smtp.domain", globalConf.SMTPConfig.Domain)
 	viper.SetDefault("smtp.domain", globalConf.SMTPConfig.Domain)
+	viper.SetDefault("smtp.templates_path", globalConf.SMTPConfig.TemplatesPath)
 }
 }
 
 
 func lookupBoolFromEnv(envName string) (bool, bool) {
 func lookupBoolFromEnv(envName string) (bool, bool) {

+ 1 - 1
httpd/server.go

@@ -603,12 +603,12 @@ func (s *httpdServer) handleWebAdminSetupPost(w http.ResponseWriter, r *http.Req
 	}
 	}
 	username := r.Form.Get("username")
 	username := r.Form.Get("username")
 	password := r.Form.Get("password")
 	password := r.Form.Get("password")
+	confirmPassword := r.Form.Get("confirm_password")
 	installCode := r.Form.Get("install_code")
 	installCode := r.Form.Get("install_code")
 	if installationCode != "" && installCode != installationCode {
 	if installationCode != "" && installCode != installationCode {
 		renderAdminSetupPage(w, r, username, fmt.Sprintf("%v mismatch", installationCodeHint))
 		renderAdminSetupPage(w, r, username, fmt.Sprintf("%v mismatch", installationCodeHint))
 		return
 		return
 	}
 	}
-	confirmPassword := r.Form.Get("confirm_password")
 	if username == "" {
 	if username == "" {
 		renderAdminSetupPage(w, r, username, "Please set a username")
 		renderAdminSetupPage(w, r, username, "Please set a username")
 		return
 		return