Пример #1
0
        protected override void OnInit(EventArgs e)
        {
            if (!ACLUtility.GetMonitorSignal())
            {
                Response.Redirect(Page.ResolveUrl("~/Error.aspx"), true);
            }

            if (SMSContext.Current.User == null)
            {
                Response.Redirect(Page.ResolveUrl("~/login.aspx"), true);
            }
            else
            {
                if (!string.IsNullOrEmpty(ViewName))
                {
                    if (!ACLUtility.IsAccessible(ViewName))
                    {
                        Response.Redirect(Page.ResolveUrl("~/Forbidden.aspx"), true);
                    }
                    else if (!string.IsNullOrEmpty(EditName) && !ACLUtility.IsAccessible(EditName))
                    {
                        SetControlsStatus(false);
                    }
                }
            }
            base.OnInit(e);
        }
Пример #2
0
 protected void btnLogin_Click(object sender, ImageClickEventArgs e)
 {
     if (!string.IsNullOrEmpty(txtName.Value) && !string.IsNullOrEmpty(txtPwd.Value))
     {
         UserInfo user = null;
         if (!ACLUtility.AuthorizeLoginUser(txtName.Value, txtPwd.Value, ref user))
         {
             lblMsg.Visible = true;
         }
         else
         {
             ACLUtility.WriteLoginCookie(user);
             Response.Redirect("homepage.aspx");
         }
     }
 }
Пример #3
0
 protected void btnLogout_Click(object sender, EventArgs e)
 {
     ACLUtility.Logout();
 }