forked from External/ergo
fix incorrect vhost serialization
This commit is contained in:
parent
da2d4ca130
commit
e994e0451a
1 changed files with 10 additions and 1 deletions
|
|
@ -113,7 +113,16 @@ func doImportDBGeneric(config *Config, dbImport databaseImport, credsType Creden
|
|||
tx.Set(fmt.Sprintf(keyAccountCredentials, cfUsername), string(marshaledCredentials), nil)
|
||||
tx.Set(fmt.Sprintf(keyAccountRegTime, cfUsername), strconv.FormatInt(userInfo.RegisteredAt, 10), nil)
|
||||
if userInfo.Vhost != "" {
|
||||
tx.Set(fmt.Sprintf(keyAccountVHost, cfUsername), userInfo.Vhost, nil)
|
||||
vhinfo := VHostInfo{
|
||||
Enabled: true,
|
||||
ApprovedVHost: userInfo.Vhost,
|
||||
}
|
||||
vhBytes, err := json.Marshal(vhinfo)
|
||||
if err == nil {
|
||||
tx.Set(fmt.Sprintf(keyAccountVHost, cfUsername), string(vhBytes), nil)
|
||||
} else {
|
||||
log.Printf("couldn't serialize vhost for %s: %v\n", username, err)
|
||||
}
|
||||
}
|
||||
if len(userInfo.AdditionalNicks) != 0 {
|
||||
tx.Set(fmt.Sprintf(keyAccountAdditionalNicks, cfUsername), marshalReservedNicks(userInfo.AdditionalNicks), nil)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue