custom avatar upload

This commit is contained in:
Unknwon 2014-11-21 10:58:08 -05:00
parent 3c3f7c2a56
commit 55dfe2c978
20 changed files with 239 additions and 97 deletions

View file

@ -66,9 +66,10 @@ var (
ScriptType string
// Picture settings.
PictureService string
GravatarSource string
DisableGravatar bool
PictureService string
AvatarUploadPath string
GravatarSource string
DisableGravatar bool
// Log settings.
LogRootPath string
@ -259,6 +260,9 @@ func NewConfigContext() {
ScriptType = Cfg.MustValue("repository", "SCRIPT_TYPE", "bash")
PictureService = Cfg.MustValueRange("picture", "SERVICE", "server", []string{"server"})
AvatarUploadPath = Cfg.MustValue("picture", "AVATAR_UPLOAD_PATH", "data/avatars")
os.MkdirAll(AvatarUploadPath, os.ModePerm)
switch Cfg.MustValue("picture", "GRAVATAR_SOURCE", "gravatar") {
case "duoshuo":
GravatarSource = "http://gravatar.duoshuo.com/avatar/"