查询弱密码管理员时只查询已启用的管理员

This commit is contained in:
GoEdgeLab
2023-04-09 17:31:09 +08:00
parent 7aad5ea8b8
commit 8664117439

View File

@@ -275,6 +275,7 @@ func (this *AdminDAO) CountAllEnabledAdmins(tx *dbs.Tx, keyword string, hasWeakP
}
if hasWeakPasswords {
query.Attr("password", weakPasswords)
query.Attr("isOn", true)
}
return query.
State(AdminStateEnabled).
@@ -290,6 +291,7 @@ func (this *AdminDAO) ListEnabledAdmins(tx *dbs.Tx, keyword string, hasWeakPassw
}
if hasWeakPasswords {
query.Attr("password", weakPasswords)
query.Attr("isOn", true)
}
_, err = query.