From 4cc96bf9dd0ffcb278e289e71c50672f382cb633 Mon Sep 17 00:00:00 2001 From: cuigh Date: Wed, 4 Apr 2018 18:46:59 +0800 Subject: [PATCH] Save version to settings for compatibility --- biz/setting.go | 2 ++ model/system.go | 16 ++-------------- views/system/user/list.jet | 3 ++- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/biz/setting.go b/biz/setting.go index e5f5e7b..db95323 100644 --- a/biz/setting.go +++ b/biz/setting.go @@ -3,6 +3,7 @@ package biz import ( "time" + "github.com/cuigh/auxo/app" "github.com/cuigh/auxo/net/web" "github.com/cuigh/swirl/dao" "github.com/cuigh/swirl/model" @@ -24,6 +25,7 @@ func (b *settingBiz) Get() (setting *model.Setting, err error) { func (b *settingBiz) Update(setting *model.Setting, user web.User) (err error) { do(func(d dao.Interface) { + setting.Version = app.Version setting.UpdatedBy = user.ID() setting.UpdatedAt = time.Now() err = d.SettingUpdate(setting) diff --git a/model/system.go b/model/system.go index 2754471..611885e 100644 --- a/model/system.go +++ b/model/system.go @@ -2,19 +2,6 @@ package model import "time" -// LDAP security policy -const ( - LDAPSecurityNone = 0 - LDAPSecurityTLS = 1 - LDAPSecurityStartTLS = 2 -) - -// LDAP auth type -const ( - LDAPAuthSimple = 0 - LDAPAuthBind = 1 -) - // Perm control scope const ( PermNone = 0 @@ -24,7 +11,8 @@ const ( // Setting represents the options of swirl. type Setting struct { - LDAP struct { + Version string + LDAP struct { Enabled bool `bson:"enabled" json:"enabled,omitempty"` Address string `bson:"address" json:"address,omitempty"` Security int32 `bson:"security" json:"security,omitempty"` // 0-None/1-TLS/2-StartTLS diff --git a/views/system/user/list.jet b/views/system/user/list.jet index a77eebb..9929397 100644 --- a/views/system/user/list.jet +++ b/views/system/user/list.jet @@ -57,8 +57,9 @@ {{if .Filter == "blocked"}} Blocked {{else}} - Blocked + Blocked {{end}} +

{{ i18n("button.new") }}