1
0
mirror of https://git.teknik.io/Teknikode/Teknik.git synced 2023-08-02 14:16:22 +02:00

Reverted Piwik Tracker package to last working copy.

This commit is contained in:
Uncled1023 2018-01-31 01:19:13 -08:00
parent 18a066502c
commit 73403551d6
7 changed files with 29 additions and 34 deletions

View File

@ -1,5 +1,4 @@
using nClam;
using Piwik.Tracker;
using System;
using System.Collections.Generic;
using System.Data.Entity;

View File

@ -118,9 +118,6 @@
<HintPath>..\packages\Owin.1.0\lib\net40\Owin.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Piwik.Tracker, Version=3.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Piwik.Tracker.3.0.0\lib\net40\Piwik.Tracker.dll</HintPath>
</Reference>
<Reference Include="PresentationFramework" />
<Reference Include="QRCoder, Version=1.2.3.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\QRCoder.1.2.3\lib\net40\QRCoder.dll</HintPath>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=301880
@ -57,8 +57,8 @@
<add name="PerfModule" type="Teknik.Modules.PerformanceMonitorModule, Teknik" />
<add name="UserAuthModule" type="Teknik.Modules.UserAuthModule, Teknik" />
<add name="BlacklistModule" type="Teknik.Modules.BlacklistModule, Teknik" />
<add name="CORSModule" type="Teknik.Modules.CORSModule, Teknik"/>
<add name="CSPModule" type="Teknik.Modules.CSPModule, Teknik"/>
<add name="CORSModule" type="Teknik.Modules.CORSModule, Teknik" />
<add name="CSPModule" type="Teknik.Modules.CSPModule, Teknik" />
<remove name="UrlRoutingModule-4.0" />
<add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" preCondition="" />
</modules>
@ -137,9 +137,9 @@
<add name="Access-Control-Allow-Headers" value="Authorization, Accept, Origin, Content-Type, X-Requested-With, Connection, Transfer-Encoding" />
<add name="strict-transport-security" value="max-age=31536000; includeSubdomains; preload" />
<add name="X-XSS-Protection" value="1; mode=block" />
<add name="X-Content-Type-Options" value="nosniff"/>
<add name="Referrer-Policy" value="no-referrer, strict-origin-when-cross-origin"/>
<add name="Public-Key-Pins" value="max-age=300; includeSubDomains; pin-sha256=&quot;grX4Ta9HpZx6tSHkmCrvpApTQGo67CYDnvprLg5yRME=&quot;; pin-sha256=&quot;C5+lpZ7tcVwmwQIMcRtPbsQtWLABXhQzejna0wHFr8M=&quot;;"/>
<add name="X-Content-Type-Options" value="nosniff" />
<add name="Referrer-Policy" value="no-referrer, strict-origin-when-cross-origin" />
<add name="Public-Key-Pins" value="max-age=300; includeSubDomains; pin-sha256=&quot;grX4Ta9HpZx6tSHkmCrvpApTQGo67CYDnvprLg5yRME=&quot;; pin-sha256=&quot;C5+lpZ7tcVwmwQIMcRtPbsQtWLABXhQzejna0wHFr8M=&quot;;" />
<add name="Vary" value="Origin" />
</customHeaders>
</httpProtocol>

View File

@ -38,7 +38,6 @@
<package id="nClam" version="2.0.6.0" targetFramework="net462" />
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net462" userInstalled="true" />
<package id="Owin" version="1.0" targetFramework="net462" />
<package id="Piwik.Tracker" version="3.0.0" targetFramework="net462" />
<package id="QRCoder" version="1.2.3" targetFramework="net462" />
<package id="Respond" version="1.4.2" targetFramework="net452" userInstalled="true" />
<package id="System.Xml.XmlSerializer" version="4.3.0" targetFramework="net462" />

View File

@ -40,8 +40,8 @@
<HintPath>..\..\packages\Piwik.Analytics.0.3.0\lib\net40\Piwik.Analytics.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Piwik.Tracker, Version=3.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\Piwik.Tracker.3.0.0\lib\net40\Piwik.Tracker.dll</HintPath>
<Reference Include="Piwik.Tracker, Version=2.16.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\Piwik.Tracker.2.16.0.0\lib\net40\Piwik.Tracker.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />

