protected override string GetKey(Control context) { SimplePage page = context as SimplePage; if ((page != null) && !string.IsNullOrEmpty(page.UniqueDataModelKey)) { return(context.Page.Request.CurrentExecutionFilePath + page.UniqueDataModelKey + ".Model"); } else { return(base.GetKey(context)); } }
internal static void CheckVisit(bool requiresAdmin, string redirectPageIfNotAdmin) { //Valling the visit property will retreave the object from the session //To prevent unecessary casts, store it locally NodeVisit visit = VisitHelper.GetVisit(); if (visit == null) { // Session has timed out or the user has typed the url in, force logout FormsAuthentication.SignOut(); FormsAuthentication.RedirectToLoginPage("a=out"); HttpContext.Current.Response.End(); return; } if (requiresAdmin && !visit.IsAdmin) { if (string.IsNullOrEmpty(redirectPageIfNotAdmin)) { redirectPageIfNotAdmin = "~/Secure/Dashboard.aspx"; } SimplePage.ResponseRedirect(redirectPageIfNotAdmin); return; } }