mirror of
https://github.com/documize/community.git
synced 2025-07-20 13:49:42 +02:00
implemented edition license checks
This commit is contained in:
parent
edccb39019
commit
a4e3264e0c
19 changed files with 146 additions and 19 deletions
|
@ -164,3 +164,17 @@ func WriteJSON(w http.ResponseWriter, v interface{}) {
|
|||
_, err = w.Write(j)
|
||||
log.IfErr(err)
|
||||
}
|
||||
|
||||
// WriteBadLicense writes 402 when license is invalid
|
||||
func WriteBadLicense(w http.ResponseWriter) {
|
||||
w.Header().Set("Content-Type", "application/json; charset=utf-8")
|
||||
w.WriteHeader(http.StatusPaymentRequired)
|
||||
var e struct {
|
||||
Reason string
|
||||
}
|
||||
e.Reason = "invalid or expired Documize license"
|
||||
|
||||
j, _ := json.Marshal(e)
|
||||
_, err := w.Write(j)
|
||||
log.IfErr(err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue