]> git.stg.codes - stg.git/blobdiff - projects/stargazer/users_impl.cpp
Check IP in USERS_IMPL::Authorize as early as possible
[stg.git] / 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;
 }