1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-08-05 13:35:25 +02:00

Allow admins to set subdomain for their instance

Fixes #209

Admins can see and set subdomain for their instance.

Self-host customers only!
This commit is contained in:
Harvey Kandola 2019-02-27 13:49:59 +00:00
parent af9bc25660
commit f828583b49
6 changed files with 25 additions and 3 deletions

View file

@ -15,10 +15,10 @@ import (
"bytes"
"database/sql"
"encoding/json"
"github.com/documize/community/model/audit"
"io"
"io/ioutil"
"net/http"
"strings"
"github.com/documize/community/core/env"
"github.com/documize/community/core/request"
@ -26,6 +26,7 @@ import (
"github.com/documize/community/core/streamutil"
"github.com/documize/community/domain"
"github.com/documize/community/domain/store"
"github.com/documize/community/model/audit"
"github.com/documize/community/model/org"
)
@ -82,6 +83,7 @@ func (h *Handler) Update(w http.ResponseWriter, r *http.Request) {
err = json.Unmarshal(body, &org)
org.RefID = ctx.OrgID
org.Domain = strings.ToLower(org.Domain)
ctx.Transaction, err = h.Runtime.Db.Beginx()
if err != nil {

View file

@ -115,7 +115,7 @@ func (s Store) UpdateOrganization(ctx domain.RequestContext, org org.Organizatio
org.Revised = time.Now().UTC()
_, err = ctx.Transaction.NamedExec(`UPDATE dmz_org SET
c_title=:title, c_message=:message, c_service=:conversionendpoint, c_email=:email,
c_title=:title, c_message=:message, c_service=:conversionendpoint, c_email=:email, c_domain=:domain,
c_anonaccess=:allowanonymousaccess, c_maxtags=:maxtags, c_theme=:theme, c_revised=:revised
WHERE c_refid=:refid`,
&org)