protected void Page_Load(object sender, EventArgs e) { try { string oauthcrd = Request.QueryString["oauthcrd"]; //decrypt oauth string string oauthDecode = System.Web.HttpUtility.UrlDecode(oauthcrd); oauthDecode = oauthDecode.Replace(" ", "+"); //fix situations where spaces and plus get mixed up string decryptStr = new SimpleAES().Decrypt(oauthDecode); //split into password and username string[] s = System.Text.RegularExpressions.Regex.Split(decryptStr, "\\|\\|"); CustMembershipProvider c = new CustMembershipProvider(); if (c.ValidateUser(s[1], s[0]) == false) { lblMsg.Text = "Verification failed"; pnl1.Visible = false; } else pnl1.Visible = true; } catch { lblMsg.Text = "Verification failed"; pnl1.Visible = false; } }
protected void btnSave_Click(object sender, EventArgs e) { lblMsg.Text = ""; //Validation ************************************* if (db_Ref.GetT_OE_APP_SETTING("Beta Program") == "Y") { if (txtBetaKey.Text.ToUpper() != db_Ref.GetT_OE_APP_SETTING("Beta Invite Code").ToUpper()) { lblMsg.Text = "Invalid Beta Invite Code. Please contact " + db_Ref.GetT_OE_APP_SETTING("Email From") + " to obtain one."; return; } } if (txtFName.Text.Length == 0 || txtLName.Text.Length == 0 || txtUserID.Text.Length == 0 || txtEmail.Text.Length == 0) { lblMsg.Text = "You must supply a user name, first name, last name, and email."; return; } //End Validation ************************************* //create user MembershipCreateStatus status; CustMembershipProvider c = new CustMembershipProvider(); c.CreateUser(txtUserID.Text, "", txtEmail.Text, null, null, true, null, out status); if (status == MembershipCreateStatus.Success) { int UserIDX = (int)Membership.GetUser(txtUserID.Text).ProviderUserKey; db_Accounts.UpdateT_OE_USERS(UserIDX, null, null, txtFName.Text, txtLName.Text, null, null, null, null, null, txtPhone.Text, txtPhoneExt.Text, null); //show registration success pnl1.Visible = false; pnl2.Visible = true; lblTitle.Visible = false; } else { if (status.ToString() == "DuplicateUserName") { lblMsg.Text = "An account already exists with that email address. Please recover lost password."; } else if (status.ToString() == "InvalidEmail") { lblMsg.Text = "Unable to send verification email. Please try again later."; } else { lblMsg.Text = status.ToString(); } } }
protected void btnSave_Click(object sender, EventArgs e) { //*************** VALIDATION ******************************** if (txtPwd.Text != txtPwd2.Text) { lblMsg.Text = "Passwords do not match"; return; } //*************** END VALIDATION ******************************** string oauthcrd = Request.QueryString["oauthcrd"]; //decrypt oauth string string oauthDecode = System.Web.HttpUtility.UrlDecode(oauthcrd); oauthDecode = oauthDecode.Replace(" ", "+"); //fix situations where spaces and plus get mixed up string decryptStr = new SimpleAES().Decrypt(oauthDecode); //split into password and username string[] s = System.Text.RegularExpressions.Regex.Split(decryptStr, "\\|\\|"); CustMembershipProvider c = new CustMembershipProvider(); if (c.ValidateUser(s[1], s[0]) == true) { if (c.ChangePassword(s[1], s[0], txtPwd.Text)) { if (Membership.ValidateUser(s[1], txtPwd.Text)) { FormsAuthentication.SetAuthCookie(s[1], false); FormsAuthentication.RedirectFromLoginPage(s[1], false); string ddd = User.Identity.Name; T_OE_USERS u = db_Accounts.GetT_OE_USERSByID(s[1]); if (u != null) { db_Accounts.UpdateT_OE_USERS(u.USER_IDX, null, null, null, null, null, null, null, null, System.DateTime.Now, null, null, "system"); //set important session variables Session["UserIDX"] = u.USER_IDX; Response.Redirect("~/App_Pages/Secure/Dashboard.aspx"); } } } } }
protected void btnSave_Click(object sender, EventArgs e) { lblMsg.Text = ""; //Validation ************************************* if (db_Ref.GetT_OE_APP_SETTING("Beta Program") == "Y") { if (txtBetaKey.Text.ToUpper() != db_Ref.GetT_OE_APP_SETTING("Beta Invite Code").ToUpper()) { lblMsg.Text = "Invalid Beta Invite Code. Please contact " + db_Ref.GetT_OE_APP_SETTING("Email From") + " to obtain one."; return; } } if (txtFName.Text.Length == 0 || txtLName.Text.Length == 0 || txtUserID.Text.Length == 0 || txtEmail.Text.Length == 0) { lblMsg.Text = "You must supply a user name, first name, last name, and email."; return; } //End Validation ************************************* //create user MembershipCreateStatus status; CustMembershipProvider c = new CustMembershipProvider(); c.CreateUser(txtUserID.Text, "", txtEmail.Text, null, null, true, null, out status); if (status == MembershipCreateStatus.Success) { int UserIDX = (int)Membership.GetUser(txtUserID.Text).ProviderUserKey; db_Accounts.UpdateT_OE_USERS(UserIDX, null, null, txtFName.Text, txtLName.Text, null, null, null, null, null, txtPhone.Text, txtPhoneExt.Text, null); //show registration success pnl1.Visible = false; pnl2.Visible = true; lblTitle.Visible = false; } else { if (status.ToString() == "DuplicateUserName") lblMsg.Text = "An account already exists with that email address. Please recover lost password."; else if (status.ToString() == "InvalidEmail") lblMsg.Text = "Unable to send verification email. Please try again later."; else lblMsg.Text = status.ToString(); } }