Browse Source

Added .net core piwik tracking api to most entry points

pull/111/head
Teknikode 4 years ago
parent
commit
7945ade961
  1. 2
      Teknik/Areas/API/V1/Controllers/AccountAPIv1Controller.cs
  2. 2
      Teknik/Areas/API/V1/Controllers/PasteAPIv1Controller.cs
  3. 2
      Teknik/Areas/API/V1/Controllers/ShortenAPIv1Controller.cs
  4. 2
      Teknik/Areas/API/V1/Controllers/UploadAPIv1Controller.cs
  5. 1
      Teknik/Areas/About/Controllers/AboutController.cs
  6. 1
      Teknik/Areas/Abuse/Controllers/AbuseController.cs
  7. 4
      Teknik/Areas/Admin/Controllers/AdminController.cs
  8. 6
      Teknik/Areas/Blog/Controllers/BlogController.cs
  9. 1
      Teknik/Areas/Contact/Controllers/ContactController.cs
  10. 6
      Teknik/Areas/Error/Controllers/ErrorController.cs
  11. 1
      Teknik/Areas/FAQ/Controllers/FAQController.cs
  12. 1
      Teknik/Areas/Help/Controllers/HelpController.cs
  13. 1
      Teknik/Areas/Home/Controllers/HomeController.cs
  14. 5
      Teknik/Areas/Paste/Controllers/PasteController.cs
  15. 3
      Teknik/Areas/Podcast/Controllers/PodcastController.cs
  16. 1
      Teknik/Areas/Privacy/Controllers/PrivacyController.cs
  17. 3
      Teknik/Areas/RSS/Controllers/RSSController.cs
  18. 2
      Teknik/Areas/Shortener/Controllers/ShortenerController.cs
  19. 1
      Teknik/Areas/Stats/Controllers/StatsController.cs
  20. 1
      Teknik/Areas/TOS/Controllers/TOSController.cs
  21. 3
      Teknik/Areas/Upload/Controllers/UploadController.cs
  22. 23
      Teknik/Areas/User/Controllers/UserController.cs
  23. 4
      Teknik/Areas/Vault/Controllers/VaultController.cs
  24. 3
      Teknik/Controllers/DefaultController.cs
  25. 4
      Teknik/Startup.cs
  26. 8
      Tracking/Tracking.csproj
  27. BIN
      Tracking/lib/Piwik.Tracker.dll

2
Teknik/Areas/API/V1/Controllers/AccountAPIv1Controller.cs

