protected void Page_Load(object sender, EventArgs e) { Response.Cache.SetCacheability(HttpCacheability.NoCache); Response.Cache.SetNoStore(); Response.Cache.SetExpires(DateTime.MinValue); if (Session["AFWACSESSION"] == null) { if (ConfigurationManager.AppSettings["BOOLautoLoginDevel"] == "1") { Session["AFWACSESSION"] = new AFWACsession(this.Request); session = Session["AFWACSESSION"] as AFWACsession; // ------------------------------------------ // THE SUBPROCESS FOR AUTO-LOGIN FOR TESTING session.idSubprocess = 66; session.nameProcess = "HRM"; session.nameSubprocess = "Human Resource Services"; // ------------------------------------------ // THE USER FOR AUTO-LOGIN FOR TESTING //session.idUser = 196; //session.username = "******"; session.idUser = 232; session.username = "******"; Session["UUIDSUBPROCESS"] = session.idSubprocess; Session["INTcurWS_SAP"] = ""; Session["INTcurWS"] = ""; } else { Response.Redirect("MSGnosess.htm"); } } else { session = Session["AFWACSESSION"] as AFWACsession; session.strIPaddr = Context.Request.ServerVariables["REMOTE_ADDR"]; } }
// I M P O R T A N T // NOTE: This page_load is called AFTER the actual content page page_load is // called, so don't expect this to be able to prep things for the // content page's page_load logic to use. protected void Page_Load(object sender, EventArgs e) { if (null != ConfigurationManager.AppSettings["IPADDRopenOnlyTo"]) { if (ConfigurationManager.AppSettings["IPADDRopenOnlyTo"] != Request.UserHostAddress) { Response.Redirect("LOCKOUT.aspx"); return; } } if (Session["AFWACSESSION"] == null) { Response.Redirect("SessionLOGIN.aspx"); return; } THESESSION = Session["AFWACSESSION"] as AFWACsession; this.HIDDENidSubpr.Value = THESESSION.idSubprocess.ToString(); HIDDENidUser.Value = THESESSION.idUser.ToString(); if (Page.Title.StartsWith("Untitled")) { Page.Title = AFWACRELNUM; } /* * if (this.Request.Url.LocalPath.EndsWith("EntitlementWorkspace.aspx")) * { * TabStrip1.Visible = false; * } */ if (this.Request.Url.LocalPath.EndsWith("/SAPEntitlementWorkspace.aspx")) { TabStrip1.SelectedTab = TabStrip1.FindItemById("TAB_SAP_Designer"); } else if (this.Request.Url.LocalPath.EndsWith("/PAGEroleDesigner.aspx")) { TabStrip1.SelectedTab = TabStrip1.FindItemById("TAB_BUS_Designer"); } else if (this.Request.Url.LocalPath.EndsWith("/PAGEroleDesAppList.aspx")) { TabStrip1.SelectedTab = TabStrip1.FindItemById("TAB_BUS_Designer"); } }
private string GenUrl(int IDsubprocess, ref exportinfo guider) { // If we have -1 as the workspaceID, that means the *active* entset for this subpr is implied. if (guider.idWS < 0) { AFWACsession fakesession = new AFWACsession(null); fakesession.idSubprocess = IDsubprocess; fakesession.idUser = -1; fakesession.ObtainWorkspaceContext(); guider.idWS = fakesession.idActiveEAset; } string rolelist = ""; foreach (int x in guider.ARRidNode) { rolelist += "," + x.ToString(); } if (rolelist.Length > 0) { rolelist = rolelist.Substring(1); //Eliminate the leading comma rolelist = "&brol=" + rolelist; } string singlesheet = "&singlesheet=true"; if (CheckBox1.Checked) { singlesheet = "&singlesheet=false"; } string curSubcontractorURL = Request.Url.OriginalString.Substring(0, Request.Url.OriginalString.LastIndexOf('/')) + "/export/EntitlementsPerSubpr.ashx?id=" + guider.idWS + singlesheet + rolelist + (!guider.isWorkspace ? "&showstatus=false" : "") + (CHKshowOnlyNetEffect.Checked ? "&deltasonly=true" : "") + (CHKforFullDetailCSV.Checked ? "&FMTfulldetail=true" : "") + (CHKforIDMuploadCSV.Checked ? "&FMTidm3col=true" : "") + "&name=" + HttpUtility.HtmlEncode(guider.strName); return(curSubcontractorURL); }
private bool AuthCheck() { if (AlreadyLoggedIn()) { return(true); } int IDuser = int.Parse(this.CHOOSEusername.SelectedValue); string STRpassword = this.TXTpassword.Text.Trim(); IUser userfactory = new IUser(HELPERS.NewOdbcConn()); returnGetUser userinfo = userfactory.GetUser(IDuser); if (userinfo.EID.ToLower() == STRpassword.ToLower()) { // // LOGIN GOOD ! // sessnew = new AFWACsession(this.Request); sessnew.username = userinfo.Name; sessnew.idUser = IDuser; // this extra session var UUIDSUBPROCESS is needed so data sources can use // it as parameters for scoping results. Session["AFWACSESSION"] = sessnew; Session["AFWACUSERID"] = IDuser; Response.Redirect("SessionLOGIN.aspx"); return(true); } else { this.PanelLoginFailMsg.Visible = true; return(false); } }
public void ProcessRequest(HttpContext context) { string strIdSubpr = context.Request.Params["subproc"]; int idSubpr = int.Parse(strIdSubpr); string mode = "regular"; try { mode = context.Request.Params["mode"]; } catch (Exception eee) { } // try valiantly to ensure no cacheing of this response context.Response.ExpiresAbsolute = DateTime.Now.AddDays(-100); context.Response.AddHeader("pragma", "no-cache"); context.Response.AddHeader("cache-control", "private"); context.Response.CacheControl = "no-cache"; ComponentArt.Web.UI.TreeView tview = new ComponentArt.Web.UI.TreeView(); IBusRole engine = new IBusRole(HELPERS.NewOdbcConn()); IEntAssignmentSet engineWS = new IEntAssignmentSet(HELPERS.NewOdbcConn()); AFWACsession fakesession = new AFWACsession(context.Request); fakesession.idSubprocess = idSubpr; fakesession.idUser = -1; fakesession.ObtainWorkspaceContext(); ComponentArt.Web.UI.TreeViewNode rootNode; if (mode == "ListEASetRetired") { returnListEntAssignmentSetBySubProcess[] listWS = engineWS.ListEntAssignmentSetBySubProcess (null, "\"Status\" IN ('archived')", new string[] {}, "c_u_DATETIMElock DESC", idSubpr); for (int i = 0; i < listWS.Length; i++) { rootNode = new ComponentArt.Web.UI.TreeViewNode(); rootNode.Text = listWS[i].UserLoginName + " " + listWS[i].DATETIMElock + " - " + listWS[i].Commentary; rootNode.Expanded = false; rootNode.ImageUrl = "cal_nextMonth.gif"; rootNode.ShowCheckBox = true; rootNode.ID = "EntSet/ARCHIVE/" + listWS[i].SubProcessID; rootNode.Value = listWS[i].ID.ToString(); rootNode.RowCssClass = "TreeRow_EASet"; rootNode.Checked = false; tview.Nodes.Add(rootNode); } } else { bool alreadyCheckedChoiceEASet = false; // The very first node always represents the active set of entitlements if ((fakesession.idActiveEAset >= 0) && (mode != "rolesonly")) { rootNode = new ComponentArt.Web.UI.TreeViewNode(); rootNode.Text = "ACTIVE Entitlements"; rootNode.Expanded = false; rootNode.ImageUrl = "cal_nextMonth.gif"; rootNode.ShowCheckBox = true; rootNode.ID = "EntSet/ACT/" + idSubpr; rootNode.Value = fakesession.idActiveEAset.ToString(); rootNode.RowCssClass = "TreeRow_EASet"; rootNode.Checked = true; tview.Nodes.Add(rootNode); alreadyCheckedChoiceEASet = true; } // The very next node will exist only if a workspace exists if ((fakesession.idWorkspace >= 0) && (mode != "rolesonly")) { rootNode = new ComponentArt.Web.UI.TreeViewNode(); rootNode.Text = "WORKSPACE owned by " + fakesession.nameUserWorkspaceOwner; rootNode.Expanded = false; rootNode.ImageUrl = "cal_nextMonth.gif"; rootNode.ShowCheckBox = true; rootNode.ID = "EntSet/WS/" + idSubpr; rootNode.Value = fakesession.idWorkspace.ToString(); rootNode.Checked = !alreadyCheckedChoiceEASet; rootNode.RowCssClass = "TreeRow_EASet"; tview.Nodes.Add(rootNode); alreadyCheckedChoiceEASet = true; } if ((!alreadyCheckedChoiceEASet) && (mode != "rolesonly")) { rootNode = new ComponentArt.Web.UI.TreeViewNode(); rootNode.Text = "WARNING: no entitlements yet - export will be empty"; rootNode.Expanded = false; rootNode.ImageUrl = "close.gif"; rootNode.ID = "EntSet/NONE/" + idSubpr; rootNode.Value = fakesession.idWorkspace.ToString(); rootNode.Checked = !alreadyCheckedChoiceEASet; rootNode.RowCssClass = "TreeRow_EASet"; tview.Nodes.Add(rootNode); alreadyCheckedChoiceEASet = true; } if ((mode != "rolesonly")) { rootNode = new ComponentArt.Web.UI.TreeViewNode(); rootNode.Text = "Retired/archived entitlement sets:"; rootNode.Expanded = false; rootNode.ImageUrl = "folder.gif"; rootNode.ID = "EntSet/FOLDERarchive/" + idSubpr; rootNode.ContentCallbackUrl = "XMLtree_RolesInSubprocess.ashx?mode=ListEASetRetired&subproc=" + idSubpr; tview.Nodes.Add(rootNode); } returnListBusRoleBySubProcess[] allroles = engine.ListBusRoleBySubProcess (null, "", new string[] { }, "c_u_Name asc", (idSubpr)); // Added 6 July 2009: if number of roles exceeds a certain amount, only show an "ALL". if (allroles.Length > 50) { rootNode = new ComponentArt.Web.UI.TreeViewNode(); rootNode.Text = "ALL ROLES (too many to show)"; rootNode.Expanded = false; rootNode.ImageUrl = "icon_flag.gif"; rootNode.ShowCheckBox = true; rootNode.RowCssClass = "TreeRow_Role"; rootNode.ID = "BR/" + idSubpr + "/*ALL*"; rootNode.Checked = true; tview.Nodes.Add(rootNode); } else { foreach (returnListBusRoleBySubProcess cur in allroles) { rootNode = new ComponentArt.Web.UI.TreeViewNode(); rootNode.Text = cur.Name; rootNode.Expanded = false; rootNode.ImageUrl = "icon_flag.gif"; rootNode.ShowCheckBox = true; rootNode.RowCssClass = "TreeRow_Role"; rootNode.ID = "BR/" + idSubpr + "/" + cur.ID; rootNode.Checked = false; tview.Nodes.Add(rootNode); } } } context.Response.ContentType = "text/xml"; context.Response.Write(tview.GetXml()); }