diff --git a/.gitignore b/.gitignore index 70dc36a..f461738 100644 --- a/.gitignore +++ b/.gitignore @@ -187,4 +187,7 @@ FakesAssemblies/ # LightSwitch generated files GeneratedArtifacts/ _Pvt_Extensions/ -ModelManifest.xml \ No newline at end of file +ModelManifest.xml +/Teknik/ConnectionStrings.config +/Teknik/App_Data/Config.json +/.vs/config/applicationhost.config diff --git a/Teknik/Areas/Error/Controllers/ErrorController.cs b/Teknik/Areas/Error/Controllers/ErrorController.cs new file mode 100644 index 0000000..50ce1c0 --- /dev/null +++ b/Teknik/Areas/Error/Controllers/ErrorController.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.Mvc; +using Teknik.Controllers; + +namespace Teknik.Areas.Error.Controllers +{ + public class ErrorController : DefaultController + { + // GET: Error/Error + public ActionResult Index() + { + return View(); + } + + public ActionResult Http404() + { + return View(); + } + } +} \ No newline at end of file diff --git a/Teknik/Areas/Error/ErrorAreaRegistration.cs b/Teknik/Areas/Error/ErrorAreaRegistration.cs new file mode 100644 index 0000000..3af3d12 --- /dev/null +++ b/Teknik/Areas/Error/ErrorAreaRegistration.cs @@ -0,0 +1,25 @@ +using System.Web.Mvc; + +namespace Teknik.Areas.Error +{ + public class ErrorAreaRegistration : AreaRegistration + { + public override string AreaName + { + get + { + return "Error"; + } + } + + public override void RegisterArea(AreaRegistrationContext context) + { + context.MapRoute( + "404-PageNotFound", + "{*url}", + new { controller = "ErrorController", action = "Http404" }, // Parameter defaults + new[] { typeof(Controllers.ErrorController).Namespace } + ); + } + } +} \ No newline at end of file diff --git a/Teknik/Areas/Error/ViewModels/ErrorViewModel.cs b/Teknik/Areas/Error/ViewModels/ErrorViewModel.cs new file mode 100644 index 0000000..08c0f24 --- /dev/null +++ b/Teknik/Areas/Error/ViewModels/ErrorViewModel.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Teknik.ViewModels; + +namespace Teknik.Areas.Error.ViewModels +{ + public class ErrorViewModel : ViewModelBase + { + } +} diff --git a/Teknik/Areas/Error/Views/Error/Http404.cshtml b/Teknik/Areas/Error/Views/Error/Http404.cshtml new file mode 100644 index 0000000..30077aa --- /dev/null +++ b/Teknik/Areas/Error/Views/Error/Http404.cshtml @@ -0,0 +1,21 @@ +@model Teknik.Areas.Error.ViewModels.ErrorViewModel + +
+
+
+
+

Oops!

+

404 Not Found

+
+ Sorry, an error has occured, Requested page not found! +
+ +
+
+
+
+ diff --git a/Teknik/Areas/Error/Views/_ViewStart.cshtml b/Teknik/Areas/Error/Views/_ViewStart.cshtml new file mode 100644 index 0000000..2de6241 --- /dev/null +++ b/Teknik/Areas/Error/Views/_ViewStart.cshtml @@ -0,0 +1,3 @@ +@{ + Layout = "~/Views/Shared/_Layout.cshtml"; +} diff --git a/Teknik/Areas/Error/Views/web.config b/Teknik/Areas/Error/Views/web.config new file mode 100644 index 0000000..ada5aaf --- /dev/null +++ b/Teknik/Areas/Error/Views/web.config @@ -0,0 +1,36 @@ + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Teknik/Areas/Profile/Controllers/ProfileController.cs b/Teknik/Areas/Profile/Controllers/ProfileController.cs index 09957ee..e8d4a20 100644 --- a/Teknik/Areas/Profile/Controllers/ProfileController.cs +++ b/Teknik/Areas/Profile/Controllers/ProfileController.cs @@ -70,6 +70,16 @@ namespace Teknik.Areas.Profile.Controllers return RedirectToAction("Index", "Home", new { Area = "Home" }); } + [HttpGet] + [AllowAnonymous] + // GET: Profile + public ActionResult Register() + { + RegisterViewModel model = new RegisterViewModel(); + + return View("/Areas/Profile/Views/Profile/ViewRegistration.cshtml", model); + } + [HttpPost] [AllowAnonymous] public ActionResult Register(RegisterViewModel model) diff --git a/Teknik/Areas/Profile/ProfileAreaRegistration.cs b/Teknik/Areas/Profile/ProfileAreaRegistration.cs index 3f70681..d868d28 100644 --- a/Teknik/Areas/Profile/ProfileAreaRegistration.cs +++ b/Teknik/Areas/Profile/ProfileAreaRegistration.cs @@ -21,6 +21,20 @@ namespace Teknik.Areas.Profile new { controller = "Profile", action = "Login" }, // Parameter defaults new[] { typeof(Controllers.ProfileController).Namespace } ); + context.MapSubdomainRoute( + "Profile_dev_logout", // Route name + "dev", + "Profile/Logout", // URL with parameters + new { controller = "Profile", action = "Logout" }, // Parameter defaults + new[] { typeof(Controllers.ProfileController).Namespace } + ); + context.MapSubdomainRoute( + "Profile_dev_Register", // Route name + "dev", + "Profile/Login", // URL with parameters + new { controller = "Profile", action = "Register" }, // Parameter defaults + new[] { typeof(Controllers.ProfileController).Namespace } + ); context.MapSubdomainRoute( "Profile_dev", // Route name "dev", @@ -35,13 +49,6 @@ namespace Teknik.Areas.Profile new { controller = "Profile", action = "Index" }, // Parameter defaults new[] { typeof(Controllers.ProfileController).Namespace } ); - context.MapSubdomainRoute( - "Profile_default", // Route name - "profile", - "{username}", // URL with parameters - new { controller = "Profile", action = "Index", username = UrlParameter.Optional }, // Parameter defaults - new[] { typeof(Controllers.ProfileController).Namespace } - ); context.MapSubdomainRoute( "Profile_default_login", // Route name "profile", @@ -49,6 +56,27 @@ namespace Teknik.Areas.Profile new { controller = "Profile", action = "Login" }, // Parameter defaults new[] { typeof(Controllers.ProfileController).Namespace } ); + context.MapSubdomainRoute( + "Profile_default_logout", // Route name + "profile", + "Logout", // URL with parameters + new { controller = "Profile", action = "Logout" }, // Parameter defaults + new[] { typeof(Controllers.ProfileController).Namespace } + ); + context.MapSubdomainRoute( + "Profile_default_register", // Route name + "profile", + "Register", // URL with parameters + new { controller = "Profile", action = "Register" }, // Parameter defaults + new[] { typeof(Controllers.ProfileController).Namespace } + ); + context.MapSubdomainRoute( + "Profile_default", // Route name + "profile", + "{username}", // URL with parameters + new { controller = "Profile", action = "Index", username = UrlParameter.Optional }, // Parameter defaults + new[] { typeof(Controllers.ProfileController).Namespace } + ); context.MapSubdomainRoute( "Profile_default_unique", // Route name "profile", diff --git a/Teknik/Areas/Profile/Views/Profile/ViewLogin.cshtml b/Teknik/Areas/Profile/Views/Profile/ViewLogin.cshtml index e5d4492..bb2c374 100644 --- a/Teknik/Areas/Profile/Views/Profile/ViewLogin.cshtml +++ b/Teknik/Areas/Profile/Views/Profile/ViewLogin.cshtml @@ -4,10 +4,10 @@
-

