mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-08-30 14:56:17 +00:00
fixed shouldCleanLog
This commit is contained in:
parent
eb27951936
commit
f84897e4fb
1 changed files with 13 additions and 8 deletions
|
@ -195,19 +195,24 @@ func updateInboundClientIps(inboundClientIps *model.InboundClientIps, clientEmai
|
||||||
settings := map[string][]model.Client{}
|
settings := map[string][]model.Client{}
|
||||||
json.Unmarshal([]byte(inbound.Settings), &settings)
|
json.Unmarshal([]byte(inbound.Settings), &settings)
|
||||||
clients := settings["clients"]
|
clients := settings["clients"]
|
||||||
|
shouldCleanLog := false
|
||||||
|
|
||||||
for _, client := range clients {
|
for _, client := range clients {
|
||||||
if client.Email == clientEmail {
|
if client.Email == clientEmail {
|
||||||
|
|
||||||
limitIp := client.LimitIP
|
limitIp := client.LimitIP
|
||||||
|
|
||||||
if limitIp < len(ips) && limitIp != 0 && inbound.Enable {
|
if limitIp != 0 {
|
||||||
|
|
||||||
|
shouldCleanLog = true
|
||||||
|
|
||||||
|
if limitIp < len(ips) && inbound.Enable {
|
||||||
|
|
||||||
disAllowedIps = append(disAllowedIps, ips[limitIp:]...)
|
disAllowedIps = append(disAllowedIps, ips[limitIp:]...)
|
||||||
for i:=limitIp; i < len(ips); i++ {
|
for i:=limitIp; i < len(ips); i++ {
|
||||||
logger.Info("[LIMIT_IP] Email=", clientEmail, " SRC=", ips[i])
|
logger.Info("[LIMIT_IP] Email=", clientEmail, " SRC=", ips[i])
|
||||||
}
|
}
|
||||||
return true
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -217,9 +222,9 @@ func updateInboundClientIps(inboundClientIps *model.InboundClientIps, clientEmai
|
||||||
db := database.GetDB()
|
db := database.GetDB()
|
||||||
err = db.Save(inboundClientIps).Error
|
err = db.Save(inboundClientIps).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false
|
return shouldCleanLog
|
||||||
}
|
}
|
||||||
return false
|
return shouldCleanLog
|
||||||
}
|
}
|
||||||
|
|
||||||
func DisableInbound(id int) error {
|
func DisableInbound(id int) error {
|
||||||
|
|
Loading…
Reference in a new issue