View File

@ -21,31 +21,31 @@ namespace Teknik.Piwik
sub = "dev - " + sub;
}
//PiwikTracker.URL = config.PiwikConfig.Url;
PiwikTracker.URL = config.PiwikConfig.Url;
PiwikTracker tracker = new PiwikTracker(config.PiwikConfig.SiteId, config.PiwikConfig.Url);
// Set Request Info
tracker.SetIp(clientIp);
tracker.SetTokenAuth(config.PiwikConfig.TokenAuth);
tracker.setIp(clientIp);
tracker.setTokenAuth(config.PiwikConfig.TokenAuth);
tracker.SetUserAgent(userAgent);
tracker.setUserAgent(userAgent);
// Set browser info
tracker.SetResolution(pixelWidth, pixelHeight);
tracker.SetBrowserHasCookies(hasCookies);
tracker.setResolution(pixelWidth, pixelHeight);
tracker.setBrowserHasCookies(hasCookies);
if (!string.IsNullOrEmpty(acceptLang))
tracker.SetBrowserLanguage(acceptLang);
tracker.SetPlugins(new BrowserPlugins {Java = hasJava});
tracker.setBrowserLanguage(acceptLang);
tracker.setPlugins(new BrowserPlugins {java = hasJava});
// Get Referral
if (!string.IsNullOrEmpty(urlReferrer))
tracker.SetUrlReferrer(urlReferrer);
tracker.setUrlReferrer(urlReferrer);
if (!string.IsNullOrEmpty(url))
tracker.SetUrl(url);
tracker.setUrl(url);
// Send the tracking request
tracker.DoTrackPageView(string.Format("{0}/{1}", sub, title));
tracker.doTrackPageView(string.Format("{0}/{1}", sub, title));
}
}
catch (Exception ex)
@ -56,15 +56,15 @@ namespace Teknik.Piwik
public static void TrackDownload(string userAgent, string clientIp, string url, string urlReferrer)
{
TrackAction(ActionType.Download, userAgent, clientIp, url, urlReferrer);
TrackAction(PiwikTracker.ActionType.download, userAgent, clientIp, url, urlReferrer);
}
public static void TrackLink(string userAgent, string clientIp, string url, string urlReferrer)
{
TrackAction(ActionType.Link, userAgent, clientIp, url, urlReferrer);
TrackAction(PiwikTracker.ActionType.link, userAgent, clientIp, url, urlReferrer);
}
private static void TrackAction(ActionType type, string userAgent, string clientIp, string url, string urlReferrer)
private static void TrackAction(PiwikTracker.ActionType type, string userAgent, string clientIp, string url, string urlReferrer)
{
try
{
@ -74,19 +74,19 @@ namespace Teknik.Piwik
{
PiwikTracker tracker = new PiwikTracker(config.PiwikConfig.SiteId, config.PiwikConfig.Url);
tracker.SetUserAgent(userAgent);
tracker.setUserAgent(userAgent);
tracker.SetIp(clientIp);
tracker.SetTokenAuth(config.PiwikConfig.TokenAuth);
tracker.setIp(clientIp);
tracker.setTokenAuth(config.PiwikConfig.TokenAuth);
// Get Referral
if (!string.IsNullOrEmpty(urlReferrer))
tracker.SetUrlReferrer(urlReferrer);
tracker.setUrlReferrer(urlReferrer);
if (!string.IsNullOrEmpty(url))
tracker.SetUrl(url);
tracker.setUrl(url);
tracker.DoTrackAction(url, type);
tracker.doTrackAction(url, type);
}
}
catch (Exception ex)

View File

@ -6,5 +6,5 @@
<package id="Microsoft.AspNet.WebPages" version="3.2.3" targetFramework="net462" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net462" />
<package id="Piwik.Analytics" version="0.3.0" targetFramework="net462" />
<package id="Piwik.Tracker" version="3.0.0" targetFramework="net462" />
<package id="Piwik.Tracker" version="2.16.0.0" targetFramework="net462" />
</packages>