Merge pull request #2073 from mattermost/ee-updates

Some general updates to EE
Этот коммит содержится в:
Corey Hulen
2016-02-04 13:01:14 -08:00
родитель ec51c31c32 e45282deaa
Коммит af6ade3380
21 изменённых файлов: 711 добавлений и 466 удалений

Просмотреть файл

@@ -8,6 +8,12 @@ import (
"io"
)
type LicenseRecord struct {
Id string `json:"id"`
CreateAt int64 `json:"create_at"`
Bytes string `json:"-"`
}
type License struct {
Id string `json:"id"`
IssuedAt int64 `json:"issued_at"`
@@ -83,3 +89,23 @@ func LicenseFromJson(data io.Reader) *License {
return nil
}
}
func (lr *LicenseRecord) IsValid() *AppError {
if len(lr.Id) != 26 {
return NewLocAppError("LicenseRecord.IsValid", "model.license_record.is_valid.id.app_error", nil, "")
}
if lr.CreateAt == 0 {
return NewLocAppError("LicenseRecord.IsValid", "model.license_record.is_valid.create_at.app_error", nil, "")
}
if len(lr.Bytes) == 0 || len(lr.Bytes) > 10000 {
return NewLocAppError("LicenseRecord.IsValid", "model.license_record.is_valid.create_at.app_error", nil, "")
}
return nil
}
func (lr *LicenseRecord) PreSave() {
lr.CreateAt = GetMillis()
}

Просмотреть файл

@@ -12,6 +12,7 @@ const (
SYSTEM_DIAGNOSTIC_ID = "DiagnosticId"
SYSTEM_RAN_UNIT_TESTS = "RanUnitTests"
SYSTEM_LAST_SECURITY_TIME = "LastSecurityTime"
SYSTEM_ACTIVE_LICENSE_ID = "ActiveLicenseId"
)
type System struct {