feat: Able to disable non-admin to create new organization (#927)

This commit is contained in:
Bo-Yi Wu 2017-02-14 20:16:00 +08:00 committed by Lunny Xiao
parent 23aba523b5
commit d67b278a0d
7 changed files with 42 additions and 3 deletions

View file

@ -257,6 +257,11 @@ var (
FileExtensions: strings.Split(".md,.markdown,.mdown,.mkd", ","),
}
// Admin settings
Admin struct {
DisableRegularOrgCreation bool
}
// Picture settings
AvatarUploadPath string
GravatarSource string
@ -855,6 +860,8 @@ please consider changing to GITEA_CUSTOM`)
log.Fatal(4, "Failed to map UI settings: %v", err)
} else if err = Cfg.Section("markdown").MapTo(&Markdown); err != nil {
log.Fatal(4, "Failed to map Markdown settings: %v", err)
} else if err = Cfg.Section("admin").MapTo(&Admin); err != nil {
log.Fatal(4, "Fail to map Admin settings: %v", err)
} else if err = Cfg.Section("cron").MapTo(&Cron); err != nil {
log.Fatal(4, "Failed to map Cron settings: %v", err)
} else if err = Cfg.Section("git").MapTo(&Git); err != nil {