mirror of
https://github.com/cuigh/swirl
synced 2025-05-04 20:11:13 +00:00
Save version to settings for compatibility
This commit is contained in:
parent
2d08f97cb6
commit
4cc96bf9dd
@ -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)
|
||||
|
@ -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
|
||||
|
@ -57,8 +57,9 @@
|
||||
{{if .Filter == "blocked"}}
|
||||
<strong>Blocked</strong>
|
||||
{{else}}
|
||||
<a href="?filter=blocked">Blocked</a>
|
||||
<a href="?filter=blocked">Blocked</a>
|
||||
{{end}}
|
||||
</p>
|
||||
<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>
|
||||
</p>
|
||||
|
Loading…
Reference in New Issue
Block a user