public override int GetHashCode() { unchecked { int result = (UserName != null ? UserName.GetHashCode() : 0); result = (result * 397) ^ (Password != null ? Password.GetHashCode() : 0); result = (result * 397) ^ (Server != null ? Server.GetHashCode() : 0); result = (result * 397) ^ Port; result = (result * 397) ^ SavePassword.GetHashCode(); result = (result * 397) ^ FixIE.GetHashCode(); return(result); } }
} // Name public override void Execute() { Log.Debug("Resetting password for user {0}...", this.spLoad.TargetID); this.spLoad.ExecuteNonQuery(); if (string.IsNullOrWhiteSpace(this.spLoad.Email)) { Log.Warn("Resetting password for user {0} failed: no email found.", this.spLoad.TargetID); return; } // if var pu = new PasswordUtility(CurrentValues.Instance.PasswordHashCycleCount); HashedPassword hashed = pu.Generate(this.spLoad.Email, ThePassword); var sp = new SavePassword(this.spLoad, DB, Log) { Password = hashed.Password, Salt = hashed.Salt, CycleCount = hashed.CycleCount, }; sp.ExecuteNonQuery(); Log.Debug("Resetting password for user {0} complete.", this.spLoad.TargetID); AStrategy oEmailSender = null; switch (this.targetType) { case PasswordResetTarget.Customer: oEmailSender = new PasswordChanged(this.spLoad.TargetID, ThePassword); break; case PasswordResetTarget.Broker: oEmailSender = new BrokerPasswordChanged(this.spLoad.TargetID, ThePassword); break; } // switch FireToBackground(oEmailSender); } // Execute
private void OnLoginCommandExecute() { MainWindowModel mwm = Application.Current.FindResource("MainWindowModel") as MainWindowModel; if (LoginButtonText.Equals("Login")) { if (SpeedportHybridAPI.getInstance().ip.Equals(ip).Equals(false)) { SpeedportHybridAPI.getInstance().ip = ip; } bool login = SpeedportHybridAPI.getInstance().login(password); if (login.Equals(true)) { if (SavePassword.Equals(true)) { SettingsModel SettingsModel = new SettingsModel { password = password, ip = SpeedportHybridAPI.getInstance().ip }; Settings.save(SettingsModel); } else { SettingsModel SettingsModel = new SettingsModel { password = string.Empty, ip = SpeedportHybridAPI.getInstance().ip }; Settings.save(SettingsModel); } LoginFieldsVisibility = Visibility.Hidden; mwm.ButtonOverviewPageIsActive = true; mwm.ButtonDSLPageIsActive = true; mwm.ButtonLteInfoPageIsActive = true; mwm.ButtonSyslogPageIsActive = true; mwm.ButtonTR181PageIsActive = true; mwm.ButtonPhonePageIsActive = true; mwm.ButtonLanPageIsActive = true; mwm.ButtonInterfacePageIsActive = true; mwm.ButtonControlsPageIsActive = true; LoginButtonText = "Logout"; mwm.LoginButtonContent = "Logout"; } else { new Thread(() => { MessageBox.Show("Login fehlgeschlagen. Sie haben ein falsches Gerätepasswort eingegeben. Bitte versuchen Sie es erneut und achten Sie auf die korrekte Schreibweise.", "Confirmation", MessageBoxButton.OK, MessageBoxImage.Error); }).Start(); LogManager.WriteToLog("Login Failed, wrong password"); } } else { if (SpeedportHybridAPI.getInstance().logout().Equals(true)) { LogoutAction(); } } }