Browse Source
Added PGP Public Key adding for users and a method to view/link raw pgp key. Updated multiple packages.pull/29/head
63 changed files with 890 additions and 526 deletions
@ -1,82 +0,0 @@
@@ -1,82 +0,0 @@
|
||||
using System.Collections.Generic; |
||||
using System.Web.Mvc; |
||||
using System.Web.Optimization; |
||||
using Teknik.Configuration; |
||||
|
||||
namespace Teknik.Areas.Profile |
||||
{ |
||||
public class ProfileAreaRegistration : AreaRegistration |
||||
{ |
||||
public override string AreaName |
||||
{ |
||||
get |
||||
{ |
||||
return "Profile"; |
||||
} |
||||
} |
||||
|
||||
public override void RegisterArea(AreaRegistrationContext context) |
||||
{ |
||||
Config config = Config.Load(); |
||||
context.MapSubdomainRoute( |
||||
"Profile.Login", // Route name
|
||||
new List<string>() { "profile" }, // Subdomains
|
||||
new List<string>() { config.Host }, // domains
|
||||
"Login", // URL with parameters
|
||||
new { controller = "Profile", action = "Login" }, // Parameter defaults
|
||||
new[] { typeof(Controllers.ProfileController).Namespace } |
||||
); |
||||
context.MapSubdomainRoute( |
||||
"Profile.Logout", // Route name
|
||||
new List<string>() { "profile" }, // Subdomains
|
||||
new List<string>() { config.Host }, // domains
|
||||
"Logout", // URL with parameters
|
||||
new { controller = "Profile", action = "Logout" }, // Parameter defaults
|
||||
new[] { typeof(Controllers.ProfileController).Namespace } |
||||
); |
||||
context.MapSubdomainRoute( |
||||
"Profile.Register", // Route name
|
||||
new List<string>() { "profile" }, // Subdomains
|
||||
new List<string>() { config.Host }, // domains
|
||||
"Register", // URL with parameters
|
||||
new { controller = "Profile", action = "Register" }, // Parameter defaults
|
||||
new[] { typeof(Controllers.ProfileController).Namespace } |
||||
); |
||||
context.MapSubdomainRoute( |
||||
"Profile.Settings", // Route name
|
||||
new List<string>() { "profile" }, // Subdomains
|
||||
new List<string>() { config.Host }, // domains
|
||||
"Settings", // URL with parameters
|
||||
new { controller = "Profile", action = "Settings" }, // Parameter defaults
|
||||
new[] { typeof(Controllers.ProfileController).Namespace } |
||||
); |
||||
context.MapSubdomainRoute( |
||||
"Profile.Index", // Route name
|
||||
new List<string>() { "profile" }, // Subdomains
|
||||
new List<string>() { config.Host }, // domains
|
||||
"{username}", // URL with parameters
|
||||
new { controller = "Profile", action = "Index", username = UrlParameter.Optional }, // Parameter defaults
|
||||
new[] { typeof(Controllers.ProfileController).Namespace } |
||||
); |
||||
context.MapSubdomainRoute( |
||||
"Profile.Action", // Route name
|
||||
new List<string>() { "profile" }, // Subdomains
|
||||
new List<string>() { config.Host }, // domains
|
||||
"Action/{action}", // URL with parameters
|
||||
new { controller = "Profile", action = "Index" }, // Parameter defaults
|
||||
new[] { typeof(Controllers.ProfileController).Namespace } |
||||
); |
||||
|
||||
// Register Script Bundle
|
||||
BundleTable.Bundles.Add(new ScriptBundle("~/bundles/profile").Include( |
||||
"~/Scripts/bootbox/bootbox.min.js", |
||||
"~/Scripts/jquery.blockUI.js", |
||||
"~/Scripts/bootstrap-switch.js", |
||||
"~/Areas/Profile/Scripts/Profile.js")); |
||||
|
||||
// Register Style Bundles
|
||||
BundleTable.Bundles.Add(new StyleBundle("~/Content/profile").Include( |
||||
"~/Content/bootstrap-switch/bootstrap3/bootstrap-switch.css")); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,90 @@
@@ -0,0 +1,90 @@
|
||||
using System.Collections.Generic; |
||||
using System.Web.Mvc; |
||||
using System.Web.Optimization; |
||||
using Teknik.Configuration; |
||||
|
||||
namespace Teknik.Areas.Users |
||||
{ |
||||
public class UserAreaRegistration : AreaRegistration |
||||
{ |
||||
public override string AreaName |
||||
{ |
||||
get |
||||
{ |
||||
return "User"; |
||||
} |
||||
} |
||||
|
||||
public override void RegisterArea(AreaRegistrationContext context) |
||||
{ |
||||
Config config = Config.Load(); |
||||
context.MapSubdomainRoute( |
||||
"User.Login", // Route name
|
||||
new List<string>() { "user" }, // Subdomains
|
||||
new List<string>() { config.Host }, // domains
|
||||
"Login", // URL with parameters
|
||||
new { controller = "User", action = "Login" }, // Parameter defaults
|
||||
new[] { typeof(Controllers.UserController).Namespace } |
||||
); |
||||
context.MapSubdomainRoute( |
||||
"User.Logout", // Route name
|
||||
new List<string>() { "user" }, // Subdomains
|
||||
new List<string>() { config.Host }, // domains
|
||||
"Logout", // URL with parameters
|
||||
new { controller = "User", action = "Logout" }, // Parameter defaults
|
||||
new[] { typeof(Controllers.UserController).Namespace } |
||||
); |
||||
context.MapSubdomainRoute( |
||||
"User.Register", // Route name
|
||||
new List<string>() { "user" }, // Subdomains
|
||||
new List<string>() { config.Host }, // domains
|
||||
"Register", // URL with parameters
|
||||
new { controller = "User", action = "Register" }, // Parameter defaults
|
||||
new[] { typeof(Controllers.UserController).Namespace } |
||||
); |
||||
context.MapSubdomainRoute( |
||||
"User.Settings", // Route name
|
||||
new List<string>() { "user" }, // Subdomains
|
||||
new List<string>() { config.Host }, // domains
|
||||
"Settings", // URL with parameters
|
||||
new { controller = "User", action = "Settings" }, // Parameter defaults
|
||||
new[] { typeof(Controllers.UserController).Namespace } |
||||
); |
||||
context.MapSubdomainRoute( |
||||
"User.Index", // Route name
|
||||
new List<string>() { "user" }, // Subdomains
|
||||
new List<string>() { config.Host }, // domains
|
||||
"{username}", // URL with parameters
|
||||
new { controller = "User", action = "Index", username = UrlParameter.Optional }, // Parameter defaults
|
||||
new[] { typeof(Controllers.UserController).Namespace } |
||||
); |
||||
context.MapSubdomainRoute( |
||||
"User.PGPKey", // Route name
|
||||
new List<string>() { "user" }, // Subdomains
|
||||
new List<string>() { config.Host }, // domains
|
||||
"{username}/PGP", // URL with parameters
|
||||
new { controller = "User", action = "ViewRawPGP" }, // Parameter defaults
|
||||
new[] { typeof(Controllers.UserController).Namespace } |
||||
); |
||||
context.MapSubdomainRoute( |
||||
"User.Action", // Route name
|
||||
new List<string>() { "user" }, // Subdomains
|
||||
new List<string>() { config.Host }, // domains
|
||||
"Action/{action}", // URL with parameters
|
||||
new { controller = "User", action = "Index" }, // Parameter defaults
|
||||
new[] { typeof(Controllers.UserController).Namespace } |
||||
); |
||||
|
||||
// Register Script Bundle
|
||||
BundleTable.Bundles.Add(new ScriptBundle("~/bundles/user").Include( |
||||
"~/Scripts/bootbox/bootbox.min.js", |
||||
"~/Scripts/jquery.blockUI.js", |
||||
"~/Scripts/bootstrap-switch.js", |
||||
"~/Areas/User/Scripts/User.js")); |
||||
|
||||
// Register Style Bundles
|
||||
BundleTable.Bundles.Add(new StyleBundle("~/Content/user").Include( |
||||
"~/Content/bootstrap-switch/bootstrap3/bootstrap-switch.css")); |
||||
} |
||||
} |
||||
} |
@ -1,11 +1,11 @@
@@ -1,11 +1,11 @@
|
||||
using System; |
||||
using System.ComponentModel.DataAnnotations; |
||||
using Teknik.Areas.Profile.Models; |
||||
using Teknik.Areas.Users.Models; |
||||
using Teknik.Helpers; |
||||
using Teknik.Models; |
||||
using Teknik.ViewModels; |
||||
|
||||
namespace Teknik.Areas.Profile.ViewModels |
||||
namespace Teknik.Areas.Users.ViewModels |
||||
{ |
||||
public class RegisterViewModel : ViewModelBase |
||||
{ |
@ -1,8 +1,8 @@
@@ -1,8 +1,8 @@
|
||||
@model Teknik.Areas.Profile.ViewModels.LoginViewModel |
||||
@model Teknik.Areas.Users.ViewModels.LoginViewModel |
||||
|
||||
@if (Model.Config.UserConfig.LoginEnabled) |
||||
{ |
||||
<form role="form" id="loginForm" action="@Url.SubRouteUrl("profile", "Profile.Login")" method="post" accept-charset="UTF-8"> |
||||
<form role="form" id="loginForm" action="@Url.SubRouteUrl("user", "User.Login")" method="post" accept-charset="UTF-8"> |
||||
<input name="ReturnUrl" id="ReturnUrl" type="hidden" value="@Model.ReturnUrl" /> |
||||
<div class="form-group"> |
||||
<input type="text" class="form-control" id="Username" value="" placeholder="Username" name="Username" data-val-required="The Username field is required." data-val="true" /> |
@ -1,8 +1,8 @@
@@ -1,8 +1,8 @@
|
||||
@model Teknik.Areas.Profile.ViewModels.RegisterViewModel |
||||
@model Teknik.Areas.Users.ViewModels.RegisterViewModel |
||||
|
||||
@if (Model.Config.UserConfig.RegistrationEnabled) |
||||
{ |
||||
<form role="form" id="registrationForm" action="@Url.SubRouteUrl("profile", "Profile.Register")" method="post" accept-charset="UTF-8"> |
||||
<form role="form" id="registrationForm" action="@Url.SubRouteUrl("user", "User.Register")" method="post" accept-charset="UTF-8"> |
||||
<input name="ReturnUrl" id="ReturnUrl" type="hidden" value="@Model.ReturnUrl" /> |
||||
<div class="form-group"> |
||||
<input type="text" class="form-control" id="Username" value="" placeholder="Username" name="Username" data-val-required="The Username field is required." data-val="true"/> |
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long