]> git.stg.codes - stg.git/commitdiff
Check IP in USERS_IMPL::Authorize as early as possible
authorMaxim Mamontov <faust.madf@gmail.com>
Mon, 12 Sep 2011 08:10:25 +0000 (11:10 +0300)
committerMaxim Mamontov <faust.madf@gmail.com>
Mon, 12 Sep 2011 08:10:25 +0000 (11:10 +0300)
projects/stargazer/users_impl.cpp

index 7b110431130fbcb50fe02fbf8091c396bd39f8b3..6b87b5a96ae6dba91a24fe90e8e2918d58836d0d 100644 (file)
@@ -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;
 }