瀏覽代碼

Merge branch 'hotfix/fix_ip_restricted_routes_checkup'

Olivier Massot 2 年之前
父節點
當前提交
63a03fa744
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      ot_core/Classes/Middleware/OtBackendUserAuthenticator.php

+ 2 - 2
ot_core/Classes/Middleware/OtBackendUserAuthenticator.php

@@ -27,7 +27,7 @@ class OtBackendUserAuthenticator extends BackendUserAuthenticator
             // The routes defined in the ot-admin extension are limited to some ips
             if (preg_match('/\/otadmin\/.+/', $route->getPath())) {
                 if (ApiController::isIpAllowed($_SERVER['REMOTE_ADDR'])) {
-                    return true;
+                    return false;
                 } else {
                     throw new \RuntimeException('An unauthorized IP (' . $_SERVER['REMOTE_ADDR'] . ') ' .
                                                         'tried to run the following ot-admin command: ' . $_SERVER['QUERY_STRING']);
@@ -37,7 +37,7 @@ class OtBackendUserAuthenticator extends BackendUserAuthenticator
 
         // The routes defined in the ot-core extension are public
         if (preg_match('/\/otcore\/.+/', $route->getPath())) {
-            return true;
+            return false;
         }
 
         return parent::isLoggedInBackendUserRequired($route);