|
|
@ -249,12 +249,14 @@ func InstallPost(ctx *context.Context, form auth.InstallForm) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Make sure FROM field is valid
|
|
|
|
// Make sure FROM field is valid
|
|
|
|
_, err := mail.ParseAddress(form.SMTPFrom) |
|
|
|
if len(form.SMTPFrom) > 0 { |
|
|
|
if err != nil { |
|
|
|
_, err := mail.ParseAddress(form.SMTPFrom) |
|
|
|
ctx.Data["Err_SMTP"] = true |
|
|
|
if err != nil { |
|
|
|
ctx.Data["Err_SMTPFrom"] = true |
|
|
|
ctx.Data["Err_SMTP"] = true |
|
|
|
ctx.RenderWithErr(ctx.Tr("install.invalid_smtp_from", err), INSTALL, &form) |
|
|
|
ctx.Data["Err_SMTPFrom"] = true |
|
|
|
return |
|
|
|
ctx.RenderWithErr(ctx.Tr("install.invalid_smtp_from", err), INSTALL, &form) |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Check logic loophole between disable self-registration and no admin account.
|
|
|
|
// Check logic loophole between disable self-registration and no admin account.
|
|
|
|