@ -8,6 +8,7 @@ using Microsoft.AspNetCore.Mvc; @@ -8,6 +8,7 @@ using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Teknik.Configuration;
using Teknik.Data;
using Teknik.Filters;
using Teknik.Logging;
namespace Teknik.Areas.API.V1.Controllers
@ -18,6 +19,7 @@ namespace Teknik.Areas.API.V1.Controllers @@ -18,6 +19,7 @@ namespace Teknik.Areas.API.V1.Controllers
public AccountAPIv1Controller(ILogger<Logger> logger, Config config, TeknikEntities dbContext) : base(logger, config, dbContext) { }
[HttpGet]
[ServiceFilter(typeof(TrackPageView))]
public IActionResult GetClaims()
{
return new JsonResult(from c in User.Claims select new { c.Type, c.Value });

2
Teknik/Areas/API/V1/Controllers/PasteAPIv1Controller.cs

@ -12,6 +12,7 @@ using Teknik.Areas.Users.Models; @@ -12,6 +12,7 @@ using Teknik.Areas.Users.Models;
using Teknik.Areas.Users.Utility;
using Teknik.Configuration;
using Teknik.Data;
using Teknik.Filters;
using Teknik.Logging;
using Teknik.Utilities;
@ -24,6 +25,7 @@ namespace Teknik.Areas.API.V1.Controllers @@ -24,6 +25,7 @@ namespace Teknik.Areas.API.V1.Controllers
[HttpPost]
[AllowAnonymous]
[ServiceFilter(typeof(TrackPageView))]
public IActionResult Paste(PasteAPIv1Model model)
{
try

2
Teknik/Areas/API/V1/Controllers/ShortenAPIv1Controller.cs

@ -13,6 +13,7 @@ using Teknik.Areas.Users.Models; @@ -13,6 +13,7 @@ using Teknik.Areas.Users.Models;
using Teknik.Areas.Users.Utility;
using Teknik.Configuration;
using Teknik.Data;
using Teknik.Filters;
using Teknik.Logging;
using Teknik.Utilities;
@ -25,6 +26,7 @@ namespace Teknik.Areas.API.V1.Controllers @@ -25,6 +26,7 @@ namespace Teknik.Areas.API.V1.Controllers
[HttpPost]
[AllowAnonymous]
[ServiceFilter(typeof(TrackPageView))]
public IActionResult Shorten(ShortenAPIv1Model model)
{
try

2
Teknik/Areas/API/V1/Controllers/UploadAPIv1Controller.cs

@ -17,6 +17,7 @@ using Teknik.Areas.Users.Models; @@ -17,6 +17,7 @@ using Teknik.Areas.Users.Models;
using Teknik.Areas.Users.Utility;
using Teknik.Configuration;
using Teknik.Data;
using Teknik.Filters;
using Teknik.Logging;
using Teknik.Utilities;
@ -29,6 +30,7 @@ namespace Teknik.Areas.API.V1.Controllers @@ -29,6 +30,7 @@ namespace Teknik.Areas.API.V1.Controllers
[HttpPost]
[AllowAnonymous]
[ServiceFilter(typeof(TrackPageView))]
public async Task<IActionResult> Upload(UploadAPIv1Model model)
{
try

1
Teknik/Areas/About/Controllers/AboutController.cs

@ -22,6 +22,7 @@ namespace Teknik.Areas.About.Controllers @@ -22,6 +22,7 @@ namespace Teknik.Areas.About.Controllers
public AboutController(ILogger<Logger> logger, Config config, TeknikEntities dbContext) : base(logger, config, dbContext) { }
[AllowAnonymous]
[ServiceFilter(typeof(TrackPageView))]
public IActionResult Index([FromServices] Config config)
{
ViewBag.Title = "About";

1
Teknik/Areas/Abuse/Controllers/AbuseController.cs

@ -22,6 +22,7 @@ namespace Teknik.Areas.Abuse.Controllers @@ -22,6 +22,7 @@ namespace Teknik.Areas.Abuse.Controllers
public AbuseController(ILogger<Logger> logger, Config config, TeknikEntities dbContext) : base(logger, config, dbContext) { }
[AllowAnonymous]
[ServiceFilter(typeof(TrackPageView))]
public IActionResult Index()
{
ViewBag.Title = "Abuse Reporting";

4
Teknik/Areas/Admin/Controllers/AdminController.cs

@ -29,6 +29,7 @@ namespace Teknik.Areas.Admin.Controllers @@ -29,6 +29,7 @@ namespace Teknik.Areas.Admin.Controllers
public AdminController(ILogger<Logger> logger, Config config, TeknikEntities dbContext) : base (logger, config, dbContext) { }
[HttpGet]
[ServiceFilter(typeof(TrackPageView))]
public IActionResult Dashboard()
{
DashboardViewModel model = new DashboardViewModel();
@ -36,6 +37,7 @@ namespace Teknik.Areas.Admin.Controllers @@ -36,6 +37,7 @@ namespace Teknik.Areas.Admin.Controllers
}
[HttpGet]
[ServiceFilter(typeof(TrackPageView))]
public IActionResult UserSearch()
{
UserSearchViewModel model = new UserSearchViewModel();
@ -43,6 +45,7 @@ namespace Teknik.Areas.Admin.Controllers @@ -43,6 +45,7 @@ namespace Teknik.Areas.Admin.Controllers
}
[HttpGet]
[ServiceFilter(typeof(TrackPageView))]
public async Task<IActionResult> UserInfo(string username)
{
if (UserHelper.UserExists(_dbContext, username))
@ -63,6 +66,7 @@ namespace Teknik.Areas.Admin.Controllers @@ -63,6 +66,7 @@ namespace Teknik.Areas.Admin.Controllers
}
[HttpGet]
[ServiceFilter(typeof(TrackPageView))]
public IActionResult UploadSearch()
{
UploadSearchViewModel model = new UploadSearchViewModel();

6
Teknik/Areas/Blog/Controllers/BlogController.cs

@ -30,6 +30,7 @@ namespace Teknik.Areas.Blog.Controllers @@ -30,6 +30,7 @@ namespace Teknik.Areas.Blog.Controllers
public BlogController(ILogger<Logger> logger, Config config, TeknikEntities dbContext) : base(logger, config, dbContext) { }
[AllowAnonymous]
[ServiceFilter(typeof(TrackPageView))]
public IActionResult Blog(string username)
{
BlogViewModel model = new BlogViewModel();
@ -119,6 +120,7 @@ namespace Teknik.Areas.Blog.Controllers @@ -119,6 +120,7 @@ namespace Teknik.Areas.Blog.Controllers
#region Posts
[AllowAnonymous]
[ServiceFilter(typeof(TrackPageView))]
public IActionResult Post(string username, int id)
{
if (string.IsNullOrEmpty(username))
@ -160,7 +162,8 @@ namespace Teknik.Areas.Blog.Controllers @@ -160,7 +162,8 @@ namespace Teknik.Areas.Blog.Controllers
model.ErrorMessage = "Blog Post does not exist.";
return View("~/Areas/Blog/Views/Blog/ViewPost.cshtml", model);
}
[ServiceFilter(typeof(TrackPageView))]
public IActionResult NewPost(string username, int blogID)
{
if (string.IsNullOrEmpty(username))
@ -200,6 +203,7 @@ namespace Teknik.Areas.Blog.Controllers @@ -200,6 +203,7 @@ namespace Teknik.Areas.Blog.Controllers
return View("~/Areas/Blog/Views/Blog/Blog.cshtml", model);
}
[ServiceFilter(typeof(TrackPageView))]
public IActionResult EditPost(string username, int id)
{
if (string.IsNullOrEmpty(username))

1
Teknik/Areas/Contact/Controllers/ContactController.cs

@ -26,6 +26,7 @@ namespace Teknik.Areas.Contact.Controllers @@ -26,6 +26,7 @@ namespace Teknik.Areas.Contact.Controllers
public ContactController(ILogger<Logger> logger, Config config, TeknikEntities dbContext) : base(logger, config, dbContext) { }
[AllowAnonymous]
[ServiceFilter(typeof(TrackPageView))]
public IActionResult Index()
{
ViewBag.Title = "Contact Us";

6
Teknik/Areas/Error/Controllers/ErrorController.cs

@ -28,6 +28,7 @@ namespace Teknik.Areas.Error.Controllers @@ -28,6 +28,7 @@ namespace Teknik.Areas.Error.Controllers
public ErrorController(ILogger<Logger> logger, Config config, TeknikEntities dbContext) : base(logger, config, dbContext) { }
[AllowAnonymous]
[ServiceFilter(typeof(TrackPageView))]
public IActionResult HttpError(int statusCode)
{
switch (statusCode)
@ -44,6 +45,7 @@ namespace Teknik.Areas.Error.Controllers @@ -44,6 +45,7 @@ namespace Teknik.Areas.Error.Controllers
}
[AllowAnonymous]
[ServiceFilter(typeof(TrackPageView))]
public IActionResult HttpGeneral(int statusCode)
{
ViewBag.Title = statusCode;
@ -57,6 +59,7 @@ namespace Teknik.Areas.Error.Controllers @@ -57,6 +59,7 @@ namespace Teknik.Areas.Error.Controllers
}
[AllowAnonymous]
[ServiceFilter(typeof(TrackPageView))]
public IActionResult Http401()
{
Response.StatusCode = StatusCodes.Status401Unauthorized;
@ -73,6 +76,7 @@ namespace Teknik.Areas.Error.Controllers @@ -73,6 +76,7 @@ namespace Teknik.Areas.Error.Controllers
}
[AllowAnonymous]
[ServiceFilter(typeof(TrackPageView))]
public IActionResult Http403()
{
Response.StatusCode = StatusCodes.Status403Forbidden;
@ -89,6 +93,7 @@ namespace Teknik.Areas.Error.Controllers @@ -89,6 +93,7 @@ namespace Teknik.Areas.Error.Controllers
}
[AllowAnonymous]
[ServiceFilter(typeof(TrackPageView))]
public IActionResult Http404()
{
Response.StatusCode = StatusCodes.Status404NotFound;
@ -105,6 +110,7 @@ namespace Teknik.Areas.Error.Controllers @@ -105,6 +110,7 @@ namespace Teknik.Areas.Error.Controllers
}
[AllowAnonymous]
[ServiceFilter(typeof(TrackPageView))]
public IActionResult Http500(Exception exception)
{
try

1
Teknik/Areas/FAQ/Controllers/FAQController.cs

@ -18,6 +18,7 @@ namespace Teknik.Areas.FAQ.Controllers @@ -18,6 +18,7 @@ namespace Teknik.Areas.FAQ.Controllers
public FAQController(ILogger<Logger> logger, Config config, TeknikEntities dbContext) : base(logger, config, dbContext) { }
[AllowAnonymous]
[ServiceFilter(typeof(TrackPageView))]
public IActionResult Index()
{
ViewBag.Title = "Frequently Asked Questions";

1
Teknik/Areas/Help/Controllers/HelpController.cs

@ -14,6 +14,7 @@ namespace Teknik.Areas.Help.Controllers @@ -14,6 +14,7 @@ namespace Teknik.Areas.Help.Controllers
{
[Authorize]
[Area("Help")]
[ServiceFilter(typeof(TrackPageView))]
public class HelpController : DefaultController
{
public HelpController(ILogger<Logger> logger, Config config, TeknikEntities dbContext) : base(logger, config, dbContext) { }

1
Teknik/Areas/Home/Controllers/HomeController.cs

@ -23,6 +23,7 @@ namespace Teknik.Areas.Home.Controllers @@ -23,6 +23,7 @@ namespace Teknik.Areas.Home.Controllers
public HomeController(ILogger<Logger> logger, Config config, TeknikEntities dbContext) : base(logger, config, dbContext) { }
[AllowAnonymous]
[ServiceFilter(typeof(TrackPageView))]
public IActionResult Index()
{
HomeViewModel model = new HomeViewModel();

5
Teknik/Areas/Paste/Controllers/PasteController.cs

@ -31,6 +31,7 @@ namespace Teknik.Areas.Paste.Controllers @@ -31,6 +31,7 @@ namespace Teknik.Areas.Paste.Controllers
public PasteController(ILogger<Logger> logger, Config config, TeknikEntities dbContext) : base(logger, config, dbContext) { }
[AllowAnonymous]
[ServiceFilter(typeof(TrackPageView))]
public IActionResult Index()
{
ViewBag.Title = "Pastebin";
@ -40,6 +41,7 @@ namespace Teknik.Areas.Paste.Controllers @@ -40,6 +41,7 @@ namespace Teknik.Areas.Paste.Controllers
}
[AllowAnonymous]
[ServiceFilter(typeof(TrackPageView))]
public async Task<IActionResult> ViewPaste(string type, string url, string password)
{
Models.Paste paste = _dbContext.Pastes.Where(p => p.Url == url).FirstOrDefault();
@ -202,7 +204,8 @@ namespace Teknik.Areas.Paste.Controllers @@ -202,7 +204,8 @@ namespace Teknik.Areas.Paste.Controllers
}
return View("~/Areas/Paste/Views/Paste/Index.cshtml", model);
}
[ServiceFilter(typeof(TrackPageView))]
public async Task<IActionResult> Edit(string url, string password)
{
Models.Paste paste = _dbContext.Pastes.Where(p => p.Url == url).FirstOrDefault();

3
Teknik/Areas/Podcast/Controllers/PodcastController.cs

@ -29,6 +29,7 @@ namespace Teknik.Areas.Podcast.Controllers @@ -29,6 +29,7 @@ namespace Teknik.Areas.Podcast.Controllers
public PodcastController(ILogger<Logger> logger, Config config, TeknikEntities dbContext) : base(logger, config, dbContext) { }
[AllowAnonymous]
[ServiceFilter(typeof(TrackPageView))]
public IActionResult Index()
{
MainViewModel model = new MainViewModel();
@ -63,6 +64,7 @@ namespace Teknik.Areas.Podcast.Controllers @@ -63,6 +64,7 @@ namespace Teknik.Areas.Podcast.Controllers
#region Podcasts
[AllowAnonymous]
[ServiceFilter(typeof(TrackPageView))]
public IActionResult View(int episode)
{
PodcastViewModel model = new PodcastViewModel();
@ -84,6 +86,7 @@ namespace Teknik.Areas.Podcast.Controllers @@ -84,6 +86,7 @@ namespace Teknik.Areas.Podcast.Controllers
[HttpGet]
[AllowAnonymous]
[ResponseCache(Duration = 31536000, Location = ResponseCacheLocation.Any)]
[ServiceFilter(typeof(TrackDownload))]
public IActionResult Download(int episode, string fileName)
{
string path = string.Empty;

1
Teknik/Areas/Privacy/Controllers/PrivacyController.cs

@ -18,6 +18,7 @@ namespace Teknik.Areas.Privacy.Controllers @@ -18,6 +18,7 @@ namespace Teknik.Areas.Privacy.Controllers
public PrivacyController(ILogger<Logger> logger, Config config, TeknikEntities dbContext) : base(logger, config, dbContext) { }
[AllowAnonymous]
[ServiceFilter(typeof(TrackPageView))]
public IActionResult Index()
{
ViewBag.Title = "Privacy Policy";

3
Teknik/Areas/RSS/Controllers/RSSController.cs

@ -32,6 +32,7 @@ namespace Teknik.Areas.RSS.Controllers @@ -32,6 +32,7 @@ namespace Teknik.Areas.RSS.Controllers
public RSSController(ILogger<Logger> logger, Config config, TeknikEntities dbContext) : base(logger, config, dbContext) { }
[AllowAnonymous]
[ServiceFilter(typeof(TrackPageView))]
public async Task Index()
{
Response.ContentType = "application/rss+xml";
@ -49,6 +50,7 @@ namespace Teknik.Areas.RSS.Controllers @@ -49,6 +50,7 @@ namespace Teknik.Areas.RSS.Controllers
}
[AllowAnonymous]
[ServiceFilter(typeof(TrackPageView))]
public async Task Blog(string username)
{
Response.ContentType = "application/rss+xml";
@ -154,6 +156,7 @@ namespace Teknik.Areas.RSS.Controllers @@ -154,6 +156,7 @@ namespace Teknik.Areas.RSS.Controllers
}
[AllowAnonymous]
[ServiceFilter(typeof(TrackPageView))]
public async Task Podcast()
{
Response.ContentType = "application/rss+xml";

2
Teknik/Areas/Shortener/Controllers/ShortenerController.cs

@ -24,6 +24,7 @@ namespace Teknik.Areas.Shortener.Controllers @@ -24,6 +24,7 @@ namespace Teknik.Areas.Shortener.Controllers
public ShortenerController(ILogger<Logger> logger, Config config, TeknikEntities dbContext) : base(logger, config, dbContext) { }
[AllowAnonymous]
[ServiceFilter(typeof(TrackPageView))]
public IActionResult Index()
{
ViewBag.Title = "Url Shortener";
@ -32,6 +33,7 @@ namespace Teknik.Areas.Shortener.Controllers @@ -32,6 +33,7 @@ namespace Teknik.Areas.Shortener.Controllers
}
[AllowAnonymous]
[ServiceFilter(typeof(TrackPageView))]
public IActionResult RedirectToUrl(string url)
{
ShortenedUrl shortUrl = _dbContext.ShortenedUrls.Where(s => s.ShortUrl == url).FirstOrDefault();

1
Teknik/Areas/Stats/Controllers/StatsController.cs

@ -24,6 +24,7 @@ namespace Teknik.Areas.Stats.Controllers @@ -24,6 +24,7 @@ namespace Teknik.Areas.Stats.Controllers
public StatsController(ILogger<Logger> logger, Config config, TeknikEntities dbContext) : base(logger, config, dbContext) { }
[AllowAnonymous]
[ServiceFilter(typeof(TrackPageView))]
public IActionResult Index()
{
ViewBag.Title = "System Statistics";

1
Teknik/Areas/TOS/Controllers/TOSController.cs

@ -18,6 +18,7 @@ namespace Teknik.Areas.TOS.Controllers @@ -18,6 +18,7 @@ namespace Teknik.Areas.TOS.Controllers
public TOSController(ILogger<Logger> logger, Config config, TeknikEntities dbContext) : base(logger, config, dbContext) { }
[AllowAnonymous]
[ServiceFilter(typeof(TrackPageView))]
public IActionResult Index()
{
ViewBag.Title = "Terms of Service";

3
Teknik/Areas/Upload/Controllers/UploadController.cs

@ -33,6 +33,7 @@ namespace Teknik.Areas.Upload.Controllers @@ -33,6 +33,7 @@ namespace Teknik.Areas.Upload.Controllers
[HttpGet]
[AllowAnonymous]
[ServiceFilter(typeof(TrackPageView))]
public async Task<IActionResult> Index()
{
ViewBag.Title = "Upload Files";
@ -180,6 +181,8 @@ namespace Teknik.Areas.Upload.Controllers @@ -180,6 +181,8 @@ namespace Teknik.Areas.Upload.Controllers
[HttpGet]
[AllowAnonymous]
[ServiceFilter(typeof(TrackDownload))]
[ServiceFilter(typeof(TrackPageView))]
[ResponseCache(Duration = 31536000, Location = ResponseCacheLocation.Any)]
public async Task<IActionResult> Download(string file)
{

23
Teknik/Areas/User/Controllers/UserController.cs

@ -62,6 +62,7 @@ namespace Teknik.Areas.Users.Controllers @@ -62,6 +62,7 @@ namespace Teknik.Areas.Users.Controllers
}
[HttpGet]
[ServiceFilter(typeof(TrackPageView))]
public IActionResult Login(string returnUrl)
{
// Let's double check their email and git accounts to make sure they exist
@ -85,6 +86,7 @@ namespace Teknik.Areas.Users.Controllers @@ -85,6 +86,7 @@ namespace Teknik.Areas.Users.Controllers
}
[HttpGet]
[ServiceFilter(typeof(TrackPageView))]
public async Task Logout()
{
// these are the sub & sid to signout
@ -98,6 +100,7 @@ namespace Teknik.Areas.Users.Controllers @@ -98,6 +100,7 @@ namespace Teknik.Areas.Users.Controllers
}
[AllowAnonymous]
[ServiceFilter(typeof(TrackPageView))]
public IActionResult GetPremium()
{
ViewBag.Title = "Get a Premium Account";
@ -109,6 +112,7 @@ namespace Teknik.Areas.Users.Controllers @@ -109,6 +112,7 @@ namespace Teknik.Areas.Users.Controllers
[HttpGet]
[AllowAnonymous]
[ServiceFilter(typeof(TrackPageView))]
public IActionResult Register(string inviteCode, string ReturnUrl)
{
RegisterViewModel model = new RegisterViewModel();
@ -202,6 +206,7 @@ namespace Teknik.Areas.Users.Controllers @@ -202,6 +206,7 @@ namespace Teknik.Areas.Users.Controllers
// GET: Profile/Profile
[AllowAnonymous]
[ServiceFilter(typeof(TrackPageView))]
public async Task<IActionResult> ViewProfile(string username)
{
if (string.IsNullOrEmpty(username))
@ -259,6 +264,7 @@ namespace Teknik.Areas.Users.Controllers @@ -259,6 +264,7 @@ namespace Teknik.Areas.Users.Controllers
return View(model);
}
[ServiceFilter(typeof(TrackPageView))]
public IActionResult ViewServiceData()
{
string username = User.Identity.Name;
@ -297,11 +303,13 @@ namespace Teknik.Areas.Users.Controllers @@ -297,11 +303,13 @@ namespace Teknik.Areas.Users.Controllers
return View(model);
}
[ServiceFilter(typeof(TrackPageView))]
public IActionResult Settings()
{
return Redirect(Url.SubRouteUrl("account", "User.ProfileSettings"));
}
[ServiceFilter(typeof(TrackPageView))]
public IActionResult ProfileSettings()
{
string username = User.Identity.Name;
@ -326,6 +334,7 @@ namespace Teknik.Areas.Users.Controllers @@ -326,6 +334,7 @@ namespace Teknik.Areas.Users.Controllers
return new StatusCodeResult(StatusCodes.Status403Forbidden);
}
[ServiceFilter(typeof(TrackPageView))]
public IActionResult AccountSettings()
{
string username = User.Identity.Name;
@ -347,6 +356,7 @@ namespace Teknik.Areas.Users.Controllers @@ -347,6 +356,7 @@ namespace Teknik.Areas.Users.Controllers
return new StatusCodeResult(StatusCodes.Status403Forbidden);
}
[ServiceFilter(typeof(TrackPageView))]
public async Task<IActionResult> SecuritySettings()
{
string username = User.Identity.Name;
@ -389,6 +399,7 @@ namespace Teknik.Areas.Users.Controllers @@ -389,6 +399,7 @@ namespace Teknik.Areas.Users.Controllers
return new StatusCodeResult(StatusCodes.Status403Forbidden);
}
[ServiceFilter(typeof(TrackPageView))]
public async Task<IActionResult> DeveloperSettings()
{
string username = User.Identity.Name;
@ -436,6 +447,7 @@ namespace Teknik.Areas.Users.Controllers @@ -436,6 +447,7 @@ namespace Teknik.Areas.Users.Controllers
return new StatusCodeResult(StatusCodes.Status403Forbidden);
}
[ServiceFilter(typeof(TrackPageView))]
public IActionResult InviteSettings()
{
string username = User.Identity.Name;
@ -480,7 +492,8 @@ namespace Teknik.Areas.Users.Controllers @@ -480,7 +492,8 @@ namespace Teknik.Areas.Users.Controllers
return new StatusCodeResult(StatusCodes.Status403Forbidden);
}
[ServiceFilter(typeof(TrackPageView))]
public IActionResult BlogSettings()
{
string username = User.Identity.Name;
@ -503,7 +516,8 @@ namespace Teknik.Areas.Users.Controllers @@ -503,7 +516,8 @@ namespace Teknik.Areas.Users.Controllers
return new StatusCodeResult(StatusCodes.Status403Forbidden);
}
[ServiceFilter(typeof(TrackPageView))]
public IActionResult UploadSettings()
{
string username = User.Identity.Name;
@ -530,6 +544,7 @@ namespace Teknik.Areas.Users.Controllers @@ -530,6 +544,7 @@ namespace Teknik.Areas.Users.Controllers
[HttpGet]
[AllowAnonymous]
[ServiceFilter(typeof(TrackPageView))]
public async Task<IActionResult> ViewRawPGP(string username)
{
ViewBag.Title = username + "'s Public Key";
@ -824,6 +839,7 @@ namespace Teknik.Areas.Users.Controllers @@ -824,6 +839,7 @@ namespace Teknik.Areas.Users.Controllers
[HttpGet]
[AllowAnonymous]
[ServiceFilter(typeof(TrackPageView))]
public IActionResult ResetPassword(string username)
{
ResetPasswordViewModel model = new ResetPasswordViewModel();
@ -867,6 +883,7 @@ namespace Teknik.Areas.Users.Controllers @@ -867,6 +883,7 @@ namespace Teknik.Areas.Users.Controllers
[HttpGet]
[AllowAnonymous]
[ServiceFilter(typeof(TrackPageView))]
public async Task<IActionResult> VerifyResetPassword(string username, string code)
{
bool verified = true;

4
Teknik/Areas/Vault/Controllers/VaultController.cs

@ -34,6 +34,7 @@ namespace Teknik.Areas.Vault.Controllers @@ -34,6 +34,7 @@ namespace Teknik.Areas.Vault.Controllers
public VaultController(ILogger<Logger> logger, Config config, TeknikEntities dbContext) : base(logger, config, dbContext) { }
[AllowAnonymous]
[ServiceFilter(typeof(TrackPageView))]
public async Task<IActionResult> ViewVault(string id)
{
Models.Vault foundVault = _dbContext.Vaults.Where(v => v.Url == id).FirstOrDefault();
@ -135,6 +136,7 @@ namespace Teknik.Areas.Vault.Controllers @@ -135,6 +136,7 @@ namespace Teknik.Areas.Vault.Controllers
[HttpGet]
[AllowAnonymous]
[ServiceFilter(typeof(TrackPageView))]
public IActionResult NewVault()
{
ViewBag.Title = "Create Vault";
@ -145,6 +147,7 @@ namespace Teknik.Areas.Vault.Controllers @@ -145,6 +147,7 @@ namespace Teknik.Areas.Vault.Controllers
[HttpGet]
[AllowAnonymous]
[ServiceFilter(typeof(TrackPageView))]
public IActionResult NewVaultFromService(string type, string items)
{
ViewBag.Title = "Create Vault";
@ -181,6 +184,7 @@ namespace Teknik.Areas.Vault.Controllers @@ -181,6 +184,7 @@ namespace Teknik.Areas.Vault.Controllers
}
[HttpGet]
[ServiceFilter(typeof(TrackPageView))]
public IActionResult EditVault(string url, string type, string items)
{
ViewBag.Title = "Edit Vault";

3
Teknik/Controllers/DefaultController.cs

@ -24,8 +24,9 @@ using Teknik.Utilities; @@ -24,8 +24,9 @@ using Teknik.Utilities;
namespace Teknik.Controllers
{
[CORSActionFilter]
[Area("Default")]
[CORSActionFilter]
[ResponseCache(Duration = 3600, Location = ResponseCacheLocation.Any)]
public class DefaultController : Controller
{
protected string Subdomain

4
Teknik/Startup.cs

@ -97,9 +97,9 @@ namespace Teknik @@ -97,9 +97,9 @@ namespace Teknik
});
// Add Tracking Filter scopes
//services.AddScoped<TrackDownload>();
services.AddScoped<TrackDownload>();
//services.AddScoped<TrackLink>();
//services.AddScoped<TrackPageView>();
services.AddScoped<TrackPageView>();
// Create the Database Context
services.AddDbContext<TeknikEntities>(options => options

8
Tracking/Tracking.csproj

@ -7,13 +7,17 @@ @@ -7,13 +7,17 @@
<RuntimeIdentifiers>win-x86;win-x64;linux-x64;linux-arm;osx-x64</RuntimeIdentifiers>
</PropertyGroup>
<ItemGroup>
<None Remove="lib\Piwik.Tracker.NetStandard1.4.dll" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Configuration\Configuration.csproj" />
</ItemGroup>
<ItemGroup>
<Reference Include="Piwik.Tracker.NetStandard1.4">
<HintPath>lib\Piwik.Tracker.NetStandard1.4.dll</HintPath>
<Reference Include="Piwik.Tracker">
<HintPath>lib\Piwik.Tracker.dll</HintPath>
</Reference>
</ItemGroup>

BIN
Tracking/lib/Piwik.Tracker.dll

Binary file not shown.
Loading…
Cancel
Save