Stay Away!

+

No Access

403 Access Denied

- You aren't allowed to see this! If you think you are, then login below. + You aren't allowed to see this! If you think you are, then please login below.

diff --git a/Teknik/Areas/Profile/Views/Profile/ViewRegistration.cshtml b/Teknik/Areas/Profile/Views/Profile/ViewRegistration.cshtml new file mode 100644 index 0000000..e02abfc --- /dev/null +++ b/Teknik/Areas/Profile/Views/Profile/ViewRegistration.cshtml @@ -0,0 +1 @@ + diff --git a/Teknik/Areas/Upload/UploadAreaRegistration.cs b/Teknik/Areas/Upload/UploadAreaRegistration.cs index 0e78f80..eb76e35 100644 --- a/Teknik/Areas/Upload/UploadAreaRegistration.cs +++ b/Teknik/Areas/Upload/UploadAreaRegistration.cs @@ -53,21 +53,21 @@ namespace Teknik.Areas.Upload context.MapSubdomainRoute( "Upload_default_short_download", "u", - "Upload/{url}", + "{url}", new { controller = "Upload", action = "Download", url = "" }, new[] { typeof(Controllers.UploadController).Namespace } ); context.MapSubdomainRoute( "Upload_default_short_delete", "u", - "Upload/{url}/{deleteKey}", + "{url}/{deleteKey}", new { controller = "Upload", action = "Download", url = string.Empty, deleteKey = string.Empty }, new[] { typeof(Controllers.UploadController).Namespace } ); context.MapSubdomainRoute( "Upload_default_short_action", "u", - "Upload/Action/{controller}/{action}", + "Action/{controller}/{action}", new { controller = "Upload", action = "Index" }, new[] { typeof(Controllers.UploadController).Namespace } ); @@ -81,21 +81,21 @@ namespace Teknik.Areas.Upload context.MapSubdomainRoute( "Upload_default_long_download", "upload", - "Upload/{url}", + "{url}", new { controller = "Upload", action = "Index" }, new[] { typeof(Controllers.UploadController).Namespace } ); context.MapSubdomainRoute( "Upload_default_long_delete", "upload", - "Upload/{url}/{deleteKey}", + "{url}/{deleteKey}", new { controller = "Upload", action = "Index", url = string.Empty, deleteKey = string.Empty }, new[] { typeof(Controllers.UploadController).Namespace } ); context.MapSubdomainRoute( "Upload_default_long_action", "upload", - "Upload/Action/{controller}/{action}", + "Action/{controller}/{action}", new { controller = "Upload", action = "Index" }, new[] { typeof(Controllers.UploadController).Namespace } ); diff --git a/Teknik/Teknik.csproj b/Teknik/Teknik.csproj index d85258b..afe3f2d 100644 --- a/Teknik/Teknik.csproj +++ b/Teknik/Teknik.csproj @@ -152,6 +152,9 @@ + + + @@ -265,6 +268,10 @@ + + + + @@ -325,6 +332,8 @@ + +