private void butOK_Click(object sender, System.EventArgs e) { Userod selectedUser = (Userod)listUser.SelectedItem; if (!Userods.CheckTypedPassword(textPassword.Text, selectedUser.Password)) { MsgBox.Show(this, "Incorrect password"); return; } if (RemotingClient.RemotingRole == RemotingRole.ClientWeb && selectedUser.Password == "" && textPassword.Text == "") { MsgBox.Show(this, "When using the web service, not allowed to log in with no password. A password should be added for this user."); return; } Security.CurUser = selectedUser.Copy(); if (RemotingClient.RemotingRole == RemotingRole.ClientWeb) { string password = textPassword.Text; if (Programs.UsingEcwTight()) //ecw requires hash, but non-ecw requires actual password { password = Userods.EncryptPassword(password, true); } Security.PasswordTyped = password; } if (PrefC.GetBool(PrefName.TasksCheckOnStartup)) { int taskcount = Tasks.UserTasksCount(Security.CurUser.UserNum); if (taskcount > 0) { MessageBox.Show(Lan.g(this, "There are ") + taskcount + Lan.g(this, " unread tasks on your tasklists.")); } } Plugins.HookAddCode(this, "FormLogOn.butOK_Click_end"); DialogResult = DialogResult.OK; }
///<summary>This reduces the number of places where Programs.UsingEcwTight() is called. This helps with organization. All calls within this class must pass through here. </summary> private static bool UsingEcwTight() { return(Programs.UsingEcwTight()); }