@@ -134,7 +132,7 @@
int
- @Model.Config.UploadConfig.KeySize
+ @Config.UploadConfig.KeySize
The size of the key provided in bits. Only needed if encrypting and no key is provided.
@@ -162,7 +160,7 @@
int
- @Model.Config.UploadConfig.BlockSize
+ @Config.UploadConfig.BlockSize
The size of the iv provided in bits. Only needed if encrypting and no iv is provided.
diff --git a/Teknik/Areas/Help/Views/Help/Blog.cshtml b/Teknik/Areas/Help/Views/Help/Blog.cshtml
index 8357fb3..b1a98e2 100644
--- a/Teknik/Areas/Help/Views/Help/Blog.cshtml
+++ b/Teknik/Areas/Help/Views/Help/Blog.cshtml
@@ -1,7 +1,5 @@
@model Teknik.Areas.Help.ViewModels.HelpViewModel
-@using Teknik.Utilities
-
Help Index
diff --git a/Teknik/Areas/Help/Views/Help/Git.cshtml b/Teknik/Areas/Help/Views/Help/Git.cshtml
index 04392e6..b626c32 100644
--- a/Teknik/Areas/Help/Views/Help/Git.cshtml
+++ b/Teknik/Areas/Help/Views/Help/Git.cshtml
@@ -1,7 +1,5 @@
@model Teknik.Areas.Help.ViewModels.HelpViewModel
-@using Teknik.Utilities
-
Help Index
diff --git a/Teknik/Areas/Help/Views/Help/Index.cshtml b/Teknik/Areas/Help/Views/Help/Index.cshtml
index a766435..22f9a03 100644
--- a/Teknik/Areas/Help/Views/Help/Index.cshtml
+++ b/Teknik/Areas/Help/Views/Help/Index.cshtml
@@ -1,7 +1,5 @@
@model Teknik.Areas.Help.ViewModels.HelpViewModel
-@using Teknik.Utilities
-
diff --git a/Teknik/Areas/Help/Views/Help/Irc.cshtml b/Teknik/Areas/Help/Views/Help/Irc.cshtml
index 7199616..b5f9527 100644
--- a/Teknik/Areas/Help/Views/Help/Irc.cshtml
+++ b/Teknik/Areas/Help/Views/Help/Irc.cshtml
@@ -1,7 +1,5 @@
@model Teknik.Areas.Help.ViewModels.HelpViewModel
-@using Teknik.Utilities
-
Help Index
@@ -12,7 +10,7 @@
IRC Server Info
- You can connect to the Teknik IRC using any RFC compliant client by connecting to irc.@Model.Config.Host on port 6667 .
+ You can connect to the Teknik IRC using any RFC compliant client by connecting to irc.@Config.Host on port 6667 .
Channel Information
diff --git a/Teknik/Areas/Help/Views/Help/Mail.cshtml b/Teknik/Areas/Help/Views/Help/Mail.cshtml
index 2120889..e421d71 100644
--- a/Teknik/Areas/Help/Views/Help/Mail.cshtml
+++ b/Teknik/Areas/Help/Views/Help/Mail.cshtml
@@ -1,7 +1,5 @@
@model Teknik.Areas.Help.ViewModels.HelpViewModel
-@using Teknik.Utilities
-
Help Index
@@ -32,16 +30,16 @@
User Information
- Email Address:@string.Format("[username]@{0}", Model.Config.EmailConfig.Domain)
+ Email Address:@string.Format("[username]@{0}", Config.EmailConfig.Domain)
Server Information
- Incoming Server:@Model.Config.EmailConfig.MailHost
- Outgoing Server:@Model.Config.EmailConfig.MailHost
+ Incoming Server:@Config.EmailConfig.MailHost
+ Outgoing Server:@Config.EmailConfig.MailHost
Logon Information
- Username:@string.Format("[username]@{0}", Model.Config.EmailConfig.Domain)
+ Username:@string.Format("[username]@{0}", Config.EmailConfig.Domain)
Password:[password]
More Settings
Requires Authentication:Both
@@ -60,9 +58,9 @@
Server Settings
- Server Name:@Model.Config.EmailConfig.MailHost
+ Server Name:@Config.EmailConfig.MailHost
Port:[IMAP] 143/993 | [POP3] 110/995
- User Name:@string.Format("[username]@{0}", Model.Config.EmailConfig.Domain)
+ User Name:@string.Format("[username]@{0}", Config.EmailConfig.Domain)
Connection Security:None/SSL/TLS
Authentication method:Normal Password
@@ -70,9 +68,9 @@
Outgoing Server (SMTP)
- Server Name:@Model.Config.EmailConfig.MailHost
+ Server Name:@Config.EmailConfig.MailHost
Port:25/465/587
- User Name:@string.Format("[username]@{0}", Model.Config.EmailConfig.Domain)
+ User Name:@string.Format("[username]@{0}", Config.EmailConfig.Domain)
Connection Security:None/SSL/TLS
Authentication method:Normal Password
diff --git a/Teknik/Areas/Help/Views/Help/Markdown.cshtml b/Teknik/Areas/Help/Views/Help/Markdown.cshtml
index 15d8af6..46b90db 100644
--- a/Teknik/Areas/Help/Views/Help/Markdown.cshtml
+++ b/Teknik/Areas/Help/Views/Help/Markdown.cshtml
@@ -1,7 +1,5 @@
@model Teknik.Areas.Help.ViewModels.HelpViewModel
-@using Teknik.Utilities
-
Help Index
diff --git a/Teknik/Areas/Help/Views/Help/Mumble.cshtml b/Teknik/Areas/Help/Views/Help/Mumble.cshtml
index db8aac5..37e2719 100644
--- a/Teknik/Areas/Help/Views/Help/Mumble.cshtml
+++ b/Teknik/Areas/Help/Views/Help/Mumble.cshtml
@@ -1,7 +1,5 @@
@model Teknik.Areas.Help.ViewModels.HelpViewModel
-@using Teknik.Utilities
-
Help Index
@@ -12,7 +10,7 @@
Mumble Server Info
- You can connect to the Mumble server by connecting to mumble.@Model.Config.Host on port 64738 .
+ You can connect to the Mumble server by connecting to mumble.@Config.Host on port 64738 .
diff --git a/Teknik/Areas/Help/Views/Help/RSS.cshtml b/Teknik/Areas/Help/Views/Help/RSS.cshtml
index 3eedce5..95d0917 100644
--- a/Teknik/Areas/Help/Views/Help/RSS.cshtml
+++ b/Teknik/Areas/Help/Views/Help/RSS.cshtml
@@ -1,7 +1,5 @@
@model Teknik.Areas.Help.ViewModels.HelpViewModel
-@using Teknik.Utilities
-
Help Index
diff --git a/Teknik/Areas/Help/Views/Help/Tools.cshtml b/Teknik/Areas/Help/Views/Help/Tools.cshtml
index 36f035e..b549d5f 100644
--- a/Teknik/Areas/Help/Views/Help/Tools.cshtml
+++ b/Teknik/Areas/Help/Views/Help/Tools.cshtml
@@ -1,7 +1,5 @@
@model Teknik.Areas.Help.ViewModels.HelpViewModel
-@using Teknik.Utilities
-
Help Index
diff --git a/Teknik/Areas/Help/Views/Help/Upload.cshtml b/Teknik/Areas/Help/Views/Help/Upload.cshtml
index 65f15fa..d1170bb 100644
--- a/Teknik/Areas/Help/Views/Help/Upload.cshtml
+++ b/Teknik/Areas/Help/Views/Help/Upload.cshtml
@@ -1,7 +1,5 @@
@model Teknik.Areas.Help.ViewModels.HelpViewModel
-@using Teknik.Utilities
-
Help Index
@@ -18,11 +16,11 @@
When you using the web interface for uploads, the file is loaded using the javascript FileReader API.
- Once the file is completely loaded into the buffer, a key and iv are generated by a random string generator to create a key that is @Model.Config.UploadConfig.KeySize Bits and an iv (Block Size) that is @Model.Config.UploadConfig.BlockSize Bits .
+ Once the file is completely loaded into the buffer, a key and iv are generated by a random string generator to create a key that is @Config.UploadConfig.KeySize Bits and an iv (Block Size) that is @Config.UploadConfig.BlockSize Bits .
Then the file buffer, key, and iv are passed into a Web Worker for encryption.
- The file data is passed through a progressive ciphering with a chunk size of @Model.Config.UploadConfig.ChunkSize Bytes . This is to help reduce the memory usage needed by the encryption process as it only needs to process and convert each chunk instead of the entire file.
+ The file data is passed through a progressive ciphering with a chunk size of @Config.UploadConfig.ChunkSize Bytes . This is to help reduce the memory usage needed by the encryption process as it only needs to process and convert each chunk instead of the entire file.
Once all the file's data has been processed, the final buffer is then passed back to the main encryption routine and is sent to the server as a ArrayBuffer, along with the content-type, generated iv, key size, and block size.
@@ -36,11 +34,11 @@
Cipher Properties
- The encryption library being used is Crypto-JS and the cipher being used is AES-@Model.Config.UploadConfig.KeySize using the mode CTR . The variant of AES is determined by the size of the key used (128, 192, or 256).
+ The encryption library being used is Crypto-JS and the cipher being used is AES-@Config.UploadConfig.KeySize using the mode CTR . The variant of AES is determined by the size of the key used (128, 192, or 256).
Upload Requirements
- The maximum file size per upload is @StringHelper.GetBytesReadable(Model.Config.UploadConfig.MaxUploadSize)
+ The maximum file size per upload is @StringHelper.GetBytesReadable(Config.UploadConfig.MaxUploadSize)
Each file is scanned for viruses at upload. If it fails, it will cancel the upload. Currently only files that are unencrypted when being sent to the server will be scanned successfully for viruses. If the file is encrypted client side, the encrypted data will be checked. This could create a false positive, but since the key is randomly generated, the next attempt should not be flagged.
diff --git a/Teknik/Areas/Help/Views/_ViewStart.cshtml b/Teknik/Areas/Help/Views/_ViewStart.cshtml
deleted file mode 100644
index 2de6241..0000000
--- a/Teknik/Areas/Help/Views/_ViewStart.cshtml
+++ /dev/null
@@ -1,3 +0,0 @@
-@{
- Layout = "~/Views/Shared/_Layout.cshtml";
-}
diff --git a/Teknik/Areas/Help/Views/web.config b/Teknik/Areas/Help/Views/web.config
deleted file mode 100644
index 013d8bf..0000000
--- a/Teknik/Areas/Help/Views/web.config
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Teknik/Areas/Home/Controllers/HomeController.cs b/Teknik/Areas/Home/Controllers/HomeController.cs
index 3d9b1e2..94190b0 100644
--- a/Teknik/Areas/Home/Controllers/HomeController.cs
+++ b/Teknik/Areas/Home/Controllers/HomeController.cs
@@ -1,51 +1,50 @@
-using System;
-using System.Collections.Generic;
+using System.Collections.Generic;
using System.Linq;
-using System.Web;
-using System.Web.Mvc;
-using Teknik.Areas.Podcast.Models;
using Teknik.Areas.Blog.Models;
using Teknik.Areas.Home.ViewModels;
using Teknik.Controllers;
-using Teknik.Utilities;
-using Teknik.Models;
using Teknik.Filters;
using Teknik.Attributes;
+using Microsoft.Extensions.Logging;
+using Teknik.Configuration;
+using Teknik.Data;
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.EntityFrameworkCore;
+using Teknik.Logging;
+using System;
namespace Teknik.Areas.Home.Controllers
{
[TeknikAuthorize]
+ [Area("Home")]
public class HomeController : DefaultController
{
- // GET: Home/Home
- private TeknikEntities db = new TeknikEntities();
+ public HomeController(ILogger logger, Config config, TeknikEntities dbContext) : base(logger, config, dbContext) { }
[TrackPageView]
[AllowAnonymous]
- public ActionResult Index()
+ public IActionResult Index()
{
HomeViewModel model = new HomeViewModel();
// Grab the latest site blog posts
List lastSite = new List();
- if (db.BlogPosts.Count() > 0)
- {
- var foundSite = db.BlogPosts.OrderByDescending(post => post.DatePosted).Where(p => p.Published && p.System).Take(5);
- if (foundSite != null)
- lastSite = foundSite.ToList();
- }
+
+ var foundSite = _dbContext.BlogPosts.Include(p => p.Blog).Include(b => b.Blog.User).OrderByDescending(post => post.DatePosted).Where(p => p.Published && p.System).Take(5);
+ if (foundSite != null)
+ lastSite = foundSite.ToList();
+
// Grab the latest podcasts
List lastPods = new List();
- if (db.Podcasts.Count() > 0)
- {
- var foundPods = db.Podcasts.OrderByDescending(post => post.DatePosted).Where(p => p.Published).Take(5);
- if (foundPods != null)
- lastPods = foundPods.ToList();
- }
+
+ var foundPods = _dbContext.Podcasts.OrderByDescending(post => post.DatePosted).Where(p => p.Published).Take(5);
+ if (foundPods != null)
+ lastPods = foundPods.ToList();
model.SitePosts = lastSite;
model.Podcasts = lastPods;
- ViewBag.Title = Config.Title;
+ ViewBag.Title = _config.Title;
return View(model);
}
}
diff --git a/Teknik/Areas/Home/HomeAreaRegistration.cs b/Teknik/Areas/Home/HomeAreaRegistration.cs
deleted file mode 100644
index 0496b6c..0000000
--- a/Teknik/Areas/Home/HomeAreaRegistration.cs
+++ /dev/null
@@ -1,79 +0,0 @@
-using System.Collections.Generic;
-using System.Web.Mvc;
-using System.Web.Optimization;
-using Teknik.Configuration;
-using Teknik.Controllers;
-using Teknik.Utilities;
-
-namespace Teknik.Areas.Home
-{
- public class HomeAreaRegistration : AreaRegistration
- {
- public override string AreaName
- {
- get
- {
- return "Home";
- }
- }
-
- public override void RegisterArea(AreaRegistrationContext context)
- {
- Config config = Config.Load();
-
- // Default Routes to be applied everywhere
- context.MapSubdomainRoute(
- "Default.Favicon", // Route name
- new List() { "*" }, // Subdomains
- new List() { config.Host, config.ShortenerConfig.ShortenerHost }, // domains
- "favicon.ico", // URL with parameters
- new { controller = "Default", action = "Favicon" }, // Parameter defaults
- new[] { typeof(DefaultController).Namespace }
- );
-
- // Default Routes to be applied everywhere
- context.MapSubdomainRoute(
- "Default.Logo", // Route name
- new List() { "*" }, // Subdomains
- new List() { config.Host, config.ShortenerConfig.ShortenerHost }, // domains
- "Logo", // URL with parameters
- new { controller = "Default", action = "Logo" }, // Parameter defaults
- new[] { typeof(DefaultController).Namespace }
- );
-
- // Handle robots.txt file requests
- context.MapSubdomainRoute(
- "Default.Robots", // Route name
- new List() { "*" }, // Subdomains
- new List() { config.Host, config.ShortenerConfig.ShortenerHost }, // domains
- "robots.txt", // URL with parameters
- new { controller = "Default", action = "Robots" }, // Parameter defaults
- new[] { typeof(DefaultController).Namespace }
- );
-
- // Register fallback for all bad requests
- context.MapSubdomainRoute(
- "Default.NotFound", // Route name
- new List() { "*" }, // Subdomains
- new List() { config.Host }, // domains
- "{url}", // URL with parameters
- new { controller = "Default", action = "NotFound" }, // Parameter defaults
- new { url = "{*url}" },
- new[] { typeof(DefaultController).Namespace }
- );
-
- context.MapSubdomainRoute(
- "Home.Index", // Route name
- new List() { "www", string.Empty }, // Subdomains
- new List() { config.Host }, // domains
- "", // URL with parameters
- new { controller = "Home", action = "Index" }, // Parameter defaults
- new[] { typeof(Controllers.HomeController).Namespace }
- );
-
- // Register Style Bundles
- BundleTable.Bundles.Add(new CdnStyleBundle("~/Content/home", config.CdnHost).Include(
- "~/Areas/Home/Content/Home.css"));
- }
- }
-}
\ No newline at end of file
diff --git a/Teknik/Areas/Home/Scripts/Home.js b/Teknik/Areas/Home/Scripts/Home.js
deleted file mode 100644
index 5f28270..0000000
--- a/Teknik/Areas/Home/Scripts/Home.js
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/Teknik/Areas/Home/Views/Home/Index.cshtml b/Teknik/Areas/Home/Views/Home/Index.cshtml
index e7956e9..d9dc282 100644
--- a/Teknik/Areas/Home/Views/Home/Index.cshtml
+++ b/Teknik/Areas/Home/Views/Home/Index.cshtml
@@ -2,22 +2,21 @@
@using Teknik.Areas.Blog.Models
@using Teknik.Areas.Podcast.Models
-@using Teknik.Utilities
@{
- string logoPath = "/Images/logo-blue.svg";
+ string logoPath = "/images/logo-blue.svg";
// If we are using a CDN, let's replace it
- if (Model.Config.UseCdn)
+ if (Config.UseCdn)
{
- if (!string.IsNullOrEmpty(Model.Config.CdnHost))
+ if (!string.IsNullOrEmpty(Config.CdnHost))
{
- logoPath = Model.Config.CdnHost.TrimEnd('/') + logoPath;
+ logoPath = Config.CdnHost.TrimEnd('/') + logoPath;
}
}
}
-@Styles.Render("~/Content/home")
+
diff --git a/Teknik/Areas/Home/Views/_ViewStart.cshtml b/Teknik/Areas/Home/Views/_ViewStart.cshtml
deleted file mode 100644
index 2de6241..0000000
--- a/Teknik/Areas/Home/Views/_ViewStart.cshtml
+++ /dev/null
@@ -1,3 +0,0 @@
-@{
- Layout = "~/Views/Shared/_Layout.cshtml";
-}
diff --git a/Teknik/Areas/Home/Views/web.config b/Teknik/Areas/Home/Views/web.config
deleted file mode 100644
index 013d8bf..0000000
--- a/Teknik/Areas/Home/Views/web.config
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Teknik/Areas/IRC/Content/IRC.css b/Teknik/Areas/IRC/Content/IRC.css
deleted file mode 100644
index 6453b56..0000000
--- a/Teknik/Areas/IRC/Content/IRC.css
+++ /dev/null
@@ -1,46 +0,0 @@
-.clientOutput {
- height: 500px;
- text-align:left;
- margin:0 auto;
- margin-bottom:25px;
- padding:10px;
- background:#fff;
- border:1px solid #ACD8F0;
- overflow:auto;
-}
-
-.locationList {
- list-style: none;
- text-align: center;
-}
-
-.locationList .locationTab {
- border-top: 1px solid #666;
- border-left: 1px solid #666;
- border-bottom: 1px solid #666;
- border-right: 8px solid #666;
- background-color: #ddd;
- margin: 8px 0;
-}
-
-.locationList .locationTab:hover {
- border-right: 8px solid #333;
-}
-
-.locationList .locationTab.selected {
- border-left: none;
- background-color: #fff;
- border-right: 8px solid #006699;
-}
-
-.locationList .locationTab a,
-.locationList .locationTab a:visited {
- text-decoration: none;
- color: #666;
- display: block;
- padding: 15px 5px;
-}
-
-.locationList .locationTab a:hover {
- color: #000;
-}
\ No newline at end of file
diff --git a/Teknik/Areas/IRC/Controllers/IRCController.cs b/Teknik/Areas/IRC/Controllers/IRCController.cs
deleted file mode 100644
index 4b7aabd..0000000
--- a/Teknik/Areas/IRC/Controllers/IRCController.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Web;
-using System.Web.Mvc;
-using Teknik.Controllers;
-using Teknik.Attributes;
-using Teknik.Areas.IRC.ViewModels;
-
-namespace Teknik.Areas.IRC.Controllers
-{
- [TeknikAuthorize]
- public class IRCController : DefaultController
- {
- [AllowAnonymous]
- public ActionResult Client()
- {
- ViewBag.Title = "Web Client - " + Config.Title + " IRC";
- ClientViewModel model = new ClientViewModel();
- return View(model);
- }
- }
-}
\ No newline at end of file
diff --git a/Teknik/Areas/IRC/IrcAreaRegistration.cs b/Teknik/Areas/IRC/IrcAreaRegistration.cs
deleted file mode 100644
index 4297c67..0000000
--- a/Teknik/Areas/IRC/IrcAreaRegistration.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-using System.Collections.Generic;
-using System.Web.Mvc;
-using System.Web.Optimization;
-using Teknik.Configuration;
-using Teknik.Utilities;
-
-namespace Teknik.Areas.IRC
-{
- public class IRCAreaRegistration : AreaRegistration
- {
- public override string AreaName
- {
- get
- {
- return "IRC";
- }
- }
-
- public override void RegisterArea(AreaRegistrationContext context)
- {
- Config config = Config.Load();
- context.MapSubdomainRoute(
- "IRC.Client", // Route name
- new List
() { "irc" },
- new List() { config.Host },
- "", // URL with parameters
- new { controller = "IRC", action = "Client" }, // Parameter defaults
- new[] { typeof(Controllers.IRCController).Namespace }
- );
-
- // Register Script Bundle
- BundleTable.Bundles.Add(new CdnStyleBundle("~/Content/irc", config.CdnHost).Include(
- "~/Areas/IRC/Content/IRC.css"));
-
- // Register Script Bundle
- BundleTable.Bundles.Add(new CdnScriptBundle("~/bundles/irc", config.CdnHost).Include(
- "~/Scripts/bootbox/bootbox.min.js",
- "~/Scripts/jquery.blockUI.js",
- "~/Areas/IRC/Scripts/IRC.js"));
- }
- }
-}
\ No newline at end of file
diff --git a/Teknik/Areas/IRC/Scripts/IRC.js b/Teknik/Areas/IRC/Scripts/IRC.js
deleted file mode 100644
index d00c2a2..0000000
--- a/Teknik/Areas/IRC/Scripts/IRC.js
+++ /dev/null
@@ -1,247 +0,0 @@
-var clientViews = [];
-var serverView = '--Server--';
-var currentLocation = serverView;
-var currentNick;
-var connected = false;
-
-$(document).ready(function () {
- // UI interaction
- $('#message').bind("enterKey", function (e) {
- sendMessage($('#message').val());
- $('#message').val('');
- });
-
- $('#sendMessage').click(function () {
- sendMessage($('#message').val());
- $('#message').val('');
- });
-
- $('#guestSignIn').click(function () {
- var result = irc.server.connect();
- if (result && result != '') {
- $('#clientLogin').hide();
- $('#client').show();
- }
- else {
- $("#verifyStatus").css('display', 'inline', 'important');
- $("#verifyStatus").html('× Unable to Connect
');
- }
- });
-
- $('#verifyModal').on('shown.bs.modal', function (e) {
- $('#verifyPassword').focus();
- });
-
- $('#verifyModal').on('hide.bs.modal', function (e) {
- $("#verifyStatus").css('display', 'none', 'important');
- $("#verifyStatus").html('');
- $('#verifyPassword').val('');
- });
-
- $('#verifySubmit').click(function () {
- var username = $('#verifyUsername').val();
- var password = $('#verifyPassword').val();
- var result = irc.server.connect(username, password);
- if (result) {
- $('#clientLogin').hide();
- $('#client').show();
- $('#verifyModal').modal('hide');
- }
- else {
- $("#verifyStatus").css('display', 'inline', 'important');
- $("#verifyStatus").html('× Unable to Login
');
- }
- });
-
- function sendMessage(message) {
- irc.server.sendMessage(currentLocation, message);
- }
-
- $('#message').keyup(function (e) {
- if (e.keyCode == 13) {
- $(this).trigger("enterKey");
- }
- });
-
- /* ----------------------------------------
- Websocket for the irc client
- -----------------------------------------*/
- var irc = $.connection.ircClient;
-
- irc.client.privateMessageCommand = function (message) {
- var msg = formatMessage(message.TimeStamp, currentNick + ': ' + message.Message);
- addOutput(message.Recipient, msg);
- };
-
- irc.client.privateNoticeCommand = function (message) {
- var msg = formatMessage(message.TimeStamp, currentNick + ' -NOTICE-: ' + message.Message);
- addOutput(currentLocation, msg);
- };
-
- irc.client.channelMessage = function (message) {
- var msg = formatMessage(message.TimeStamp, message.Sender.Nickname + ': ' + message.Message);
- addOutput(message.Channel, msg);
- };
-
- irc.client.channelNotice = function (message) {
- var msg = formatMessage(message.TimeStamp, message.Sender.Nickname + ': ' + message.Message);
- addOutput(currentLocation, msg);
- };
-
- irc.client.channelModeChange = function (message, modes) {
- var msg = formatMessage(message.TimeStamp, ' * ' + message.Nick.Nickname + ' sets mode ' + modes);
- addOutput(message.Channel, msg);
- };
-
- irc.client.privateMessage = function (message) {
- var location = message.Sender.Nickname;
- if (location.toLowerCase() == 'nickserv' || location.toLowerCase() == 'chanserv') {
- location = serverView;
- }
- var msg = formatMessage(message.TimeStamp, message.Sender.Nickname + ': ' + message.Message);
- addOutput(location, msg);
- };
-
- irc.client.privateNotice = function (message) {
- var msg = formatMessage(message.TimeStamp, message.Sender.Nickname + ' -NOTICE-: ' + message.Message);
- addOutput(currentLocation, msg);
- };
-
- irc.client.ctcpMessage = function (message) {
- var msg = formatMessage(message.TimeStamp, '[CTCP] [' + message.Command + '] ' + message.Sender.Nickname + ': ' + message.Arguments);
- addOutput(message.Location, msg);
- };
-
- irc.client.joinChannel = function (message) {
- var msg = formatMessage(message.TimeStamp, message.Nick.Nickname + ' has joined ' + message.Channel);
- addOutput(message.Channel, msg);
- };
-
- irc.client.inviteChannel = function (message) {
- var msg = formatMessage(message.TimeStamp, ' * ' + message.Requester.Nickname + ' invited ' + message.Recipient.Nickname);
- addOutput(message.Channel, msg);
- };
-
- irc.client.partChannel = function (message) {
- var msg = formatMessage(message.TimeStamp, message.Nick.Nickname + ' has left ' + message.Channel);
- addOutput(message.Channel, msg);
- };
-
- irc.client.quit = function (message) {
- var quitMsg = message.Nick.Nickname;
- if (message.Message != '') {
- quitMsg = message.Message;
- }
- var msg = formatMessage(message.TimeStamp, message.Nick.Nickname + ' has quit: (' + quitMsg + ')');
- addOutput(message.Channel, msg);
- };
-
- irc.client.kick = function (message) {
- var msg = formatMessage(message.TimeStamp, ' * ' + message.Nick.Nickname + ' has kicked ' + message.KickedNick.Nickname + ' (' + message.Reason + ')');
- addOutput(message.Channel, msg);
- };
-
- irc.client.topicChange = function (message) {
- var msg = formatMessage(message.TimeStamp, ' * ' + message.Nick.Nickname + ' has changed the topic to: ' + message.Topic);
- addOutput(message.Channel, msg);
- };
-
- irc.client.userModeChange = function (message, modes) {
- var msg = formatMessage(message.TimeStamp, ' * ' + message.Nick.Nickname + ' sets mode ' + modes);
- addOutput(currentLocation, msg);
- };
-
- irc.client.nickChange = function (message) {
- var msg = formatMessage(message.TimeStamp, ' * ' + message.OldNick.Nickname + ' is now known as ' + message.NewNick.Nickname);
- addOutput(currentLocation, msg);
- };
-
- irc.client.serverReply = function (message) {
- var msg = formatMessage(message.TimeStamp, '*: ' + message.Message);
- addOutput(serverView, msg);
- };
-
- irc.client.serverError = function (message) {
- var msg = formatMessage(message.TimeStamp, '*: ' + message.Message);
- addOutput(serverView, msg);
- };
-
- irc.client.connected = function () {
- connected = true;
- };
-
- irc.client.disconnected = function () {
- connected = false;
- };
-
- irc.client.exception = function (exception) {
- $("#top_msg").css('display', 'inline', 'important');
- $("#top_msg").html('× ' + exception + '
');
- };
-
- irc.client.nickChanged = function (nickname) {
- currentNick = nickname;
- $('#clientTitle').html('Logged in as: ' + nickname + '
');
- };
-
- $.connection.hub.start();
-});
-
-function formatMessage(timeStamp, message) {
- var timeStamp = new Date(timeStamp);
- var msg = '[' + timeStamp.getHours() + ':' + timeStamp.getMinutes() + ':' + timeStamp.getSeconds() + '] : ' + message;
- return msg;
-}
-
-function addOutput(location, message) {
- // If the current view is the same location as the output, append it to the view
- if (currentLocation == location) {
- var txt = $('#clientOutput');
- if (txt.text() == '') {
- txt.text(message);
- }
- else {
- txt.text(txt.text() + '\n' + message);
- }
- txt.scrollTop(txt[0].scrollHeight);
- }
-
- // Add it to the in memory buffer for this location
- var clientView = getClientView(location);
- if (clientView) {
- clientView.output.push(message);
- }
-}
-
-function changeClientView(location) {
- var clientView = getClientView(location);
- if (clientView) {
- currentLocation = location;
- $('#clientOutput').text(clientView.output.join('\n'));
- $('#clientOutput').scrollTop($('#clientOutput')[0].scrollHeight);
- }
-}
-
-function getClientView(location) {
- // Get the item from the master list
- var foundView = clientViews.find(function (item) {
- return item.location === location;
- });
- if (!foundView) {
- foundView = createClientView(location);
- }
- return foundView;
-}
-
-function createClientView(location) {
- // Create new view item
- var item = { location: location, output: [] };
- clientViews.push(item);
- // Add the new location to the UI
- var itemDiv = $('' + location + ' ');
- itemDiv.find('a').click(function () {
- changeClientView(location);
- });
- $('#locationList').append(itemDiv);
- return item;
-}
\ No newline at end of file
diff --git a/Teknik/Areas/IRC/ViewModels/ClientViewModel.cs b/Teknik/Areas/IRC/ViewModels/ClientViewModel.cs
deleted file mode 100644
index 5e8068a..0000000
--- a/Teknik/Areas/IRC/ViewModels/ClientViewModel.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Web;
-using Teknik.ViewModels;
-
-namespace Teknik.Areas.IRC.ViewModels
-{
- public class ClientViewModel : ViewModelBase
- {
- }
-}
\ No newline at end of file
diff --git a/Teknik/Areas/IRC/Views/IRC/Client.cshtml b/Teknik/Areas/IRC/Views/IRC/Client.cshtml
deleted file mode 100644
index d4da5ea..0000000
--- a/Teknik/Areas/IRC/Views/IRC/Client.cshtml
+++ /dev/null
@@ -1,90 +0,0 @@
-@model Teknik.Areas.IRC.ViewModels.ClientViewModel
-
-@using Teknik.Utilities
-
-@Styles.Render("~/Content/irc")
-
-@if (Model.Config.UserConfig.LoginEnabled)
-{
-
-
-
-
-
-
-
-
- @if (Model.Error)
- {
-
×
- }
-
-
-
-
-
-
-
-
-}
-
-
-
-
-
Teknik IRC Web Client
-
-
-
-
-
-
-
Sign In as Guest
-
or
-
Sign In with Teknik Account
-
-
-
-
Enter as Guest
-
Sign In
-
-
-
-
-
-@Scripts.Render("~/bundles/signalr")
-@Scripts.Render("~/signalr/hubs")
-@Scripts.Render("~/bundles/irc")
\ No newline at end of file
diff --git a/Teknik/Areas/IRC/Views/_ViewStart.cshtml b/Teknik/Areas/IRC/Views/_ViewStart.cshtml
deleted file mode 100644
index 2de6241..0000000
--- a/Teknik/Areas/IRC/Views/_ViewStart.cshtml
+++ /dev/null
@@ -1,3 +0,0 @@
-@{
- Layout = "~/Views/Shared/_Layout.cshtml";
-}
diff --git a/Teknik/Areas/IRC/Views/web.config b/Teknik/Areas/IRC/Views/web.config
deleted file mode 100644
index 013d8bf..0000000
--- a/Teknik/Areas/IRC/Views/web.config
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Teknik/Areas/Paste/Controllers/PasteController.cs b/Teknik/Areas/Paste/Controllers/PasteController.cs
index e479318..2f21e08 100644
--- a/Teknik/Areas/Paste/Controllers/PasteController.cs
+++ b/Teknik/Areas/Paste/Controllers/PasteController.cs
@@ -1,13 +1,7 @@
using System;
using System.Collections.Generic;
-using System.Data.Entity;
using System.Linq;
-using System.Security.Cryptography;
using System.Text;
-using System.Web;
-using System.Web.Mvc;
-using Teknik.Pygments;
-using Teknik.Areas.Error.Controllers;
using Teknik.Areas.Paste.ViewModels;
using Teknik.Areas.Users.Utility;
using Teknik.Controllers;
@@ -16,17 +10,28 @@ using Teknik.Utilities;
using Teknik.Models;
using Teknik.Attributes;
using Teknik.Utilities.Cryptography;
+using Microsoft.Extensions.Logging;
+using Teknik.Configuration;
+using Teknik.Data;
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.AspNetCore.Http;
+using Teknik.Logging;
namespace Teknik.Areas.Paste.Controllers
{
[TeknikAuthorize]
+ [Area("Paste")]
public class PasteController : DefaultController
{
+ public PasteController(ILogger logger, Config config, TeknikEntities dbContext) : base(logger, config, dbContext) { }
+
[TrackPageView]
[AllowAnonymous]
- public ActionResult Index()
+ public IActionResult Index()
{
- ViewBag.Title = "Paste - " + Config.Title;
+ ViewBag.Title = "Paste - " + _config.Title;
ViewBag.Description = "Paste your code or text easily and securely. Set an expiration, set a password, or leave it open for the world to see.";
PasteCreateViewModel model = new PasteCreateViewModel();
return View(model);
@@ -34,25 +39,24 @@ namespace Teknik.Areas.Paste.Controllers
[TrackDownload]
[AllowAnonymous]
- public ActionResult ViewPaste(string type, string url, string password)
+ public IActionResult ViewPaste(string type, string url, string password)
{
- TeknikEntities db = new TeknikEntities();
- Models.Paste paste = db.Pastes.Where(p => p.Url == url).FirstOrDefault();
+ Models.Paste paste = _dbContext.Pastes.Where(p => p.Url == url).FirstOrDefault();
if (paste != null)
{
- ViewBag.Title = ((string.IsNullOrEmpty(paste.Title)) ? string.Empty : paste.Title + " - ") + Config.Title + " Paste";
+ ViewBag.Title = ((string.IsNullOrEmpty(paste.Title)) ? string.Empty : paste.Title + " - ") + _config.Title + " Paste";
ViewBag.Description = "Paste your code or text easily and securely. Set an expiration, set a password, or leave it open for the world to see.";
// Increment Views
paste.Views += 1;
- db.Entry(paste).State = EntityState.Modified;
- db.SaveChanges();
+ _dbContext.Entry(paste).State = EntityState.Modified;
+ _dbContext.SaveChanges();
// Check Expiration
if (PasteHelper.CheckExpiration(paste))
{
- db.Pastes.Remove(paste);
- db.SaveChanges();
- return Redirect(Url.SubRouteUrl("error", "Error.Http404"));
+ _dbContext.Pastes.Remove(paste);
+ _dbContext.SaveChanges();
+ return new StatusCodeResult(StatusCodes.Status404NotFound);
}
PasteViewModel model = new PasteViewModel();
@@ -66,7 +70,7 @@ namespace Teknik.Areas.Paste.Controllers
if (User.Identity.IsAuthenticated && type.ToLower() == "full")
{
- Users.Models.User user = UserHelper.GetUser(db, User.Identity.Name);
+ Users.Models.User user = UserHelper.GetUser(_dbContext, User.Identity.Name);
if (user != null)
{
model.Vaults = user.Vaults.ToList();
@@ -79,7 +83,7 @@ namespace Teknik.Areas.Paste.Controllers
string hash = string.Empty;
if (!string.IsNullOrEmpty(password))
{
- byte[] passBytes = Utilities.Cryptography.SHA384.Hash(paste.Key, password);
+ byte[] passBytes = SHA384.Hash(paste.Key, password);
hash = passBytes.ToHex();
// We need to convert old pastes to the new password scheme
if (paste.Transfers.ToList().Exists(t => t.Type == TransferTypes.ASCIIPassword))
@@ -87,8 +91,8 @@ namespace Teknik.Areas.Paste.Controllers
hash = Encoding.ASCII.GetString(passBytes);
// Remove the transfer types
paste.Transfers.Clear();
- db.Entry(paste).State = EntityState.Modified;
- db.SaveChanges();
+ _dbContext.Entry(paste).State = EntityState.Modified;
+ _dbContext.SaveChanges();
}
}
if (string.IsNullOrEmpty(password) || hash != paste.HashedPassword)
@@ -111,13 +115,13 @@ namespace Teknik.Areas.Paste.Controllers
if (type.ToLower() == "full" || type.ToLower() == "simple")
{
// Transform content into HTML
- if (!Highlighter.Lexers.ToList().Exists(l => l.Aliases.Contains(model.Syntax)))
- {
- model.Syntax = "text";
- }
- Highlighter highlighter = new Highlighter();
+ //if (!Highlighter.Lexers.ToList().Exists(l => l.Aliases.Contains(model.Syntax)))
+ //{
+ // model.Syntax = "text";
+ //}
+ //Highlighter highlighter = new Highlighter();
// Add a space in front of the content due to bug with pygment (No idea why yet)
- model.Content = highlighter.HighlightToHtml(" " + model.Content, model.Syntax, Config.PasteConfig.SyntaxVisualStyle, generateInlineStyles: true, fragment: true);
+ model.Content = model.Content;//highlighter.HighlightToHtml(" " + model.Content, model.Syntax, _config.PasteConfig.SyntaxVisualStyle, generateInlineStyles: true, fragment: true);
}
switch (type.ToLower())
@@ -136,56 +140,53 @@ namespace Teknik.Areas.Paste.Controllers
Inline = true
};
- Response.AppendHeader("Content-Disposition", cd.ToString());
+ Response.Headers.Add("Content-Disposition", cd.ToString());
return File(data, "application/octet-stream");
default:
return View("~/Areas/Paste/Views/Paste/Full.cshtml", model);
}
}
- return Redirect(Url.SubRouteUrl("error", "Error.Http404"));
+ return new StatusCodeResult(StatusCodes.Status404NotFound);
}
[HttpPost]
[AllowAnonymous]
- public ActionResult Paste([Bind(Include = "Content, Title, Syntax, ExpireLength, ExpireUnit, Password, Hide")]PasteCreateViewModel model)
+ public IActionResult Paste([Bind("Content, Title, Syntax, ExpireLength, ExpireUnit, Password, Hide")]PasteCreateViewModel model)
{
if (ModelState.IsValid)
{
- if (Config.PasteConfig.Enabled)
+ if (_config.PasteConfig.Enabled)
{
try
{
- using (TeknikEntities db = new TeknikEntities())
+ Models.Paste paste = PasteHelper.CreatePaste(_config, _dbContext, model.Content, model.Title, model.Syntax, model.ExpireUnit, model.ExpireLength ?? 1, model.Password, model.Hide);
+
+ if (model.ExpireUnit == "view")
{
- Models.Paste paste = PasteHelper.CreatePaste(db, model.Content, model.Title, model.Syntax, model.ExpireUnit, model.ExpireLength ?? 1, model.Password, model.Hide);
-
- if (model.ExpireUnit == "view")
- {
- paste.Views = -1;
- }
-
- if (User.Identity.IsAuthenticated)
- {
- Users.Models.User user = UserHelper.GetUser(db, User.Identity.Name);
- if (user != null)
- {
- paste.UserId = user.UserId;
- }
- }
-
- db.Pastes.Add(paste);
- db.SaveChanges();
-
- return Redirect(Url.SubRouteUrl("p", "Paste.View", new { type = "Full", url = paste.Url }));
+ paste.Views = -1;
}
+
+ if (User.Identity.IsAuthenticated)
+ {
+ Users.Models.User user = UserHelper.GetUser(_dbContext, User.Identity.Name);
+ if (user != null)
+ {
+ paste.UserId = user.UserId;
+ }
+ }
+
+ _dbContext.Pastes.Add(paste);
+ _dbContext.SaveChanges();
+
+ return Redirect(Url.SubRouteUrl("p", "Paste.View", new { type = "Full", url = paste.Url }));
}
catch (Exception ex)
{
return Redirect(Url.SubRouteUrl("error", "Error.500", new { exception = ex }));
}
}
- Redirect(Url.SubRouteUrl("error", "Error.Http403"));
+ return new StatusCodeResult(StatusCodes.Status403Forbidden);
}
return View("~/Areas/Paste/Views/Paste/Index.cshtml", model);
}
diff --git a/Teknik/Areas/Paste/PasteAreaRegistration.cs b/Teknik/Areas/Paste/PasteAreaRegistration.cs
deleted file mode 100644
index 37550bb..0000000
--- a/Teknik/Areas/Paste/PasteAreaRegistration.cs
+++ /dev/null
@@ -1,94 +0,0 @@
-using System.Collections.Generic;
-using System.Web.Mvc;
-using System.Web.Optimization;
-using Teknik.Configuration;
-using Teknik.Controllers;
-using Teknik.Utilities;
-
-namespace Teknik.Areas.Paste
-{
- public class PasteAreaRegistration : AreaRegistration
- {
- public override string AreaName
- {
- get
- {
- return "Paste";
- }
- }
-
- public override void RegisterArea(AreaRegistrationContext context)
- {
- Config config = Config.Load();
- context.MapSubdomainRoute(
- "Paste.Index", // Route name
- new List() { "paste", "p" },
- new List() { config.Host }, // domains
- "", // URL with parameters
- new { controller = "Paste", action = "Index" }, // Parameter defaults
- new[] { typeof(Controllers.PasteController).Namespace }
- );
- context.MapSubdomainRoute(
- "Paste.Favicon",
- new List() { "paste", "p" }, // Subdomains
- new List() { config.Host }, // domains
- "favicon.ico",
- new { controller = "Default", action = "Favicon" },
- new[] { typeof(DefaultController).Namespace }
- );
- context.MapSubdomainRoute(
- "Paste.Simple", // Route name
- new List() { "paste", "p" },
- new List() { config.Host }, // domains
- "Simple/{url}", // URL with parameters
- new { controller = "Paste", action = "ViewPaste", type = "Simple" }, // Parameter defaults
- new[] { typeof(Controllers.PasteController).Namespace }
- );
- context.MapSubdomainRoute(
- "Paste.Raw", // Route name
- new List() { "paste", "p" },
- new List() { config.Host }, // domains
- "Raw/{url}", // URL with parameters
- new { controller = "Paste", action = "ViewPaste", type = "Raw" }, // Parameter defaults
- new[] { typeof(Controllers.PasteController).Namespace }
- );
- context.MapSubdomainRoute(
- "Paste.Download", // Route name
- new List() { "paste", "p" },
- new List() { config.Host }, // domains
- "Download/{url}", // URL with parameters
- new { controller = "Paste", action = "ViewPaste", type = "Download" }, // Parameter defaults
- new[] { typeof(Controllers.PasteController).Namespace }
- );
- context.MapSubdomainRoute(
- "Paste.Action", // Route name
- new List() { "paste", "p" },
- new List() { config.Host }, // domains
- "Action/{action}", // URL with parameters
- new { controller = "Paste", action = "Index" }, // Parameter defaults
- new[] { typeof(Controllers.PasteController).Namespace }
- );
- context.MapSubdomainRoute(
- "Paste.View", // Route name
- new List() { "paste", "p" },
- new List() { config.Host }, // domains
- "{url}", // URL with parameters
- new { controller = "Paste", action = "ViewPaste", type = "Full" }, // Parameter defaults
- new[] { typeof(Controllers.PasteController).Namespace }
- );
-
- // Register Script Bundles
- BundleTable.Bundles.Add(new CdnScriptBundle("~/bundles/paste", config.CdnHost).Include(
- "~/Scripts/Highlight/highlight.pack.js",
- "~/Areas/Paste/Scripts/Paste.js"));
- BundleTable.Bundles.Add(new CdnScriptBundle("~/bundles/syntaxWorker", config.CdnHost).Include(
- "~/Areas/Paste/Scripts/SyntaxWorker.js"));
- BundleTable.Bundles.Add(new CdnScriptBundle("~/bundles/highlight", config.CdnHost).Include(
- "~/Scripts/Highlight/highlight.pack.js"));
- // Register Style Bundles
- BundleTable.Bundles.Add(new CdnStyleBundle("~/Content/paste", config.CdnHost).Include(
- "~/Content/Highlight/github-gist.css",
- "~/Areas/Paste/Content/Paste.css"));
- }
- }
-}
\ No newline at end of file
diff --git a/Teknik/Areas/Paste/PasteHelper.cs b/Teknik/Areas/Paste/PasteHelper.cs
index ba2f4b1..82b5a03 100644
--- a/Teknik/Areas/Paste/PasteHelper.cs
+++ b/Teknik/Areas/Paste/PasteHelper.cs
@@ -7,15 +7,15 @@ using Teknik.Configuration;
using Teknik.Utilities;
using Teknik.Models;
using Teknik.Utilities.Cryptography;
+using Teknik.Data;
namespace Teknik.Areas.Paste
{
public static class PasteHelper
{
- public static Models.Paste CreatePaste(TeknikEntities db, string content, string title = "", string syntax = "text", string expireUnit = "never", int expireLength = 1, string password = "", bool hide = false)
+ public static Models.Paste CreatePaste(Config config, TeknikEntities db, string content, string title = "", string syntax = "text", string expireUnit = "never", int expireLength = 1, string password = "", bool hide = false)
{
- Config config = Config.Load();
- Models.Paste paste = db.Pastes.Create();
+ Models.Paste paste = new Models.Paste();
paste.DatePosted = DateTime.Now;
paste.MaxViews = 0;
paste.Views = 0;
diff --git a/Teknik/Areas/Paste/ViewModels/PasteCreateViewModel.cs b/Teknik/Areas/Paste/ViewModels/PasteCreateViewModel.cs
index 4bd2f3e..0d28afd 100644
--- a/Teknik/Areas/Paste/ViewModels/PasteCreateViewModel.cs
+++ b/Teknik/Areas/Paste/ViewModels/PasteCreateViewModel.cs
@@ -1,9 +1,4 @@
-using System;
-using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
-using System.Linq;
-using System.Web;
-using System.Web.Mvc;
using Teknik.ViewModels;
namespace Teknik.Areas.Paste.ViewModels
@@ -11,7 +6,6 @@ namespace Teknik.Areas.Paste.ViewModels
public class PasteCreateViewModel : ViewModelBase
{
[Required]
- [AllowHtml]
public string Content { get; set; }
public string Title { get; set; }
@@ -22,8 +16,7 @@ namespace Teknik.Areas.Paste.ViewModels
public int? ExpireLength { get; set; }
public string ExpireUnit { get; set; }
-
- [AllowHtml]
+
public string Password { get; set; }
public bool Hide { get; set; }
diff --git a/Teknik/Areas/Paste/ViewModels/PasteViewModel.cs b/Teknik/Areas/Paste/ViewModels/PasteViewModel.cs
index 46d543e..95f2ac9 100644
--- a/Teknik/Areas/Paste/ViewModels/PasteViewModel.cs
+++ b/Teknik/Areas/Paste/ViewModels/PasteViewModel.cs
@@ -1,9 +1,5 @@
using System;
using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Web.Mvc;
using Teknik.ViewModels;
namespace Teknik.Areas.Paste.ViewModels
@@ -11,11 +7,9 @@ namespace Teknik.Areas.Paste.ViewModels
public class PasteViewModel : ViewModelBase
{
public string Url { get; set; }
- [AllowHtml]
public string Content { get; set; }
public string Title { get; set; }
public string Syntax { get; set; }
- [AllowHtml]
public string Password { get; set; }
public bool Hide { get; set; }
public DateTime DatePosted { get; set; }
diff --git a/Teknik/Areas/Paste/Views/Paste/Full.cshtml b/Teknik/Areas/Paste/Views/Paste/Full.cshtml
index 84f20b5..a45f860 100644
--- a/Teknik/Areas/Paste/Views/Paste/Full.cshtml
+++ b/Teknik/Areas/Paste/Views/Paste/Full.cshtml
@@ -1,11 +1,10 @@
@model Teknik.Areas.Paste.ViewModels.PasteViewModel
-@using Teknik.Utilities
@using Teknik.Areas.Vault.Models
-@Styles.Render("~/Content/paste")
+
-
@@ -42,4 +41,4 @@
-@Scripts.Render("~/bundles/paste")
+
diff --git a/Teknik/Areas/Paste/Views/Paste/Index.cshtml b/Teknik/Areas/Paste/Views/Paste/Index.cshtml
index ce32237..deb767a 100644
--- a/Teknik/Areas/Paste/Views/Paste/Index.cshtml
+++ b/Teknik/Areas/Paste/Views/Paste/Index.cshtml
@@ -1,10 +1,8 @@
@model Teknik.Areas.Paste.ViewModels.PasteCreateViewModel
-@using Teknik.Utilities
-@using Teknik.Pygments
+@*@using Teknik.Pygments*@
-@Styles.Render("~/Content/paste")
-@Scripts.Render("~/bundles/paste")
+
@@ -33,12 +31,12 @@
Syntax
- Text only
+ Text only!option>
@{
- foreach (Highlighter.Lexer format in Highlighter.Lexers.OrderBy(l => l.Name))
+ @*foreach (Highlighter.Lexer format in Highlighter.Lexers.OrderBy(l => l.Name))
{
@format.Name
- }
+ }*@
}
@@ -50,13 +48,13 @@
- Never
- Views
- Minutes
- Hours
- Days
- Months
- Years
+ Never!option>
+ Views!option>
+ Minutes!option>
+ Hours!option>
+ Days!option>
+ Months!option>
+ Years!option>
@@ -83,7 +81,9 @@
-