std::string GetIpStr() const;
bool IsIPInIPS(uint32_t ip) const;
bool OnlyOneIP() const;
+ bool IsAnyIP() const;
size_t Count() const;
void Add(const IP_MASK &im);
void Erase();
}
//-----------------------------------------------------------------------------
inline
+bool USER_IPS::IsAnyIP() const
+{
+ return !ips.empty() && ips.front().ip == 0;
+}
+//-----------------------------------------------------------------------------
+inline
void USER_IPS::Add(const IP_MASK &im)
{
ips.push_back(im);
iter = users.begin();
while (iter != users.end())
{
- if (iter->GetLogin() != login && iter->GetProperty().ips.Get().IsIPInIPS(ip))
+ if (iter->GetLogin() != login &&
+ !iter->GetProperty().ips.Get().IsAnyIP() &&
+ iter->GetProperty().ips.Get().IsIPInIPS(ip))
{
if (user != NULL)
*user = &(*iter);