diff --git a/README.md b/README.md index 917ccf7a..128d236d 100644 --- a/README.md +++ b/README.md @@ -12,9 +12,9 @@ All you need to provide is your database -- PostgreSQL, Microsoft SQL Server or ## Latest Release -[Community edition: v5.2.2](https://github.com/documize/community/releases) +[Community edition: v5.3.0](https://github.com/documize/community/releases) -[Community+ edition: v5.2.2](https://www.documize.com/community) +[Community+ edition: v5.3.0](https://www.documize.com/community) The Community+ edition is the "enterprise" offering with advanced capabilities and customer support: @@ -94,7 +94,7 @@ For both Community and Community+ editions, please contact our help desk for pro -We aim to respond within two working days! +We aim to respond within two working days. ## The Legal Bit diff --git a/domain/product.go b/domain/product.go index f6c03e1f..20e211da 100644 --- a/domain/product.go +++ b/domain/product.go @@ -49,6 +49,9 @@ const ( // PlanSelfHost represents privately hosted Documize instance. PlanSelfHost Plan = "Self-host" + // SeatsFree is Five free users. + SeatsFree Seats = 5 + // Seats0 is 0 users. Seats0 Seats = 0 @@ -88,32 +91,30 @@ type Product struct { // IsValid returns if subscription is valid using RequestContext. func (p *Product) IsValid(ctx RequestContext) bool { - return true - // Community edition is always valid. - // if p.Edition == CommunityEdition { - // return true - // } + if p.Edition == CommunityEdition { + return true + } // Empty means we cannot be valid. - // if ctx.Subscription.IsEmpty() { - // return false - // } + if ctx.Subscription.IsEmpty() { + return false + } // Enterprise edition is valid if system has loaded up user count by tenant. - // if uc, ok := p.UserCount[ctx.OrgID]; ok { - // // Enterprise edition is valid if subcription date is greater than now and we have enough users/seats. - // if time.Now().UTC().Before(ctx.Subscription.End) && uc <= int(ctx.Subscription.Seats) { - // return true - // } - // } else { - // // First 10 is free for Enterprise edition. - // if Seats1 == ctx.Subscription.Seats && time.Now().UTC().Before(ctx.Subscription.End) { - // return true - // } - // } + if uc, ok := p.UserCount[ctx.OrgID]; ok { + // Enterprise edition is valid if subcription date is greater than now and we have enough users/seats. + if time.Now().UTC().Before(ctx.Subscription.End) && uc <= int(ctx.Subscription.Seats) { + return true + } + } else { + // First 5 is free for Enterprise edition. + if SeatsFree == ctx.Subscription.Seats && time.Now().UTC().Before(ctx.Subscription.End) { + return true + } + } - // return false + return false } // SubscriptionData holds encrypted data and is unpacked into Subscription. @@ -161,8 +162,10 @@ type SubscriptionUserAccount struct { // SubscriptionAsXML returns subscription data as XML document: // // -// some key -// some signature +// +// some key +// some signature +// // // // XML document is empty in case of error. diff --git a/edition/community.go b/edition/community.go index 3dc6f111..2d403400 100644 --- a/edition/community.go +++ b/edition/community.go @@ -40,9 +40,9 @@ func main() { // Specify the product edition. rt.Product = domain.Product{} rt.Product.Major = "5" - rt.Product.Minor = "2" - rt.Product.Patch = "2" - rt.Product.Revision = "220912123425" + rt.Product.Minor = "3" + rt.Product.Patch = "0" + rt.Product.Revision = "220918142046" rt.Product.Version = fmt.Sprintf("%s.%s.%s", rt.Product.Major, rt.Product.Minor, rt.Product.Patch) rt.Product.Edition = domain.CommunityEdition rt.Product.Title = "Community" diff --git a/go.mod b/go.mod index 04523af2..87c338e1 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/documize/community -go 1.18 +go 1.19 require ( github.com/BurntSushi/toml v0.3.1 diff --git a/gui/app/constants/constants.js b/gui/app/constants/constants.js index 17298509..8bee083e 100644 --- a/gui/app/constants/constants.js +++ b/gui/app/constants/constants.js @@ -173,7 +173,10 @@ let constants = EmberObject.extend({ Seats5: 250, // Seats6 is unlimited. - Seats6: 9999 + Seats6: 9999, + + // SeatsFree is x users free for Enterprise edition. + SeatsFree: 5 }, Icon: { // eslint-disable-line ember/avoid-leaking-state-in-ember-objects diff --git a/gui/package.json b/gui/package.json index 5a22a53f..1f455578 100644 --- a/gui/package.json +++ b/gui/package.json @@ -1,6 +1,6 @@ { "name": "documize", - "version": "5.2.2", + "version": "5.3.0", "private": true, "description": "Documize Community", "repository": "",