Bläddra i källkod

update matomo user and patch the bruteforce issue

Olivier Massot 5 år sedan
förälder
incheckning
1175a7c633
1 ändrade filer med 12 tillägg och 2 borttagningar
  1. 12 2
      ot_stats/Classes/Domain/Repository/MatomoWebsiteRepository.php

+ 12 - 2
ot_stats/Classes/Domain/Repository/MatomoWebsiteRepository.php

@@ -13,8 +13,8 @@ class MatomoWebsiteRepository
 {
     const MATOMO_DB_HOST = 'tools';
     const MATOMO_DB_NAME = 'matomo';
-    const MATOMO_DB_USER = 'root';
-    const MATOMO_DB_PWD = 'mysql2iopenservice369566';
+    const MATOMO_DB_USER = 'matomo';
+    const MATOMO_DB_PWD = ']:*j8GYU/n9mp+';
 
     const RELATIVE_PATH_VALIDATION = '/^\/[a-zA-Z0-9_\-]+\/?$/';
     const DOMAIN_VALIDATION = '/^(https?:\/\/)?([a-zA-Z0-9]+\.)+[a-zA-Z]{2,}(:\d+)?(\/[a-zA-Z0-9_\-]+)*\/?$/';
@@ -263,4 +263,14 @@ class MatomoWebsiteRepository
         }
     }
 
+    /**
+     * A little workaround before the release of a fix for this issue:
+     *   https://github.com/matomo-org/matomo/issues/16867#issuecomment-738639828
+     */
+    public function clearBruteforceLog() {
+        $remoteIp = $_SERVER['REMOTE_ADDR'];
+        $stmt = $this->matomoCnn->prepare(
+            "DELETE FROM matomo.matomo_brute_force_log WHERE ip_address='" . $remoteIp .  "'");
+        $stmt->execute();
+    }
 }