public void BanIp(string ip, string notes = "") { var abi = new DbIpInfo(_db, ip) { Banned = true, Notes = notes }; abi.Flush(); }
public bool UnBanIp(string ip) { var abi = new DbIpInfo(_db, ip); if (!abi.IsNull && abi.Banned) { abi.Banned = false; abi.Flush(); return(true); } return(false); }
public void LogAccountByIp(string ip, int accountId) { var abi = new DbIpInfo(_db, ip); if (!abi.IsNull) { abi.Accounts.Add(accountId); } else { abi.Accounts = new HashSet <int> { accountId } }; abi.Flush(); }
public bool IsIpBanned(string ip) { var abi = new DbIpInfo(_db, ip); return(abi.Banned); }