diff --git a/shared.go b/shared.go index 0a59c97b..928657e1 100755 --- a/shared.go +++ b/shared.go @@ -1149,6 +1149,16 @@ func HandleGetOrg(resp http.ResponseWriter, request *http.Request) { } } + if project.Environment == "onprem" && org.Created > 0 { + + nowUnix := time.Now().Unix() + + thirtyDays := int64(30 * 24 * 60 * 60) + isAfter30Days := nowUnix >= org.Created+thirtyDays + + org.OldOrg = isAfter30Days + } + // Make sure to add all orgs that are childs IF you have access org.ChildOrgs = []OrgMini{} diff --git a/structs.go b/structs.go index a78e818d..f5589779 100755 --- a/structs.go +++ b/structs.go @@ -1097,6 +1097,7 @@ type Org struct { CreatorOrg string `json:"creator_org" datastore:"creator_org"` Branding OrgBranding `json:"branding" datastore:"branding"` Licensed bool `json:"licensed" datastore:"licensed"` //Track onprem license + OldOrg bool `json:"old_org" datastore:"old_org"` // This is true for org older then 30 days } type Billing struct {