From 1b8736d37a2672c83f02ce73916dc12da94013ac Mon Sep 17 00:00:00 2001 From: Justin Anderson Date: Wed, 29 Oct 2008 21:14:39 +0000 Subject: [PATCH] Clear auth prompt on success or cancel. Leave change password fields filled in when password is incorrect, to save user from reentering new password ticket: 6221 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20939 dc483132-0cff-0310-8789-dd5450dbe970 --- src/kim/agent/mac/AuthenticationController.h | 2 ++ src/kim/agent/mac/AuthenticationController.m | 24 ++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/src/kim/agent/mac/AuthenticationController.h b/src/kim/agent/mac/AuthenticationController.h index b443d8a73..ba0b21223 100644 --- a/src/kim/agent/mac/AuthenticationController.h +++ b/src/kim/agent/mac/AuthenticationController.h @@ -114,5 +114,7 @@ - (void) swapView: (NSView *) aView; - (void) showSpinny; - (void) hideSpinny; +- (void) clearSensitiveInputs; +- (void) clearAllInputs; @end diff --git a/src/kim/agent/mac/AuthenticationController.m b/src/kim/agent/mac/AuthenticationController.m index 07449f876..8df6396fe 100644 --- a/src/kim/agent/mac/AuthenticationController.m +++ b/src/kim/agent/mac/AuthenticationController.m @@ -223,6 +223,23 @@ forKeyPath:accepting_input_keypath]; } +- (void) clearSensitiveInputs +{ + [glueController setValue:@"" + forKeyPath:prompt_response_keypath]; +} + +- (void) clearAllInputs +{ + [glueController setValue:@"" + forKeyPath:old_password_keypath]; + [glueController setValue:@"" + forKeyPath:new_password_keypath]; + [glueController setValue:@"" + forKeyPath:verify_password_keypath]; + [self clearSensitiveInputs]; +} + - (void) showEnterIdentity: (NSWindow *) parentWindow { kim_error err = KIM_NO_ERROR; @@ -288,6 +305,7 @@ forKeyPath:message_keypath]; [self hideSpinny]; + [self clearAllInputs]; [self swapView:identityView]; @@ -302,6 +320,8 @@ [self hideSpinny]; + [self clearSensitiveInputs]; + switch (type) { case kim_prompt_type_password : [self showEnterPassword: parentWindow]; break; @@ -407,6 +427,10 @@ [self hideSpinny]; + if (![[self window] isVisible]) { + [self clearAllInputs]; + } + [self swapView:changePasswordView]; [self showWithParent:parentWindow]; -- 2.26.2