X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/a89444b19b0ceb41db8db6cfa4e6fa77e26d7759..4f1aca7dfb6adf867713ad48e14ad79080e13cfa:/projects/stargazer/users_impl.cpp diff --git a/projects/stargazer/users_impl.cpp b/projects/stargazer/users_impl.cpp index 17d1e4f7..dfdc8634 100644 --- a/projects/stargazer/users_impl.cpp +++ b/projects/stargazer/users_impl.cpp @@ -695,6 +695,24 @@ std::map::const_iterator it(ipIndex.find(ip)); return it != ipIndex.end(); } //----------------------------------------------------------------------------- +bool USERS_IMPL::IsIPInUse(uint32_t ip, const std::string & login, CONST_USER_PTR * user) const +{ +STG_LOCKER lock(&mutex, __FILE__, __LINE__); +std::list::const_iterator iter; +iter = users.begin(); +while (iter != users.end()) + { + if (iter->GetLogin() != login && iter->GetProperty().ips.Get().IsIPInIPS(ip)) + { + if (user != NULL) + *user = &(*iter); + return true; + } + ++iter; + } +return false; +} +//----------------------------------------------------------------------------- void USERS_IMPL::AddNotifierUserAdd(NOTIFIER_BASE * n) { STG_LOCKER lock(&mutex, __FILE__, __LINE__);