From 3c95bab2d55ec785f1cd50d7cff6967d97a08811 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 22 May 2017 21:00:11 -0400 Subject: [PATCH] I think Ash is getting to me. --- Project-Unite/Controllers/AdminController.cs | 6 +++--- Project-Unite/Views/Admin/Index.cshtml | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Project-Unite/Controllers/AdminController.cs b/Project-Unite/Controllers/AdminController.cs index cbef219..261c120 100644 --- a/Project-Unite/Controllers/AdminController.cs +++ b/Project-Unite/Controllers/AdminController.cs @@ -16,14 +16,14 @@ namespace Project_Unite.Controllers { //We have a custom ACL implementation so we do not need to use the ASP.NET role system to check if a user has an ACL rule. [Authorize] + [RequiresAdmin] public class AdminController : Controller { private ApplicationDbContext db = new ApplicationDbContext(); - [Authorize] - [RequiresAdmin] - public ActionResult Index() + public ActionResult Index(string id = "home") { + ViewBag.Page = id; return View(); } } diff --git a/Project-Unite/Views/Admin/Index.cshtml b/Project-Unite/Views/Admin/Index.cshtml index 378983e..27e10bb 100644 --- a/Project-Unite/Views/Admin/Index.cshtml +++ b/Project-Unite/Views/Admin/Index.cshtml @@ -4,7 +4,6 @@ @{ ViewBag.Title = "Administration Control Panel"; - var db = new ApplicationDbContext(); string homeclass = (ViewBag.Page == "home") ? "active" : ""; string siteconfigclass = (ViewBag.Page == "siteconfig") ? "active" : "";