Browse Source

switch to new piwik/matomo proxy

master
max.mehl 3 years ago
parent
commit
e63280ef1c
Signed by: mxmehl GPG Key ID: 2704E4AB371E2E92
  1. 2
      .gitignore
  2. 36
      matomo-proxy.php
  3. 14
      piwik.php

2
.gitignore

@ -1 +1 @@
piwik.php
proxy.php

36
matomo-proxy.php

@ -0,0 +1,36 @@
<?php
define('MATOMO_PROXY_FROM_ENDPOINT', 1);
$path = 'index.php';
$SUPPORTED_METHODS = [
'CoreAdminHome.optOut'
];
$VALID_FILES = [
'plugins/CoreAdminHome/javascripts/optOut.js'
];
$module = isset($_GET['module']) ? $_GET['module'] : null;
if (empty($module)) {
$module = isset($_POST['module']) ? $_POST['module'] : null;
}
$action = isset($_GET['action']) ? $_GET['action'] : null;
if (empty($action)) {
$action = isset($_POST['action']) ? $_POST['action'] : null;
}
$filerequest = isset($_GET['file']) ? $_GET['file'] : null;
if (empty($filerequest)) {
$filerequest = isset($_POST['file']) ? $_POST['file'] : null;
}
if (!(isset($filerequest) && in_array($filerequest, $VALID_FILES))
&& !(isset($module) && isset($action) && in_array("$module.$action", $SUPPORTED_METHODS))
) {
http_response_code(404);
exit;
}
include dirname(__FILE__) . '/proxy.php';

14
piwik.php

@ -0,0 +1,14 @@
<?php
/**
* Piwik - free/libre analytics platform
* Piwik Proxy Hide URL
*
* @link http://piwik.org/faq/how-to/#faq_132
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
define('MATOMO_PROXY_FROM_ENDPOINT', 1);
$path = "piwik.php";
include dirname(__FILE__) . '/proxy.php';
Loading…
Cancel
Save