mirror of
https://github.com/cuigh/swirl
synced 2025-05-05 20:34:32 +00:00
Save version to settings for compatibility
This commit is contained in:
parent
2d08f97cb6
commit
4cc96bf9dd
@ -3,6 +3,7 @@ package biz
|
|||||||
import (
|
import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/cuigh/auxo/app"
|
||||||
"github.com/cuigh/auxo/net/web"
|
"github.com/cuigh/auxo/net/web"
|
||||||
"github.com/cuigh/swirl/dao"
|
"github.com/cuigh/swirl/dao"
|
||||||
"github.com/cuigh/swirl/model"
|
"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) {
|
func (b *settingBiz) Update(setting *model.Setting, user web.User) (err error) {
|
||||||
do(func(d dao.Interface) {
|
do(func(d dao.Interface) {
|
||||||
|
setting.Version = app.Version
|
||||||
setting.UpdatedBy = user.ID()
|
setting.UpdatedBy = user.ID()
|
||||||
setting.UpdatedAt = time.Now()
|
setting.UpdatedAt = time.Now()
|
||||||
err = d.SettingUpdate(setting)
|
err = d.SettingUpdate(setting)
|
||||||
|
@ -2,19 +2,6 @@ package model
|
|||||||
|
|
||||||
import "time"
|
import "time"
|
||||||
|
|
||||||
// LDAP security policy
|
|
||||||
const (
|
|
||||||
LDAPSecurityNone = 0
|
|
||||||
LDAPSecurityTLS = 1
|
|
||||||
LDAPSecurityStartTLS = 2
|
|
||||||
)
|
|
||||||
|
|
||||||
// LDAP auth type
|
|
||||||
const (
|
|
||||||
LDAPAuthSimple = 0
|
|
||||||
LDAPAuthBind = 1
|
|
||||||
)
|
|
||||||
|
|
||||||
// Perm control scope
|
// Perm control scope
|
||||||
const (
|
const (
|
||||||
PermNone = 0
|
PermNone = 0
|
||||||
@ -24,7 +11,8 @@ const (
|
|||||||
|
|
||||||
// Setting represents the options of swirl.
|
// Setting represents the options of swirl.
|
||||||
type Setting struct {
|
type Setting struct {
|
||||||
LDAP struct {
|
Version string
|
||||||
|
LDAP struct {
|
||||||
Enabled bool `bson:"enabled" json:"enabled,omitempty"`
|
Enabled bool `bson:"enabled" json:"enabled,omitempty"`
|
||||||
Address string `bson:"address" json:"address,omitempty"`
|
Address string `bson:"address" json:"address,omitempty"`
|
||||||
Security int32 `bson:"security" json:"security,omitempty"` // 0-None/1-TLS/2-StartTLS
|
Security int32 `bson:"security" json:"security,omitempty"` // 0-None/1-TLS/2-StartTLS
|
||||||
|
@ -59,6 +59,7 @@
|
|||||||
{{else}}
|
{{else}}
|
||||||
<a href="?filter=blocked">Blocked</a>
|
<a href="?filter=blocked">Blocked</a>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
</p>
|
||||||
<p class="level-item">
|
<p class="level-item">
|
||||||
<a href="new" class="button is-success"><span class="icon"><i class="fas fa-plus"></i></span><span>{{ i18n("button.new") }}</span></a>
|
<a href="new" class="button is-success"><span class="icon"><i class="fas fa-plus"></i></span><span>{{ i18n("button.new") }}</span></a>
|
||||||
</p>
|
</p>
|
||||||
|
Loading…
Reference in New Issue
Block a user