protected void Page_Load(object sender, EventArgs e) { if (this.RequiresOldPassword) { OldPassword.Focus(); } else { NewPassword.Focus(); } }
protected void SavePassword_Click(object sender, EventArgs e) { if (user.ChangePassword(OldPassword.Text, Password.Text)) { PasswordMessage.Text = "Password has been changed!"; } else { OldPassword.Focus(); PasswordMessage.Text = "Unable to change password, please check to ensure you entered your old password correctly and try again."; } }
private void OkPassword_Click(object sender, EventArgs e) { OldPassword.Focus(); if (OldPassword.Text == Yqun.Common.ContextCache.ApplicationContext.Current.Password) { if (OnePassword.Text == TwoPassword.Text) { if (OnePassword.Text.Length <= 4 || TwoPassword.Text.Length <= 4 || OnePassword.Text == "111111" || OnePassword.Text == "888888") { MessageBox.Show("新密码长度要求大于4且不能为初始密码!", "提示"); OldPassword.Text = ""; OnePassword.Text = ""; TwoPassword.Text = ""; OldPassword.Focus(); } else { string Password = OnePassword.Text; int r = Agent.SetUserPassword(Yqun.Common.ContextCache.ApplicationContext.Current.UserName, Password); if (r == 1) { Yqun.Common.ContextCache.ApplicationContext.Current.Password = Password; MessageBox.Show("密码修改成功!", "提示", MessageBoxButtons.OK); this.Close(); } else { MessageBox.Show("密码修改失败!", "提示", MessageBoxButtons.OK); AlterPassword PasswordForm = new AlterPassword(); PasswordForm.ShowDialog(); } } } else { MessageBox.Show("第二次输入密码和第一次输入密码\r\n 不同,请重新输入!", "提示"); OldPassword.Text = ""; OnePassword.Text = ""; TwoPassword.Text = ""; OldPassword.Focus(); } } else { MessageBox.Show("密码错误请重新输入!", "提示"); OldPassword.Text = ""; OnePassword.Text = ""; TwoPassword.Text = ""; OldPassword.Focus(); } }
private void PasswordChange_Click_1(object sender, RoutedEventArgs e) { if (OldPassword.Password != Oldpassword) { MessageBox.Show("Incorrect Old Password. Please try again", "Password Info", MessageBoxButton.OK, MessageBoxImage.Information); OldPassword.Clear(); NewPassword.Clear(); OldPassword.Focus(); return; } if (PasswordChangeEvent != null) { PasswordChangeEvent(this, new PasswordChangeEventArgs(NewPassword.Password)); } }
private void PasswordChange_Click_1(object sender, RoutedEventArgs e) { if (OldPassword.Password != ((User)UserSelector.SelectedItem).Password) { MessageBox.Show("Incorrect Old Password. Please try again", "Password Info", MessageBoxButton.OK, MessageBoxImage.Information); OldPassword.Clear(); NewPassword.Clear(); OldPassword.Focus(); return; } if (PasswordChangeEvent != null) { User u = ((User)UserSelector.SelectedItem); PasswordChangeEvent(this, new PasswordChangeEventArgs(new User(u.Name, NewPassword.Password))); } }
// Pasword change private void ChangePassword_Click(object sender, RoutedEventArgs e) { SetDefaultSettings(); MainPageLabel.Visibility = Visibility.Visible; MainPageLabel.Content = "PASSWORD CHANGE:"; OldPassword.Visibility = Visibility.Visible; OldPassword.Text = "Old password ..."; OldPassword.IsEnabled = true; NewPassword1.Visibility = Visibility.Visible; NewPassword1.IsEnabled = false; NewPassword1.Text = "New password ..."; NewPassword2.Visibility = Visibility.Visible; NewPassword2.IsEnabled = false; NewPassword2.Text = "New password ..."; ConfirmButton.Visibility = Visibility.Visible; StornoButton.Visibility = Visibility.Visible; OldPassword.Focus(); }
private void UserControl_Loaded_1(object sender, RoutedEventArgs e) { OldPassword.Focus(); }
protected void btnSignInAndCheckout_Click(object sender, EventArgs e) { Page.Validate(); if (Page.IsValid) { String EMailField = EMail.Text.ToLowerInvariant().Trim(); String PasswordField = Password.Text; bool LoginOK = false; if (AppLogic.AppConfigBool("SecurityCodeRequiredOnStoreLogin")) { String sCode = Session["SecurityCode"].ToString(); String fCode = SecurityCode2.Text; if (fCode != sCode) { ErrorMsgLabel.Text = string.Format(AppLogic.GetString("lat_signin_process.aspx.5", SkinID, ThisCustomer.LocaleSetting), sCode, fCode); ErrorPanel.Visible = true; SecurityCode2.Text = String.Empty; Session["SecurityCode"] = CommonLogic.GenerateRandomCode(6); return; } } Customer c = new Customer(EMailField, true); LoginOK = c.CheckLogin(PasswordField); if (!c.IsRegistered) { ErrorMsgLabel.Text = AppLogic.GetString("lat_signin_process.aspx.1", SkinID, ThisCustomer.LocaleSetting); ErrorPanel.Visible = true; return; } else { if (LoginOK) { if (c.BadLoginCount >= AppLogic.AppConfigNativeInt("MaxBadLogins")) { ErrorMsgLabel.Text = AppLogic.GetString("lat_signin_process.aspx.3", SkinID, ThisCustomer.LocaleSetting); ErrorPanel.Visible = true; return; } else if (!c.Active) { ErrorMsgLabel.Text = AppLogic.GetString("lat_signin_process.aspx.2", SkinID, ThisCustomer.LocaleSetting); ErrorPanel.Visible = true; return; } else if (c.PwdChangeRequired) { ExecutePanel.Visible = false; FormPanel.Visible = false; pnlChangePwd.Visible = true; CustomerEmail.Text = EMailField; OldPassword.Focus(); return; } int CurrentCustomerID = ThisCustomer.CustomerID; int NewCustomerID = c.CustomerID; if (AppLogic.AppConfigBool("DynamicRelatedProducts.Enabled") || AppLogic.AppConfigBool("RecentlyViewedProducts.Enabled")) { c.ReplaceProductViewFromAnonymous(); } AppLogic.ExecuteSigninLogic(CurrentCustomerID, NewCustomerID); // update the cookie value if present for affiliate int affiliateIDFromCookie = int.Parse(CommonLogic.IIF(CommonLogic.IsInteger(HttpContext.Current.Profile.GetPropertyValue(Customer.ro_AffiliateCookieName).ToString()), HttpContext.Current.Profile.GetPropertyValue(Customer.ro_AffiliateCookieName).ToString(), "0")); if (AppLogic.IsValidAffiliate(affiliateIDFromCookie)) { c.AffiliateID = affiliateIDFromCookie; } if (c.IsAdminUser) { Security.LogEvent("Store Login", "", c.CustomerID, c.CustomerID, c.ThisCustomerSession.SessionID); } // we've got a good login: FormPanel.Visible = false; ExecutePanel.Visible = true; String CustomerGUID = c.CustomerGUID.Replace("{", "").Replace("}", ""); SignInExecuteLabel.Text = AppLogic.GetString("signin.aspx.2", SkinID, ThisCustomer.LocaleSetting); // set the Secure property if the site has SSL enabled and is on live FormsAuthentication.SetAuthCookie(CustomerGUID, true); HttpCookie authCookie = Response.Cookies[FormsAuthentication.FormsCookieName]; if (authCookie != null && !AppLogic.AppConfigBool("GoNonSecureAgain")) { authCookie.Secure = AppLogic.UseSSL() && AppLogic.OnLiveServer(); } if (!AppLogic.AppConfigBool("Checkout.RedirectToCartOnSignin")) { ShoppingCart newCart = new ShoppingCart(SkinID, c, CartTypeEnum.ShoppingCart, 0, false); string returnURL = newCart.PageToBeginCheckout(false, false); if (newCart.Total(true) != cart.Total(true)) { ErrorMessage em = new ErrorMessage("checkoutshipping.aspx.25".StringResource()); returnURL = returnURL.AppendQueryString("errormsg=" + em.MessageId); } Response.AddHeader("REFRESH", "1; URL=" + Server.UrlDecode(returnURL)); } else { Response.AddHeader("REFRESH", "1; URL=" + Server.UrlDecode("shoppingcart.aspx")); } } else { ErrorMsgLabel.Text = AppLogic.GetString("lat_signin_process.aspx.1", SkinID, ThisCustomer.LocaleSetting); ErrorPanel.Visible = true; if (c.IsAdminUser) { c.UpdateCustomer( /*CustomerLevelID*/ null, /*EMail*/ null, /*SaltedAndHashedPassword*/ null, /*SaltKey*/ null, /*DateOfBirth*/ null, /*Gender*/ null, /*FirstName*/ null, /*LastName*/ null, /*Notes*/ null, /*SkinID*/ null, /*Phone*/ null, /*AffiliateID*/ null, /*Referrer*/ null, /*CouponCode*/ null, /*OkToEmail*/ null, /*IsAdmin*/ null, /*BillingEqualsShipping*/ null, /*LastIPAddress*/ null, /*OrderNotes*/ null, /*SubscriptionExpiresOn*/ null, /*RTShipRequest*/ null, /*RTShipResponse*/ null, /*OrderOptions*/ null, /*LocaleSetting*/ null, /*MicroPayBalance*/ null, /*RecurringShippingMethodID*/ null, /*RecurringShippingMethod*/ null, /*BillingAddressID*/ null, /*ShippingAddressID*/ null, /*GiftRegistryGUID*/ null, /*GiftRegistryIsAnonymous*/ null, /*GiftRegistryAllowSearchByOthers*/ null, /*GiftRegistryNickName*/ null, /*GiftRegistryHideShippingAddresses*/ null, /*CODCompanyCheckAllowed*/ null, /*CODNet30Allowed*/ null, /*ExtensionData*/ null, /*FinalizationData*/ null, /*Deleted*/ null, /*Over13Checked*/ null, /*CurrencySetting*/ null, /*VATSetting*/ null, /*VATRegistrationID*/ null, /*StoreCCInDB*/ null, /*IsRegistered*/ null, /*LockedUntil*/ null, /*AdminCanViewCC*/ null, /*BadLogin*/ 1, /*Active*/ null, /*PwdChangeRequired*/ null, /*RegisterDate*/ null, /*StoreId*/ null ); } Security.LogEvent("Store Login Failed", "Attempted login failed for email address " + EMailField, 0, 0, 0); return; } } } }
public ResetPassword() { InitializeComponent(); I18NUtil.SetLanguage(Resources, @"ResetPassword"); OldPassword.Focus(); }
public ResetPassword() { InitializeComponent(); LoadLanguage(); OldPassword.Focus(); }
private void Button1_Click(System.Object sender, System.EventArgs e) { try { int RowsAffected = 0; if (Strings.Len(Strings.Trim(cmbUserType.Text)) == 0) { MessageBox.Show("Please select user type", "Input Error", MessageBoxButtons.OK, MessageBoxIcon.Error); cmbUserType.Focus(); return; } if (Strings.Len(Strings.Trim(UserName.Text)) == 0) { MessageBox.Show("Please enter user name", "Input Error", MessageBoxButtons.OK, MessageBoxIcon.Error); UserName.Focus(); return; } if (Strings.Len(Strings.Trim(OldPassword.Text)) == 0) { MessageBox.Show("Please enter old password", "Input Error", MessageBoxButtons.OK, MessageBoxIcon.Error); OldPassword.Focus(); return; } if (Strings.Len(Strings.Trim(NewPassword.Text)) == 0) { MessageBox.Show("Please enter new password", "Input Error", MessageBoxButtons.OK, MessageBoxIcon.Error); NewPassword.Focus(); return; } if (Strings.Len(Strings.Trim(ConfirmPassword.Text)) == 0) { MessageBox.Show("Please confirm new password", "Input Error", MessageBoxButtons.OK, MessageBoxIcon.Error); ConfirmPassword.Focus(); return; } if (NewPassword.TextLength < 5) { MessageBox.Show("The New Password Should be of Atleast 5 Characters", "Input Error", MessageBoxButtons.OK, MessageBoxIcon.Error); NewPassword.Text = ""; ConfirmPassword.Text = ""; NewPassword.Focus(); return; } else if (NewPassword.Text != ConfirmPassword.Text) { MessageBox.Show("Password do not match", "Input error", MessageBoxButtons.OK, MessageBoxIcon.Error); NewPassword.Text = ""; OldPassword.Text = ""; ConfirmPassword.Text = ""; OldPassword.Focus(); return; } else if (OldPassword.Text == NewPassword.Text) { MessageBox.Show("Password is same..Re-enter new password", "Input error", MessageBoxButtons.OK, MessageBoxIcon.Error); NewPassword.Text = ""; ConfirmPassword.Text = ""; NewPassword.Focus(); return; } con = new OleDbConnection(ck); con.Open(); string co = "update Registration set user_password = '******'where username='******' and user_password = '******' and usertype='" + cmbUserType.Text + "'"; cmd = new OleDbCommand(co); cmd.Connection = con; RowsAffected = cmd.ExecuteNonQuery(); if (RowsAffected > 0) { MessageBox.Show("Successfully changed", "Password", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Hide(); My.MyProject.Forms.Frmlogin.Show(); My.MyProject.Forms.Frmlogin.cmbUserType.Text = ""; My.MyProject.Forms.Frmlogin.txtUsername.Text = ""; My.MyProject.Forms.Frmlogin.txtPassword.Text = ""; My.MyProject.Forms.Frmlogin.cmbUserType.Focus(); } else { MessageBox.Show("invalid user name or password", "input error", MessageBoxButtons.OK, MessageBoxIcon.Error); UserName.Text = ""; NewPassword.Text = ""; OldPassword.Text = ""; ConfirmPassword.Text = ""; UserName.Focus(); } con.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public Repass() { InitializeComponent(); model = new BAZANOWEntities(); OldPassword.Focus(); }