mirror of https://github.com/gogs/gogs.git
install: allow sender's username to be non-email (#3717)
parent
d21767dc9f
commit
f59a607361
2
gogs.go
2
gogs.go
|
@ -16,7 +16,7 @@ import (
|
|||
"github.com/gogits/gogs/modules/setting"
|
||||
)
|
||||
|
||||
const APP_VER = "0.9.143.0211"
|
||||
const APP_VER = "0.9.144.0212"
|
||||
|
||||
func init() {
|
||||
setting.AppVer = APP_VER
|
||||
|
|
|
@ -31,7 +31,7 @@ type InstallForm struct {
|
|||
|
||||
SMTPHost string
|
||||
SMTPFrom string
|
||||
SMTPEmail string `binding:"OmitEmpty;Email;MaxSize(254)" locale:"install.mailer_user"`
|
||||
SMTPUser string `binding:"OmitEmpty;MaxSize(254)" locale:"install.mailer_user"`
|
||||
SMTPPasswd string
|
||||
RegisterConfirm bool
|
||||
MailNotify bool
|
||||
|
|
|
@ -150,7 +150,7 @@ func Install(ctx *context.Context) {
|
|||
if setting.MailService != nil {
|
||||
form.SMTPHost = setting.MailService.Host
|
||||
form.SMTPFrom = setting.MailService.From
|
||||
form.SMTPEmail = setting.MailService.User
|
||||
form.SMTPUser = setting.MailService.User
|
||||
}
|
||||
form.RegisterConfirm = setting.Service.RegisterEmailConfirm
|
||||
form.MailNotify = setting.Service.EnableNotifyMail
|
||||
|
@ -317,7 +317,7 @@ func InstallPost(ctx *context.Context, form auth.InstallForm) {
|
|||
cfg.Section("mailer").Key("ENABLED").SetValue("true")
|
||||
cfg.Section("mailer").Key("HOST").SetValue(form.SMTPHost)
|
||||
cfg.Section("mailer").Key("FROM").SetValue(form.SMTPFrom)
|
||||
cfg.Section("mailer").Key("USER").SetValue(form.SMTPEmail)
|
||||
cfg.Section("mailer").Key("USER").SetValue(form.SMTPUser)
|
||||
cfg.Section("mailer").Key("PASSWD").SetValue(form.SMTPPasswd)
|
||||
} else {
|
||||
cfg.Section("mailer").Key("ENABLED").SetValue("false")
|
||||
|
|
|
@ -1 +1 @@
|
|||
0.9.143.0211
|
||||
0.9.144.0212
|
|
@ -135,9 +135,9 @@
|
|||
<input id="smtp_from" name="smtp_from" value="{{.smtp_from}}">
|
||||
<span class="help">{{.i18n.Tr "install.smtp_from_helper"}}</span>
|
||||
</div>
|
||||
<div class="inline field {{if .Err_SMTPEmail}}error{{end}}">
|
||||
<label for="smtp_email">{{.i18n.Tr "install.mailer_user"}}</label>
|
||||
<input id="smtp_email" name="smtp_email" value="{{.smtp_email}}">
|
||||
<div class="inline field {{if .Err_SMTPUser}}error{{end}}">
|
||||
<label for="smtp_user">{{.i18n.Tr "install.mailer_user"}}</label>
|
||||
<input id="smtp_user" name="smtp_user" value="{{.smtp_user}}">
|
||||
</div>
|
||||
<div class="inline field">
|
||||
<label for="smtp_passwd">{{.i18n.Tr "install.mailer_password"}}</label>
|
||||
|
|
Loading…
Reference in New Issue