From e470c81abda3653a5ef2e3cff7b610aa823fe9b4 Mon Sep 17 00:00:00 2001 From: Maxim Mamontov Date: Mon, 12 Sep 2011 11:10:25 +0300 Subject: [PATCH] Check IP in USERS_IMPL::Authorize as early as possible --- projects/stargazer/users_impl.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/projects/stargazer/users_impl.cpp b/projects/stargazer/users_impl.cpp index 7b110431..6b87b5a9 100644 --- a/projects/stargazer/users_impl.cpp +++ b/projects/stargazer/users_impl.cpp @@ -280,9 +280,6 @@ if (FindByNameNonLock(login, &iter)) return false; } -if (iter->Authorize(ip, enabledDirs, auth)) - return false; - if (FindByIPIdx(ip, iter)) { if (iter->GetLogin() != login) @@ -292,9 +289,14 @@ if (FindByIPIdx(ip, iter)) iter->GetLogin().c_str()); return false; } + if (iter->Authorize(ip, enabledDirs, auth)) + return false; return true; } +if (iter->Authorize(ip, enabledDirs, auth)) + return false; + AddToIPIdx(iter); return true; } -- 2.44.2