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

removed old API

This commit is contained in:
Harvey Kandola 2017-08-02 15:26:31 +01:00
parent e284a46f86
commit 562872a4a8
105 changed files with 337 additions and 14496 deletions

View file

@ -41,7 +41,7 @@ func (h *Handler) SMTP(w http.ResponseWriter, r *http.Request) {
return
}
config := h.Store.Setting.Get(ctx, "SMTP", "")
config := h.Store.Setting.Get("SMTP", "")
var y map[string]interface{}
json.Unmarshal([]byte(config), &y)
@ -82,7 +82,7 @@ func (h *Handler) SetSMTP(w http.ResponseWriter, r *http.Request) {
return
}
h.Store.Setting.Set(ctx, "SMTP", config)
h.Store.Setting.Set("SMTP", config)
h.Store.Audit.Record(ctx, audit.EventTypeSystemSMTP)
@ -98,7 +98,7 @@ func (h *Handler) License(w http.ResponseWriter, r *http.Request) {
return
}
config := h.Store.Setting.Get(ctx, "EDITION-LICENSE", "")
config := h.Store.Setting.Get("EDITION-LICENSE", "")
if len(config) == 0 {
config = "{}"
}
@ -159,7 +159,7 @@ func (h *Handler) SetLicense(w http.ResponseWriter, r *http.Request) {
js = string(j)
}
h.Store.Setting.Set(ctx, "EDITION-LICENSE", js)
h.Store.Setting.Set("EDITION-LICENSE", js)
event.Handler().Publish(string(event.TypeSystemLicenseChange))

View file

@ -17,7 +17,6 @@ import (
"github.com/documize/community/core/env"
"github.com/documize/community/core/streamutil"
"github.com/documize/community/domain"
"github.com/pkg/errors"
)
@ -27,7 +26,7 @@ type Scope struct {
}
// Get fetches a configuration JSON element from the config table.
func (s Scope) Get(ctx domain.RequestContext, area, path string) (value string) {
func (s Scope) Get(area, path string) (value string) {
if path != "" {
path = "." + path
}
@ -58,7 +57,7 @@ func (s Scope) Get(ctx domain.RequestContext, area, path string) (value string)
}
// Set writes a configuration JSON element to the config table.
func (s Scope) Set(ctx domain.RequestContext, area, json string) error {
func (s Scope) Set(area, json string) error {
if area == "" {
return errors.New("no area")
}
@ -81,7 +80,7 @@ func (s Scope) Set(ctx domain.RequestContext, area, json string) error {
// GetUser fetches a configuration JSON element from the userconfig table for a given orgid/userid combination.
// Errors return the empty string. A blank path returns the whole JSON object, as JSON.
func (s Scope) GetUser(ctx domain.RequestContext, orgID, userID, area, path string) (value string) {
func (s Scope) GetUser(orgID, userID, area, path string) (value string) {
if path != "" {
path = "." + path
}
@ -113,7 +112,7 @@ func (s Scope) GetUser(ctx domain.RequestContext, orgID, userID, area, path stri
}
// SetUser writes a configuration JSON element to the userconfig table for the current user.
func (s Scope) SetUser(ctx domain.RequestContext, orgID, userID, area, json string) error {
func (s Scope) SetUser(orgID, userID, area, json string) error {
if area == "" {
return errors.New("no area")
}