1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-08-02 20:15:26 +02:00

set defaults for request context

This commit is contained in:
Harvey Kandola 2017-08-27 16:39:09 +01:00
parent 63b24aed3f
commit 8081b60146
23 changed files with 692 additions and 666 deletions

View file

@ -99,7 +99,8 @@ func Setup(s *domain.Store) error {
var json = make([]byte, 0)
if PluginFile == "DB" {
json = []byte(s.Setting.Get("FILEPLUGINS", ""))
c, _ := s.Setting.Get("FILEPLUGINS", "")
json = []byte(c)
if len(bytes.TrimSpace(json)) == 0 {
return nil // don't fail if the DB does not exist yet
}

View file

@ -60,11 +60,6 @@ func (h *Handler) Create(w http.ResponseWriter, r *http.Request) {
dbname := r.Form.Get("dbname")
dbhash := r.Form.Get("dbhash")
h.Runtime.Log.Info(dbname)
h.Runtime.Log.Info(dbhash)
h.Runtime.Log.Info(web.SiteInfo.DBname)
h.Runtime.Log.Info(web.SiteInfo.DBhash)
if dbname != web.SiteInfo.DBname || dbhash != web.SiteInfo.DBhash {
h.Runtime.Log.Error("database.Create()'s security credentials error ", errors.New("bad db name or validation code"))
return