|
|
|
@ -66,7 +66,7 @@ func NewUserPage(app *App, r *http.Request, u *User, title string, flashes []str |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func canUserInvite(cfg *config.Config, isAdmin bool) bool { |
|
|
|
|
return cfg.App.UserInvites != "" && |
|
|
|
|
return cfg.App.UserInvites != "" && |
|
|
|
|
(isAdmin || cfg.App.UserInvites != "admin") |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -299,14 +299,16 @@ func viewLogin(app *App, w http.ResponseWriter, r *http.Request) error { |
|
|
|
|
|
|
|
|
|
p := &struct { |
|
|
|
|
page.StaticPage |
|
|
|
|
To string |
|
|
|
|
Message template.HTML |
|
|
|
|
Flashes []template.HTML |
|
|
|
|
LoginUsername string |
|
|
|
|
OauthSlack bool |
|
|
|
|
OauthWriteAs bool |
|
|
|
|
OauthGitlab bool |
|
|
|
|
GitlabDisplayName string |
|
|
|
|
To string |
|
|
|
|
Message template.HTML |
|
|
|
|
Flashes []template.HTML |
|
|
|
|
LoginUsername string |
|
|
|
|
OauthSlack bool |
|
|
|
|
OauthWriteAs bool |
|
|
|
|
OauthGitlab bool |
|
|
|
|
OauthGeneric bool |
|
|
|
|
OauthGenericDisplayName string |
|
|
|
|
GitlabDisplayName string |
|
|
|
|
}{ |
|
|
|
|
pageForReq(app, r), |
|
|
|
|
r.FormValue("to"), |
|
|
|
@ -316,6 +318,8 @@ func viewLogin(app *App, w http.ResponseWriter, r *http.Request) error { |
|
|
|
|
app.Config().SlackOauth.ClientID != "", |
|
|
|
|
app.Config().WriteAsOauth.ClientID != "", |
|
|
|
|
app.Config().GitlabOauth.ClientID != "", |
|
|
|
|
app.Config().GenericOauth.ClientID != "", |
|
|
|
|
config.OrDefaultString(app.Config().GenericOauth.DisplayName, oAuthGenericDisplayName), |
|
|
|
|
config.OrDefaultString(app.Config().GitlabOauth.DisplayName, gitlabDisplayName), |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|