private Boolean isIAPUser(string sUsername, string sPassword) { //If this is an internal authorized IAP user then show names string sError = ""; if (CUser.CheckIAPUser(ref sError, sUsername, sPassword)) { if (sError == "") { DataSet dsUser = CUser.LoadAllUsersInfo(ref sError, sUsername); if (sError == "") { Session["IsAdminUser"] = dsUser.Tables[0].Rows[0]["IsAdmin"].ToString(); } return(true); } else { UserMsg.Text = sError; UserMsg.Visible = true; return(false); } } else { return(false); } }
private void ControlsInitialize() { Master.ShowFooter = false; //Master.ShowPageTitle = false; //Master.ShowNavMenu = false; Master.PageTitle = "Assignments"; //Master.NavMenuItem = "MenuItem2"; //current focus tab dsUser = CUser.LoadAllUsersInfo(); }
protected void grdChild_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "btnAssign") { int iIndex = Convert.ToInt16(e.CommandArgument); String recID = ((HiddenField)grdChild.Rows[iIndex].Cells[7].FindControl("txtRecID")).Value; String serviceDate = ((HiddenField)grdChild.Rows[iIndex].Cells[7].FindControl("txtServiceDate")).Value; String recType = ((HiddenField)grdChild.Rows[iIndex].Cells[7].FindControl("txtType")).Value; String userID = ((DropDownList)grdChild.Rows[iIndex].Cells[7].FindControl("cboUser")).SelectedValue; String funding = grdChild.Rows[iIndex].Cells[3].Text; Response.Redirect("ElementForms.aspx?id=" + recID + "&date=" + serviceDate + "&type=" + recType + "&fund=" + funding); } dsUser = CUser.LoadAllUsersInfo(); }
//private object UserMsg; // IPBasePage must have 'Build Action' = Content not Compile // Also must class PostLogin must be in CodeBehind, not CodeFile in PostLogin.aspx //protected CUser CurrentUser; protected void Page_Load(object sender, EventArgs e) { String sSID = ""; String sSSIUserID = ""; String sFirstName = ""; String sLastName = ""; String sUserName = ""; String sApp = ""; string sError = ""; sSID = Request.QueryString["sessionid"].ToString(); if (Request.QueryString["app"] != null) { sApp = Request.QueryString["app"].ToString(); } sSID = DecryptDES(sSID.Replace(" ", "+")); SSI.Security ssi = new SSI.Security(); if (Session["DevLogin"] == null) //this is the prod environment, meaning the sSID is the temp token. { //get the permanent Session Id. What is passed in the URL is a temp token. sSID = ssi.GetSessionId(sSID); } //DataSet dsSSIAppInfo = ssi.GetUserAppsInfo(sSID); Session["SessionID"] = sSID; //Response.Write ("SessionID = " + sSID); //Response.End(); DataSet dsSSIUserInfo = ssi.GetUserProfile(sSID); if (dsSSIUserInfo.Tables[0].Rows.Count > 0) { sSSIUserID = dsSSIUserInfo.Tables[0].Rows[0]["UserID"].ToString(); sUserName = dsSSIUserInfo.Tables[0].Rows[0]["Username"].ToString(); sFirstName = dsSSIUserInfo.Tables[0].Rows[0]["Firstname"].ToString(); sLastName = dsSSIUserInfo.Tables[0].Rows[0]["Lastname"].ToString(); Session["UserID"] = dsSSIUserInfo.Tables[0].Rows[0]["UserID"].ToString(); Session["UserName"] = sUserName; Session["CurrentMenuFocus"] = ""; DataSet dsUser = CUser.LoadAllUsersInfo(ref sError, sUserName); //if (!CGlobal.IsEmptyString(sSSIUserID)) if (dsUser.Tables[0].Rows.Count > 0) { //User is authenticated via SSI if (dsUser.Tables[0].Rows[0]["IsReadOnly"].ToString() == "1") { Session["IsReadOnly"] = "1"; Session["HideNames"] = "1"; Session["IsAdminUser"] = "******"; Response.Redirect("selectChild.aspx?hn=1"); } else { Session["IsReadOnly"] = "0"; Session["HideNames"] = "0"; Session["IsAdminUser"] = dsUser.Tables[0].Rows[0]["IsAdmin"].ToString(); Response.Redirect("selectChild.aspx?hn=0"); } } else { //throw exception UserMsg.Text = "Invalid IP User"; UserMsg.Visible = true; return; //UserMsg.Text = "SSI Session ID is Empty."; //UserMsg.Visible = true; //return; } } }