mirror of
https://github.com/documize/community.git
synced 2025-07-19 13:19:43 +02:00
Conditionally backup/restore dmz_config
This commit is contained in:
parent
0a64afd6b5
commit
c0e1bd5045
2 changed files with 10 additions and 6 deletions
|
@ -268,7 +268,10 @@ func (b backerHandler) dmzConfig(files *[]backupItem) (err error) {
|
|||
if err != nil {
|
||||
return
|
||||
}
|
||||
*files = append(*files, backupItem{Filename: "dmz_config.json", Content: content})
|
||||
|
||||
if b.Spec.SystemBackup() {
|
||||
*files = append(*files, backupItem{Filename: "dmz_config.json", Content: content})
|
||||
}
|
||||
|
||||
w := ""
|
||||
if !b.Spec.SystemBackup() {
|
||||
|
|
|
@ -136,9 +136,11 @@ func (r *restoreHandler) PerformRestore(b []byte, l int64) (err error) {
|
|||
}
|
||||
|
||||
// Config.
|
||||
err = r.dmzConfig()
|
||||
if err != nil {
|
||||
return
|
||||
if r.Context.GlobalAdmin {
|
||||
err = r.dmzConfig()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// Audit Log.
|
||||
|
@ -1649,8 +1651,7 @@ func (r *restoreHandler) dmzUser() (err error) {
|
|||
err = errors.Wrap(err, fmt.Sprintf("unable to check email %s", u[i].Email))
|
||||
return
|
||||
}
|
||||
// Existing userID from database overrides all incoming userID values
|
||||
// by using remapUser().
|
||||
// Existing userID from database overrides all incoming userID values by using remapUser().
|
||||
if len(userID) > 0 {
|
||||
r.MapUserID[u[i].RefID] = userID
|
||||
insert = false
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue