Browse Source

- Created custom IPrincipal for the user session to include all the user information.

- Added FAQ page with commonly asked questions.
- Added separate config options for each tier of max upload size.
- Updated help to point to the new pages.
tags/2.0.6
Teknikode 3 years ago
parent
commit
da3d923ab7
48 changed files with 616 additions and 66 deletions
  1. 1
    1
      Teknik/Areas/API/Views/web.config
  2. 8
    7
      Teknik/Areas/About/Views/About/Index.cshtml
  3. 1
    1
      Teknik/Areas/About/Views/web.config
  4. 1
    1
      Teknik/Areas/Admin/Views/web.config
  5. 1
    1
      Teknik/Areas/Blog/Views/web.config
  6. 1
    1
      Teknik/Areas/Contact/Views/web.config
  7. 1
    1
      Teknik/Areas/Dev/Views/web.config
  8. 1
    1
      Teknik/Areas/Error/Views/web.config
  9. 4
    0
      Teknik/Areas/FAQ/Content/FAQ.css
  10. 25
    0
      Teknik/Areas/FAQ/Controllers/FAQController.cs
  11. 36
    0
      Teknik/Areas/FAQ/FAQAreaRegistration.cs
  12. 12
    0
      Teknik/Areas/FAQ/ViewModels/FAQViewModel.cs
  13. 181
    0
      Teknik/Areas/FAQ/Views/FAQ/Index.cshtml
  14. 3
    0
      Teknik/Areas/FAQ/Views/_ViewStart.cshtml
  15. 36
    0
      Teknik/Areas/FAQ/Views/web.config
  16. 4
    2
      Teknik/Areas/Help/Views/Help/Index.cshtml
  17. 41
    2
      Teknik/Areas/Help/Views/Help/Mail.cshtml
  18. 1
    1
      Teknik/Areas/Help/Views/web.config
  19. 1
    1
      Teknik/Areas/Home/Views/web.config
  20. 1
    1
      Teknik/Areas/Paste/Views/web.config
  21. 1
    1
      Teknik/Areas/Podcast/Views/web.config
  22. 1
    1
      Teknik/Areas/Privacy/Views/web.config
  23. 1
    1
      Teknik/Areas/Shortener/Views/web.config
  24. 67
    1
      Teknik/Areas/Status/Scripts/Status.js
  25. 1
    1
      Teknik/Areas/Status/Views/web.config
  26. 1
    1
      Teknik/Areas/Stream/Views/web.config
  27. 1
    1
      Teknik/Areas/TOS/Views/web.config
  28. 14
    2
      Teknik/Areas/Upload/Views/Upload/Index.cshtml
  29. 1
    1
      Teknik/Areas/Upload/Views/web.config
  30. 4
    0
      Teknik/Areas/User/Models/User.cs
  31. 1
    1
      Teknik/Areas/User/Views/web.config
  32. 1
    1
      Teknik/Areas/Vault/Views/web.config
  33. 25
    0
      Teknik/BaseViewPage.cs
  34. 5
    0
      Teknik/Controllers/DefaultController.cs
  35. 2
    24
      Teknik/Global.asax.cs
  36. 14
    0
      Teknik/Security/ITeknikPrincipal.cs
  37. 62
    0
      Teknik/Security/TeknikPrincipal.cs
  38. 1
    0
      Teknik/Startup.cs
  39. 12
    0
      Teknik/Teknik.csproj
  40. 1
    1
      Teknik/Views/Shared/_Footer.cshtml
  41. 1
    1
      Teknik/Views/Web.config
  42. 0
    5
      Utilities/Configuration/Config.cs
  43. 0
    2
      Utilities/Configuration/DatabaseConfig.cs
  44. 6
    0
      Utilities/Configuration/UploadConfig.cs
  45. 5
    0
      Utilities/Configuration/UserConfig.cs
  46. 14
    0
      Utilities/Utilities/AccountType.cs
  47. 12
    0
      Utilities/Utilities/EntityExtensions.cs
  48. 2
    0
      Utilities/Utilities/Utilities.csproj

+ 1
- 1
Teknik/Areas/API/Views/web.config View File

@@ -10,7 +10,7 @@

<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<pages pageBaseType="System.Web.Mvc.WebViewPage">
<pages pageBaseType="Teknik.BaseViewPage">
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />

+ 8
- 7
Teknik/Areas/About/Views/About/Index.cshtml View File

@@ -16,10 +16,11 @@
Teknik was created to provide our users free services that they can trust. All of our services are treated with the utmost care to provide you with the best experience possible, and the best security with your data that we can give.
</p>
<p>
You can view our complete activity and statistics by visiting the <a href="@Url.SubRouteUrl("transparency", "Transparency.Index")">Transparency</a> page.
You can view our complete activity and statistics by visiting the <a href="@Url.SubRouteUrl("status", "Status.Index")">status</a> page.
</p>
<br />
<hr>
<h2 class="text-center">Comparison of Features</h2>
<h2 class="text-center">What can you do with Teknik?</h2>
<br />
<div class="row">
<div class="col-sm-10 col-sm-offset-1">
@@ -33,8 +34,8 @@
</tr>
<!-- Prices -->
<tr>
<td class="text-left"><b>Features</b></td>
<td class="text-center">$5 Donation</td>
<td class="text-left"></td>
<td class="text-center">$@Model.Config.UserConfig.PremiumAccountPrice @Model.Config.UserConfig.PaymentType</td>
<td class="text-center">Free</td>
<td class="text-center">Free</td>
</tr>
@@ -112,8 +113,8 @@
</tr>
<tr>
<td class="text-left">Max Upload Filesize</td>
<td class="text-center">@StringHelper.GetBytesReadable(Model.Config.UploadConfig.MaxUploadSize * 2)</td>
<td class="text-center">@StringHelper.GetBytesReadable(Model.Config.UploadConfig.MaxUploadSize)</td>
<td class="text-center">@StringHelper.GetBytesReadable(Model.Config.UploadConfig.MaxUploadSizePremium)</td>
<td class="text-center">@StringHelper.GetBytesReadable(Model.Config.UploadConfig.MaxUploadSizeBasic)</td>
<td class="text-center">@StringHelper.GetBytesReadable(Model.Config.UploadConfig.MaxUploadSize)</td>
</tr>
<tr>
@@ -166,7 +167,7 @@
</p>
</div>
</div>
<br />
<hr>
<h2 class="text-center">How can I help?</h2>
<br />

+ 1
- 1
Teknik/Areas/About/Views/web.config View File

@@ -10,7 +10,7 @@

<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<pages pageBaseType="System.Web.Mvc.WebViewPage">
<pages pageBaseType="Teknik.BaseViewPage">
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />

+ 1
- 1
Teknik/Areas/Admin/Views/web.config View File

@@ -10,7 +10,7 @@

<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<pages pageBaseType="System.Web.Mvc.WebViewPage">
<pages pageBaseType="Teknik.BaseViewPage">
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />

+ 1
- 1
Teknik/Areas/Blog/Views/web.config View File

@@ -10,7 +10,7 @@

<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<pages pageBaseType="System.Web.Mvc.WebViewPage">
<pages pageBaseType="Teknik.BaseViewPage">
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />

+ 1
- 1
Teknik/Areas/Contact/Views/web.config View File

@@ -10,7 +10,7 @@

<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<pages pageBaseType="System.Web.Mvc.WebViewPage">
<pages pageBaseType="Teknik.BaseViewPage">
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />

+ 1
- 1
Teknik/Areas/Dev/Views/web.config View File

@@ -10,7 +10,7 @@

<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<pages pageBaseType="System.Web.Mvc.WebViewPage">
<pages pageBaseType="Teknik.BaseViewPage">
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />

+ 1
- 1
Teknik/Areas/Error/Views/web.config View File

@@ -10,7 +10,7 @@

<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<pages pageBaseType="System.Web.Mvc.WebViewPage">
<pages pageBaseType="Teknik.BaseViewPage">
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />

+ 4
- 0
Teknik/Areas/FAQ/Content/FAQ.css View File

@@ -0,0 +1,4 @@
.faqHeader {
font-size: 27px;
margin: 20px;
}

+ 25
- 0
Teknik/Areas/FAQ/Controllers/FAQController.cs View File

@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Teknik.Areas.FAQ.ViewModels;
using Teknik.Attributes;
using Teknik.Controllers;
using Teknik.Filters;

namespace Teknik.Areas.FAQ.Controllers
{
[TeknikAuthorize]
public class FAQController : DefaultController
{
[TrackPageView]
[AllowAnonymous]
public ActionResult Index()
{
ViewBag.Title = "Frequently Asked Questions - " + Config.Title;
FAQViewModel model = new FAQViewModel();
return View(model);
}
}
}

+ 36
- 0
Teknik/Areas/FAQ/FAQAreaRegistration.cs View File

@@ -0,0 +1,36 @@
using System.Collections.Generic;
using System.Web.Mvc;
using System.Web.Optimization;
using Teknik.Configuration;
using Teknik.Utilities;

namespace Teknik.Areas.FAQ
{
public class FAQAreaRegistration : AreaRegistration
{
public override string AreaName
{
get
{
return "FAQ";
}
}

public override void RegisterArea(AreaRegistrationContext context)
{
Config config = Config.Load();
context.MapSubdomainRoute(
"FAQ.Index", // Route name
new List<string>() { "faq" },
new List<string>() { config.Host },
"", // URL with parameters
new { controller = "FAQ", action = "Index" }, // Parameter defaults
new[] { typeof(Controllers.FAQController).Namespace }
);

// Register Style Bundle
BundleTable.Bundles.Add(new CdnStyleBundle("~/Content/faq", config.CdnHost).Include(
"~/Areas/FAQ/Content/FAQ.css"));
}
}
}

+ 12
- 0
Teknik/Areas/FAQ/ViewModels/FAQViewModel.cs View File

@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Teknik.ViewModels;

namespace Teknik.Areas.FAQ.ViewModels
{
public class FAQViewModel : ViewModelBase
{
}
}

+ 181
- 0
Teknik/Areas/FAQ/Views/FAQ/Index.cshtml View File

@@ -0,0 +1,181 @@
@model Teknik.Areas.FAQ.ViewModels.FAQViewModel

@using Teknik.Utilities

@Styles.Render("~/Content/faq")

<div class="container">
<div class="row">
<div class="col-sm-12">
<div class="panel-group" id="accordion" role="tablist">
<div class="faqHeader">General Questions</div>
<div class="panel panel-default">
<div class="panel-heading" role="tab">
<h4 class="panel-title">
<a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapse0">What does Teknik mean?</a>
</h4>
</div>
<div id="collapse0" class="panel-collapse collapse" role="tabpanel">
<div class="panel-body">
Teknik means <i>Technology</i> in swedish.
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading" role="tab">
<h4 class="panel-title">
<a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapse3">Why did you make Teknik?</a>
</h4>
</div>
<div id="collapse3" class="panel-collapse collapse" role="tabpanel">
<div class="panel-body">
I made Teknik originally as a page to showcase an IRC channel I was co-moderating. I began creating different services for the members of the channel, and it quickly grew and interest started to grow from outside the channel.
This led to changing Teknik to be an independent venture away from the IRC channel. As time went on I continued to add new features that I wanted to try out, and that users requested. Today I work on it as a passion project and want to keep providing services that people like to use.
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading" role="tab">
<h4 class="panel-title">
<a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapse2">How can I contact you?</a>
</h4>
</div>
<div id="collapse2" class="panel-collapse collapse" role="tabpanel">
<div class="panel-body">
You can contact us via the <a href="@Url.SubRouteUrl("contact", "Contact.Index")">Contact page</a> or email us at <a href="mailto:@Model.Config.SupportEmail">@Model.Config.SupportEmail</a>.
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading" role="tab">
<h4 class="panel-title">
<a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapse4">Can I view the source of Teknik?</a>
</h4>
</div>
<div id="collapse4" class="panel-collapse collapse" role="tabpanel">
<div class="panel-body">
You can view the source of Teknik as well as contribute by viewing our <a href="http://git.teknik.io/Teknikode/Teknik">git repository</a>.
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading" role="tab">
<h4 class="panel-title">
<a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapse1">Is Uncled1023 actually an uncle?</a>
</h4>
</div>
<div id="collapse1" class="panel-collapse collapse" role="tabpanel">
<div class="panel-body">
Yes :)
</div>
</div>
</div>
</div>
<div class="panel-group" id="accordion" role="tablist">
<div class="faqHeader">Accounts</div>
<div class="panel panel-default">
<div class="panel-heading" role="tab">
<h4 class="panel-title">
<a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapse100">Is account registration required?</a>
</h4>
</div>
<div id="collapse100" class="panel-collapse collapse" role="tabpanel">
<div class="panel-body">
Account registration is not required at <strong>Teknik</strong> for most of the free services. If you want to use any of the user specific features, you must register an account.
You can view more about what is available with and without an account on our <a href="@Url.SubRouteUrl("about", "About.Index")">About Page</a>.
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading" role="tab">
<h4 class="panel-title">
<a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapse101">How do I sign up for an account?</a>
</h4>
</div>
<div id="collapse101" class="panel-collapse collapse" role="tabpanel">
<div class="panel-body">
To sign up for an account, you just need to click the <strong>Sign Up</strong> button on the top right of the navigation panel, or visit the <a href="@Url.SubRouteUrl("user", "User.Register")">Registration Page</a>.
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading" role="tab">
<h4 class="panel-title">
<a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapse102">How do I purchase a Premium Account?</a>
</h4>
</div>
<div id="collapse102" class="panel-collapse collapse" role="tabpanel">
<div class="panel-body">
To purchase a premium account, you can navigate to the <a href="@Url.SubRouteUrl("user", "User.PurchasePremium")">premium account</a> page and choose the method of payment and follow the instructions provided.
</div>
</div>
</div>
</div>
<div class="panel-group" id="accordion" role="tablist">
<div class="faqHeader">Uploads</div>
<div class="panel panel-default">
<div class="panel-heading" role="tab">
<h4 class="panel-title">
<a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapse200">What is the largest file size I can upload?</a>
</h4>
</div>
<div id="collapse200" class="panel-collapse collapse" role="tabpanel">
<div class="panel-body">
The max file size for everyone is <strong>@StringHelper.GetBytesReadable(Model.Config.UploadConfig.MaxUploadSize)</strong>, basic accounts are <strong>@StringHelper.GetBytesReadable(Model.Config.UploadConfig.MaxUploadSizeBasic)</strong>, and Premium accounts are <strong>@StringHelper.GetBytesReadable(Model.Config.UploadConfig.MaxUploadSizePremium)</strong>.
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading" role="tab">
<h4 class="panel-title">
<a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapse201">What files am I allowed to upload?</a>
</h4>
</div>
<div id="collapse201" class="panel-collapse collapse" role="tabpanel">
<div class="panel-body">
You are allowed to upload any file that you would like, except for a few exceptions. No Malware, or Copyright information is allowed. For a full look at what is allowed, view the upload section in the <a href="@Url.SubRouteUrl("tos", "TOS.Index")">Terms of Service</a>.
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading" role="tab">
<h4 class="panel-title">
<a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapse202">Can I delete a file I uploaded?</a>
</h4>
</div>
<div id="collapse202" class="panel-collapse collapse" role="tabpanel">
<div class="panel-body">
Every file has a deletion key generated when uploaded. When you are uploading a file, this key can be obtained by clicking the <strong>Deletion Link</strong> button for that upload. You can then navigate to the deletion link and the file will be deleted.
If you are logged in, you can also go to your profile page to view all your uploads, and delete them from there.
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading" role="tab">
<h4 class="panel-title">
<a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapse203">What does the option <strong>Encrypt in Browser</strong> mean?</a>
</h4>
</div>
<div id="collapse203" class="panel-collapse collapse" role="tabpanel">
<div class="panel-body">
When uploading a file, you have the option to encrypt the file using an <a href="https://en.wikipedia.org/wiki/Advanced_Encryption_Standard">AES-256 CTR</a> cipher via Javascript in your browser.
This generates a random key that is not transported to the server, and only available to you. To view files encrypted in the browser, you must supply this key as the anchor tag in the URL, or when prompted for it when viewing the download link for the file.
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading" role="tab">
<h4 class="panel-title">
<a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapse204">My file is returning a 404 - Not Found, but I didn't delete it. Where is it?</a>
</h4>
</div>
<div id="collapse204" class="panel-collapse collapse" role="tabpanel">
<div class="panel-body">
If an upload is returning a 404 error, this could mean that the upload was deleted due to being scanned and flagged as malware by the automated system, or had a valid DMCA served against it.
</div>
</div>
</div>
</div>
</div>
</div>
</div>

+ 3
- 0
Teknik/Areas/FAQ/Views/_ViewStart.cshtml View File

@@ -0,0 +1,3 @@
@{
Layout = "~/Views/Shared/_Layout.cshtml";
}

+ 36
- 0
Teknik/Areas/FAQ/Views/web.config View File

@@ -0,0 +1,36 @@
<?xml version="1.0"?>

<configuration>
<configSections>
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
</sectionGroup>
</configSections>

<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<pages pageBaseType="Teknik.BaseViewPage">
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Routing" />
<add namespace="System.Web.Optimization" />
<add namespace="Teknik" />
</namespaces>
</pages>
</system.web.webPages.razor>

<appSettings>
<add key="webpages:Enabled" value="false" />
</appSettings>

<system.webServer>
<handlers>
<remove name="BlockViewHandler"/>
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
</handlers>
</system.webServer>
</configuration>

+ 4
- 2
Teknik/Areas/Help/Views/Help/Index.cshtml View File

@@ -9,8 +9,10 @@
<hr>
<h3 class="text-center">Important Links</h3>
<dl class="dl-horizontal">
<dt><a href="@Url.SubRouteUrl("transparency", "Transparency.Index")" target="_blank">Site Transparency</a></dt>
<dd>All the site's transactions, statistics, and data effecting actions.</dd>
<dt><a href="@Url.SubRouteUrl("faq", "FAQ.Index")" target="_blank">Frequently Asked Questions</a></dt>
<dd>Some of the more commonly asked questions and some answers regarding them.</dd>
<dt><a href="@Url.SubRouteUrl("status", "Status.Index")" target="_blank">Site Statistics</a></dt>
<dd>Current status of the server, and all the site's statistics, transactions, and data effecting actions.</dd>
<dt><a href="@Url.SubRouteUrl("privacy", "Privacy.Index")" target="_blank">Privacy Policy</a></dt>
<dd>Everything about how we handle your privacy.</dd>
<dt><a href="@Url.SubRouteUrl("tos", "TOS.Index")" target="_blank">Terms of Service</a></dt>

+ 41
- 2
Teknik/Areas/Help/Views/Help/Mail.cshtml View File

@@ -16,7 +16,7 @@
You can either access your email via the <a href="@Url.SubRouteUrl("mail", "Mail.Index")" target="_blank">Web Client</a> or by using a client of your choosing with support for IMAP(143|993) or POP3(110).
</p>
<div class="row">
<div class="col-md-12">
<div class="col-sm-12">
<ul class="list-group">
<li class="list-group-item text-center"><h4>Outlook</h4></li>
<br />
@@ -44,7 +44,7 @@
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="col-sm-12">
<ul class="list-group">
<li class="list-group-item text-center"><h4>Thunderbird</h4></li>
<br />
@@ -71,5 +71,44 @@
</ul>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<ul class="list-group">
<li class="list-group-item text-center"><h4>Mutt</h4></li>
<br />
<div class="col-sm-10 col-sm-offset-1">
<pre>#You can set your editor of preference here
set editor=vim

#It's important to set your real name and from email address to avoid SMTP errors.
set realname="My Name"
set from=example@teknik.io
set use_from=yes

set imap_user=example@teknik.io

#Don't set your password here, mutt will prompt you for it.
#set imap_pass=lulpasshere

#This is an example IMAP configuration.
set folder="imaps://mail.teknik.io/"
set spoolfile=+INBOX
set record="Sent"
set postponed="Drafts"

#This is to send email, uses your imap user to send.
#Again, mutt will prompt you for your teknik email password.
set smtp_url="smtps://$imap_user@mail.teknik.io/"

#Miscellaneous configuration, check mutt man pages or online documentation to see what they do.
set ssl_starttls=yes
unset imap_passive
set imap_check_subscribed
set net_inc=5
set mail_check = 360</pre>
</div>
</ul>
</div>
</div>
</div>
</div>

+ 1
- 1
Teknik/Areas/Help/Views/web.config View File

@@ -10,7 +10,7 @@

<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<pages pageBaseType="System.Web.Mvc.WebViewPage">
<pages pageBaseType="Teknik.BaseViewPage">
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />

+ 1
- 1
Teknik/Areas/Home/Views/web.config View File

@@ -10,7 +10,7 @@

<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<pages pageBaseType="System.Web.Mvc.WebViewPage">
<pages pageBaseType="Teknik.BaseViewPage">
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />

+ 1
- 1
Teknik/Areas/Paste/Views/web.config View File

@@ -10,7 +10,7 @@

<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<pages pageBaseType="System.Web.Mvc.WebViewPage">
<pages pageBaseType="Teknik.BaseViewPage">
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />

+ 1
- 1
Teknik/Areas/Podcast/Views/web.config View File

@@ -10,7 +10,7 @@

<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<pages pageBaseType="System.Web.Mvc.WebViewPage">
<pages pageBaseType="Teknik.BaseViewPage">
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />

+ 1
- 1
Teknik/Areas/Privacy/Views/web.config View File

@@ -10,7 +10,7 @@

<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<pages pageBaseType="System.Web.Mvc.WebViewPage">
<pages pageBaseType="Teknik.BaseViewPage">
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />

+ 1
- 1
Teknik/Areas/Shortener/Views/web.config View File

@@ -10,7 +10,7 @@

<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<pages pageBaseType="System.Web.Mvc.WebViewPage">
<pages pageBaseType="Teknik.BaseViewPage">
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />

+ 67
- 1
Teknik/Areas/Status/Scripts/Status.js View File

@@ -45,6 +45,20 @@ $(document).ready(function () {
crosshairs: true,
pointFormat: '<span style="color:{point.color}">\u25CF</span> {series.name}: <b>{point.y:.2f}%</b><br/>'
},
plotOptions: {
line: {
marker: {
enabled: false,
symbol: 'circle',
radius: 2,
states: {
hover: {
enabled: true
}
}
}
}
},
credits: {
enabled: false
},
@@ -108,6 +122,20 @@ $(document).ready(function () {
return '<span style="color:' + this.color + '">\u25CF</span> ' + this.series.name + ': <b>' + yVal + '</b><br/>';
}
},
plotOptions: {
line: {
marker: {
enabled: false,
symbol: 'circle',
radius: 2,
states: {
hover: {
enabled: true
}
}
}
}
},
credits: {
enabled: false
},
@@ -134,7 +162,6 @@ $(document).ready(function () {
chart: {
useUTC: false,
renderTo: 'network-usage-chart',
type: 'line',
marginRight: 10
},
title: {
@@ -169,16 +196,48 @@ $(document).ready(function () {
return '<span style="color:' + this.color + '">\u25CF</span> ' + this.series.name + ': <b>' + yVal + '</b><br/>';
}
},
plotOptions: {
area: {
marker: {
enabled: false,
symbol: 'circle',
radius: 2,
states: {
hover: {
enabled: true
}
}
}
},
line: {
marker: {
enabled: false,
symbol: 'circle',
radius: 2,
states: {
hover: {
enabled: true
}
}
}
}
},
credits: {
enabled: false
},
series: [
{
type: 'line',
name: 'Sent',
dashStyle: 'Dash',
color: '#7cb5ec',
data: []
},
{
type: 'area',
name: 'Received',
color: '#7cb5ec',
fillOpacity: 0.3,
data: []
}
]
@@ -301,4 +360,11 @@ $(document).ready(function () {
$('a[href="#site-stats"]').on('shown.bs.tab', function (e) {
visitChart.setSize($('#visitor-chart').width(), $('#visitor-chart').height());
})

// Resize the chart when viewing the tab (initial width is wrong due to chart being hidden)
$('a[href="#realtime-stats"]').on('shown.bs.tab', function (e) {
cpuUsageChart.setSize($('#cpu-usage-chart').width(), $('#cpu-usage-chart').height());
memUsageChart.setSize($('#mem-usage-chart').width(), $('#mem-usage-chart').height());
networkUsageChart.setSize($('#network-usage-chart').width(), $('#network-usage-chart').height());
})
});

+ 1
- 1
Teknik/Areas/Status/Views/web.config View File

@@ -10,7 +10,7 @@

<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<pages pageBaseType="System.Web.Mvc.WebViewPage">
<pages pageBaseType="Teknik.BaseViewPage">
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />

+ 1
- 1
Teknik/Areas/Stream/Views/web.config View File

@@ -10,7 +10,7 @@

<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<pages pageBaseType="System.Web.Mvc.WebViewPage">
<pages pageBaseType="Teknik.BaseViewPage">
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />

+ 1
- 1
Teknik/Areas/TOS/Views/web.config View File

@@ -10,7 +10,7 @@

<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<pages pageBaseType="System.Web.Mvc.WebViewPage">
<pages pageBaseType="Teknik.BaseViewPage">
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />

+ 14
- 2
Teknik/Areas/Upload/Views/Upload/Index.cshtml View File

@@ -3,11 +3,23 @@
@using Teknik.Utilities
@using Teknik.Areas.Vault.Models

@{
long maxUploadSize = Model.Config.UploadConfig.MaxUploadSize;
if (User.Identity.IsAuthenticated)
{
maxUploadSize = Model.Config.UploadConfig.MaxUploadSizeBasic;
if (User.Info.AccountType == AccountType.Premium)
{
maxUploadSize = Model.Config.UploadConfig.MaxUploadSizePremium;
}
}
}

<script>
var encScriptSrc = '@Scripts.Url("~/bundles/cryptoWorker")';
var aesScriptSrc = '@Scripts.Url("~/bundles/crypto")';
var uploadFileURL = '@Url.SubRouteUrl(Model.CurrentSub, "Upload.Action", new { action = "Upload" })';
var maxUploadSize = @Model.Config.UploadConfig.MaxUploadSize;
var maxUploadSize = @maxUploadSize;
var chunkSize = @Model.Config.UploadConfig.ChunkSize;
var keySize = @Model.Config.UploadConfig.KeySize;
var blockSize = @Model.Config.UploadConfig.BlockSize;
@@ -78,7 +90,7 @@
To view the file decrypted, you must use the direct Teknik link in a javascript enabled browser.
</p>
<p>
The maximum file size per upload is <b>@StringHelper.GetBytesReadable(Model.Config.UploadConfig.MaxUploadSize)</b>
The maximum file size per upload is <b>@StringHelper.GetBytesReadable(maxUploadSize)</b>
</p>
</div>
<div class="text-center">

+ 1
- 1
Teknik/Areas/Upload/Views/web.config View File

@@ -10,7 +10,7 @@

<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<pages pageBaseType="System.Web.Mvc.WebViewPage">
<pages pageBaseType="Teknik.BaseViewPage">
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />

+ 4
- 0
Teknik/Areas/User/Models/User.cs View File

@@ -5,6 +5,7 @@ using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using Teknik.Attributes;
using Teknik.Models;
using Teknik.Utilities;

namespace Teknik.Areas.Users.Models
{
@@ -23,6 +24,8 @@ namespace Teknik.Areas.Users.Models

public DateTime LastSeen { get; set; }

public AccountType AccountType { get; set; }

public virtual ICollection<Group> Groups { get; set; }
public virtual UserSettings UserSettings { get; set; }
@@ -52,6 +55,7 @@ namespace Teknik.Areas.Users.Models
Transfers = new List<TransferType>();
JoinDate = DateTime.Now;
LastSeen = DateTime.Now;
AccountType = AccountType.Basic;
Groups = new List<Group>();
TrustedDevices = new List<TrustedDevice>();
AuthTokens = new List<AuthToken>();

+ 1
- 1
Teknik/Areas/User/Views/web.config View File

@@ -10,7 +10,7 @@

<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<pages pageBaseType="System.Web.Mvc.WebViewPage">
<pages pageBaseType="Teknik.BaseViewPage">
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />

+ 1
- 1
Teknik/Areas/Vault/Views/web.config View File

@@ -10,7 +10,7 @@

<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<pages pageBaseType="System.Web.Mvc.WebViewPage">
<pages pageBaseType="Teknik.BaseViewPage">
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />

+ 25
- 0
Teknik/BaseViewPage.cs View File

@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Teknik.Security;

namespace Teknik
{
public abstract class BaseViewPage : WebViewPage
{
public virtual new TeknikPrincipal User
{
get { return base.User as TeknikPrincipal; }
}
}

public abstract class BaseViewPage<TModel> : WebViewPage<TModel>
{
public virtual new TeknikPrincipal User
{
get { return base.User as TeknikPrincipal; }
}
}
}

+ 5
- 0
Teknik/Controllers/DefaultController.cs View File

@@ -5,6 +5,7 @@ using Teknik.Areas.Error.Controllers;
using Teknik.Configuration;

using Teknik.Filters;
using Teknik.Security;
using Teknik.Utilities;

namespace Teknik.Controllers
@@ -30,6 +31,10 @@ namespace Teknik.Controllers
return _config;
}
}
protected virtual new TeknikPrincipal User
{
get { return HttpContext.User as TeknikPrincipal; }
}

public DefaultController()
{

+ 2
- 24
Teknik/Global.asax.cs View File

@@ -15,6 +15,7 @@ using System.Diagnostics;
using Teknik.Utilities;
using System.Text;
using Teknik.Areas.Users.Utility;
using Teknik.Security;

namespace Teknik
{
@@ -79,7 +80,6 @@ namespace Teknik

// Username and Roles for the current user
string username = string.Empty;
List<string> roles = new List<string>();
bool hasAuthToken = false;
if (Request != null)
@@ -136,29 +136,7 @@ namespace Teknik
}
}

// Create the new user if we found one from the supplied auth info
if (!string.IsNullOrEmpty(username))
{
using (TeknikEntities entities = new TeknikEntities())
{
User user = UserHelper.GetUser(entities, username);

// Grab all their roles
foreach (Group grp in user.Groups)
{
foreach (Role role in grp.Roles)
{
if (!roles.Contains(role.Name))
{
roles.Add(role.Name);
}
}
}
}

HttpContext.Current.User = new System.Security.Principal.GenericPrincipal(
new System.Security.Principal.GenericIdentity(username, "Forms"), roles.ToArray());
}
HttpContext.Current.User = new TeknikPrincipal(username);
}

protected void Application_Error(object sender, EventArgs e)

+ 14
- 0
Teknik/Security/ITeknikPrincipal.cs View File

@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Principal;
using System.Web;
using Teknik.Areas.Users.Models;

namespace Teknik.Security
{
public interface ITeknikPrincipal : IPrincipal
{
User Info { get; }
}
}

+ 62
- 0
Teknik/Security/TeknikPrincipal.cs View File

@@ -0,0 +1,62 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Principal;
using System.Web;
using Teknik.Areas.Users.Models;
using Teknik.Areas.Users.Utility;
using Teknik.Models;

namespace Teknik.Security
{
public class TeknikPrincipal : ITeknikPrincipal
{
TeknikEntities entities = new TeknikEntities();

private IIdentity _Identity;
public IIdentity Identity
{
get
{
return this._Identity;
}
}

private User m_Info;
public User Info
{
get
{
if (m_Info == null && Identity != null && Identity.IsAuthenticated)
{
m_Info = UserHelper.GetUser(entities, Identity.Name);
}
return m_Info;
}
}

public TeknikPrincipal(string username)
{
this._Identity = new GenericIdentity(username, "Forms");
}

public bool IsInRole(string role)
{
if (Info != null)
{
// Grab all their roles
foreach (Group grp in Info.Groups)
{
foreach (Role curRole in grp.Roles)
{
if (curRole.Name == role)
{
return true;
}
}
}
}
return false;
}
}
}

+ 1
- 0
Teknik/Startup.cs View File

@@ -12,6 +12,7 @@ namespace Teknik
public void Configuration(IAppBuilder app)
{
// For more information on how to configure your application, visit http://go.microsoft.com/fwlink/?LinkID=316888
// Start the SignalR Mappings
app.MapSignalR();
}
}

+ 12
- 0
Teknik/Teknik.csproj View File

@@ -238,6 +238,9 @@
<Compile Include="Areas\Error\Controllers\ErrorController.cs" />
<Compile Include="Areas\Error\ErrorAreaRegistration.cs" />
<Compile Include="Areas\Error\ViewModels\ErrorViewModel.cs" />
<Compile Include="Areas\FAQ\Controllers\FAQController.cs" />
<Compile Include="Areas\FAQ\FAQAreaRegistration.cs" />
<Compile Include="Areas\FAQ\ViewModels\FAQViewModel.cs" />
<Compile Include="Areas\Help\Controllers\HelpController.cs" />
<Compile Include="Areas\Help\HelpAreaRegistration.cs" />
<Compile Include="Areas\Help\ViewModels\HelpViewModel.cs" />
@@ -291,6 +294,8 @@
<Compile Include="Areas\Vault\ViewModels\PasteItemViewModel.cs" />
<Compile Include="Areas\Vault\ViewModels\VaultItemViewModel.cs" />
<Compile Include="Attributes\TeknikAuthorizeAttribute.cs" />
<Compile Include="Security\ITeknikPrincipal.cs" />
<Compile Include="Security\TeknikPrincipal.cs" />
<Compile Include="Filters\CORSActionFilter.cs" />
<Compile Include="Hubs\ServerUsageHub.cs" />
<Compile Include="Models\DataPoint.cs" />
@@ -358,6 +363,7 @@
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="App_Start\SubdomainRoute.cs" />
<Compile Include="App_Start\SubdomainRouteExtension.cs" />
<Compile Include="BaseViewPage.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="App_Data\reservedUsernames.txt">
@@ -370,6 +376,7 @@
<Content Include="Areas\Blog\Content\Blog.css" />
<Content Include="Areas\Blog\Scripts\Blog.js" />
<Content Include="Areas\Contact\Scripts\Contact.js" />
<Content Include="Areas\FAQ\Content\FAQ.css" />
<Content Include="Areas\Help\Content\Help.css" />
<Content Include="Areas\Home\Content\Home.css" />
<Content Include="Areas\Home\Scripts\Home.js" />
@@ -628,6 +635,9 @@
<Content Include="Areas\Status\Views\Status\OneTimes.cshtml" />
<Content Include="Areas\Status\Views\Status\Donations.cshtml" />
<Content Include="Areas\Status\Views\Status\Takedowns.cshtml" />
<Content Include="Areas\FAQ\Views\web.config" />
<Content Include="Areas\FAQ\Views\_ViewStart.cshtml" />
<Content Include="Areas\FAQ\Views\FAQ\Index.cshtml" />
<None Include="Properties\PublishProfiles\Teknik Dev.pubxml" />
<None Include="Properties\PublishProfiles\Teknik Production.pubxml" />
<None Include="Scripts\jquery-2.1.4.intellisense.js" />
@@ -717,6 +727,8 @@
<Folder Include="Areas\Dev\Views\Shared\" />
<Folder Include="Areas\Error\Models\" />
<Folder Include="Areas\Error\Views\Shared\" />
<Folder Include="Areas\FAQ\Models\" />
<Folder Include="Areas\FAQ\Views\Shared\" />
<Folder Include="Areas\Help\Models\" />
<Folder Include="Areas\Help\Views\Shared\" />
<Folder Include="Areas\Home\Models\" />

+ 1
- 1
Teknik/Views/Shared/_Footer.cshtml View File

@@ -51,7 +51,7 @@
}
<div class="row">
<div class="col-sm-5 col-sm-offset-1 text-left text-muted">
&copy; Teknik 2013-2017 | <a href="@Url.SubRouteUrl("privacy", "Privacy.Index")">Privacy</a> | <a href="@Url.SubRouteUrl("tos", "TOS.Index")">TOS</a> | <a href="@Url.SubRouteUrl("status", "Status.Index")">Status</a>
&copy; Teknik 2013-2017 | <a href="@Url.SubRouteUrl("faq", "FAQ.Index")">FAQ</a> | <a href="@Url.SubRouteUrl("privacy", "Privacy.Index")">Privacy</a> | <a href="@Url.SubRouteUrl("tos", "TOS.Index")">TOS</a> | <a href="@Url.SubRouteUrl("status", "Status.Index")">Status</a>
</div>
<div class="col-sm-5 text-right text-muted">
<div id="pagetime" style="display:none;">

+ 1
- 1
Teknik/Views/Web.config View File

@@ -10,7 +10,7 @@

<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<pages pageBaseType="System.Web.Mvc.WebViewPage">
<pages pageBaseType="Teknik.BaseViewPage">
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />

+ 0
- 5
Utilities/Configuration/Config.cs View File

@@ -41,7 +41,6 @@ namespace Teknik.Configuration
private ShortenerConfig _ShortenerConfig;
private VaultConfig _VaultConfig;
private StatusConfig _StatusConfig;
private DatabaseConfig _DatabaseConfig;
private LoggingConfig _LoggingConfig;
private PiwikConfig _PiwikConfig;

@@ -100,9 +99,6 @@ namespace Teknik.Configuration
// Status Configuration
public StatusConfig StatusConfig { get { return _StatusConfig; } set { _StatusConfig = value; } }

// Database Configuration
public DatabaseConfig DatabaseConfig { get { return _DatabaseConfig; } set { _DatabaseConfig = value; } }

// Logging Configuration
public LoggingConfig LoggingConfig { get { return _LoggingConfig; } set { _LoggingConfig = value; } }

@@ -147,7 +143,6 @@ namespace Teknik.Configuration
ShortenerConfig = new ShortenerConfig();
VaultConfig = new VaultConfig();
StatusConfig = new StatusConfig();
DatabaseConfig = new DatabaseConfig();
LoggingConfig = new LoggingConfig();
PiwikConfig = new PiwikConfig();
}

