Exemplo n.º 1
0
        protected override void OnInit(EventArgs e)
        {
            VisitHelper.CheckVisit(RequiresAdmin, RedirectPageIfNotAdmin);

            _SecureMasterPage = (AdminMaster)Page.Master;

            base.OnInit(e);
        }
Exemplo n.º 2
0
        internal static bool CanViewFlowByName(string flowName)
        {
            NodeVisit adminVisit = VisitHelper.GetVisit();

            if ((adminVisit != null) && (adminVisit.Account != null))
            {
                return(adminVisit.IsFlowPermittedByName(flowName, FlowRoleType.View));
            }
            return(false);
        }
Exemplo n.º 3
0
        internal static bool CanEditAnyFlow()
        {
            NodeVisit adminVisit = VisitHelper.GetVisit();

            if ((adminVisit != null) && (adminVisit.Account != null))
            {
                return(adminVisit.CanEditAnyFlow());
            }
            return(false);
        }
Exemplo n.º 4
0
        internal static bool CanEditFlowById(string flowId)
        {
            NodeVisit adminVisit = VisitHelper.GetVisit();

            if ((adminVisit != null) && (adminVisit.Account != null))
            {
                return(adminVisit.IsFlowPermittedById(flowId, FlowRoleType.Modify));
            }
            return(false);
        }
Exemplo n.º 5
0
        internal static string GetCurrentUsername()
        {
            NodeVisit visit = VisitHelper.GetVisit();

            if ((visit != null) && (visit.Account != null))
            {
                return(visit.Account.NaasAccount);
            }
            return(null);
        }
Exemplo n.º 6
0
        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;
            }
        }
Exemplo n.º 7
0
 protected string GetCurrentUsername()
 {
     return(VisitHelper.GetCurrentUsername());
 }