Beispiel #1
0
        public ActionResult NewPage(PageModel model)
        {
            // Redirect if the user isn't logged in
            if (!IdentityModel.CurrentUserLoggedIn || !IdentityModel.CurrentUserOwner)
            {
                return RedirectToAction("Login", "Admin");
            }

            model.NewPage();
            return View(model);
        }
Beispiel #2
0
        public ActionResult EditPage(String id, PageModel model)
        {
            // Redirect if the user isn't logged in
            if (!IdentityModel.CurrentUserLoggedIn || !IdentityModel.CurrentUserOwner)
            {
                return RedirectToAction("Login", "Admin");
            }

            int x;
            if (!Int32.TryParse(id, out x)) return RedirectToAction("Login", "Admin");
            model.SavePage(x);
            return View(model);
        }