From 09f72aba4d761df9e2f26fe134687db51b413cda Mon Sep 17 00:00:00 2001
From: Jonas Leder <jonas@jonasled.de>
Date: Sat, 2 Jan 2021 00:34:01 +0100
Subject: [PATCH] decide on track url between normal and tor version

---
 public/internal/header.php | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/public/internal/header.php b/public/internal/header.php
index 764fe7b..1964a8f 100644
--- a/public/internal/header.php
+++ b/public/internal/header.php
@@ -1,9 +1,16 @@
 <?php
+include "config.php";
 include "menue.php";
 
 function getHeader($pagetitle, $navselect)
 {
     $menu = getMenu($navselect);
+    if (strpos($_SERVER['HTTP_HOST'], '.onion') !== false) {
+        $trackURL = $trackURLTor;
+    } else {
+        $trackURL = $trackURLNormal;
+    }
+
     echo(<<<EOF
     <!DOCTYPE html >
     <html lang = "de" >
@@ -45,7 +52,7 @@ function getHeader($pagetitle, $navselect)
     </header >
     <div id = "content" >
     <!--Matomo Image Tracker -->
-    <img src = "https://matomo.jonasled.de/matomo.php?idsite=1&amp;rec=1" style = "border:0" alt = "" />
+    <img src = "$trackURL" style = "border:0" alt = "" />
     <!--End Matomo -->
 EOF);
 }
\ No newline at end of file
-- 
GitLab