コード例 #1
0
      public static void RedirectToStartPage(string ntID)
      {
         if (ntID != null)
         {
            string sAccess;

            using (var sec = new SECContext())
               sAccess = sec.getUserPermission(ntID);

            if (String.IsNullOrEmpty(sAccess))
               HttpContext.Current.Response.Redirect("~/NotAuthorized.aspx", false);
            else
               HttpContext.Current.Response.Redirect("~/Pages/LW1190.aspx", false);
         }
         else
         {
            throw new Exception("Could not determine Network ID (ntid from NTLM was NULL)");
         }
      }
コード例 #2
0
      private void SecurityCheck()
      {
         string spooferID = null;
         string sAccess;

         if (Page.PreviousPage != null) spooferID = ((Spoofing)Page.PreviousPage).Spoofer;
         string spoofers = ConfigurationManager.AppSettings["SpoofingIDs"].ToString().Trim();

         if (spooferID == null && Regex.IsMatch(spoofers, string.Format(@"(\b{0}\b)", ntID), RegexOptions.IgnoreCase))
            Response.Redirect("~/Spoofing.aspx");
         else
         {
            ntID = spooferID ?? ntID;

            using (var sec = new SECContext())
               sAccess = sec.getUserPermission(ntID);

            if (String.IsNullOrEmpty(sAccess))
               Response.Redirect("~/NotAuthorized.aspx");
            else
               ViewState["Access"] = sAccess;
         }
      }