Allow disabling uploads

This commit is contained in:
Justin Nuß 2014-07-24 15:51:40 +02:00
parent 9df99681fb
commit 4d702eb345
5 changed files with 23 additions and 1 deletions

View file

@ -76,6 +76,7 @@ var (
AttachmentAllowedTypes string
AttachmentMaxSize int64
AttachmentMaxFiles int
AttachmentEnabled bool
// Cache settings.
Cache cache.Cache
@ -176,6 +177,7 @@ func NewConfigContext() {
AttachmentAllowedTypes = Cfg.MustValue("attachment", "ALLOWED_TYPES", "*/*")
AttachmentMaxSize = Cfg.MustInt64("attachment", "MAX_SIZE", 32)
AttachmentMaxFiles = Cfg.MustInt("attachment", "MAX_FILES", 10)
AttachmentEnabled = Cfg.MustBool("attachment", "ENABLE", true)
if err = os.MkdirAll(AttachmentPath, os.ModePerm); err != nil {
log.Fatal("Could not create directory %s: %s", AttachmentPath, err)