Browse Source

install: allow sender's username to be non-email (#3717)

pull/4015/merge
Unknwon 8 years ago
parent
commit
f59a607361
No known key found for this signature in database
GPG Key ID: 25B575AE3213B2B3
  1. 2
      gogs.go
  2. 2
      modules/auth/user_form.go
  3. 4
      routers/install.go
  4. 2
      templates/.VERSION
  5. 6
      templates/install.tmpl

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

2
modules/auth/user_form.go

@ -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

4
routers/install.go

@ -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")

2
templates/.VERSION

@ -1 +1 @@
0.9.143.0211
0.9.144.0212

6
templates/install.tmpl

@ -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…
Cancel
Save