+ 0
- 2
Utilities/Configuration/DatabaseConfig.cs View File

@@ -2,7 +2,6 @@
{
public class DatabaseConfig
{
public bool Migrate { get; set; }
public string Server { get; set; }
public int Port { get; set; }
public string Database { get; set; }
@@ -16,7 +15,6 @@

public void SetDefaults()
{
Migrate = false;
Server = "localhost";
Port = 3306;
Database = string.Empty;

+ 6
- 0
Utilities/Configuration/UploadConfig.cs View File

@@ -12,6 +12,10 @@ namespace Teknik.Configuration
public bool DownloadEnabled { get; set; }
// Max upload size in bytes
public long MaxUploadSize { get; set; }
// Max Upload Size for basic users
public long MaxUploadSizeBasic { get; set; }
// Max Upload Size for premium users
public long MaxUploadSizePremium { get; set; }
// Location of the upload directory
public string UploadDirectory { get; set; }
// File Extension for saved files
@@ -38,6 +42,8 @@ namespace Teknik.Configuration
UploadEnabled = true;
DownloadEnabled = true;
MaxUploadSize = 100000000;
MaxUploadSizeBasic = 100000000;
MaxUploadSizePremium = 100000000;
UploadDirectory = Directory.GetCurrentDirectory();
FileExtension = "enc";
UrlLength = 5;

+ 5
- 0
Utilities/Configuration/UserConfig.cs View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Teknik.Utilities;

namespace Teknik.Configuration
{
@@ -16,6 +17,8 @@ namespace Teknik.Configuration
public int MinUsernameLength { get; set; }
public int MaxUsernameLength { get; set; }
public string ReservedUsernameDefinitionFile { get; set; }
public decimal PremiumAccountPrice { get; set; }
public string PaymentType { get; set; }

public UserConfig()
{
@@ -27,6 +30,8 @@ namespace Teknik.Configuration
MinUsernameLength = 1;
MaxUsernameLength = 35;
ReservedUsernameDefinitionFile = string.Empty;
PremiumAccountPrice = 0;
PaymentType = "Donation";
}
}
}

+ 14
- 0
Utilities/Utilities/AccountType.cs View File

@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Teknik.Utilities
{
public enum AccountType
{
Basic,
Premium
}
}

+ 12
- 0
Utilities/Utilities/EntityExtensions.cs View File

@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Teknik.Utilities
{
public static class EntityExtensions
{
}
}

+ 2
- 0
Utilities/Utilities/Utilities.csproj View File

@@ -105,8 +105,10 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="AccountType.cs" />
<Compile Include="CurrencyHelper.cs" />
<Compile Include="CurrencyType.cs" />
<Compile Include="EntityExtensions.cs" />
<Compile Include="FileGenerateResult.cs" />
<Compile Include="HttpWebResponseResult.cs" />
<Compile Include="BundleExtensions.cs" />

Loading…
Cancel
Save