diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemClearPasswordAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemClearPasswordAction.java index 060b6342ed8..b007c34d74d 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemClearPasswordAction.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemClearPasswordAction.java @@ -71,24 +71,10 @@ public class SystemClearPasswordAction extends SystemBaseAction ISubSystem ss = (ISubSystem)getFirstSelection(); try { IConnectorService system = ss.getConnectorService(); - - // get the user id - String userId = system.getUserId(); - - // clear userid/password from memory and fire event - //DKM and disk now system.clearPasswordCache(true); RSEUIPlugin.getTheSystemRegistry().fireEvent(new SystemResourceChangeEvent(ss, ISystemResourceChangeEvents.EVENT_PROPERTY_CHANGE, ss.getHost())); - - /* DKM - this is now done in clearPasswordCache - * - // now get rid of userid/password from disk - String systemType = ss.getSystem().getSystemType(); - String hostName = system.getHostName(); - PasswordPersistenceManager.getInstance().remove(systemType, hostName, userId); - */ } catch (Exception exc) { // msg already shown diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemPasswordPromptDialog.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemPasswordPromptDialog.java index 384569732f4..c0a37810241 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemPasswordPromptDialog.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/dialogs/SystemPasswordPromptDialog.java @@ -237,7 +237,6 @@ public final class SystemPasswordPromptDialog extends SystemPromptDialog impleme protected Control getInitialFocusControl() { okButton.setEnabled(true); processUserIdField(); - processPasswordField(); if (textUserId != null) { if (userId.length() == 0 || textPassword == null) { return textUserId; @@ -311,14 +310,15 @@ public final class SystemPasswordPromptDialog extends SystemPromptDialog impleme * @see #setUserIdValidator(ISystemValidator) */ private void processUserIdField() { - internalGetUserId(); - internalGetPassword(); + clearErrorMessage(); SystemMessage m = checkUserId(); if (m == null) { m = checkPassword(); } + if (m != null) { + setErrorMessage(m); + } okButton.setEnabled(m == null); - setErrorMessage(m); if (userId == null || originalUserId == null) { userIdChanged = (userId != originalUserId); } else { @@ -335,6 +335,7 @@ public final class SystemPasswordPromptDialog extends SystemPromptDialog impleme * @return the message returned by the validator or null. */ private SystemMessage checkUserId() { + internalGetUserId(); SystemMessage m = null; if (connectorService.supportsUserId() && validate) { if (userIdValidator != null) { @@ -354,14 +355,15 @@ public final class SystemPasswordPromptDialog extends SystemPromptDialog impleme * @see #setPasswordValidator(ISystemValidator) */ private void processPasswordField() { - internalGetUserId(); - internalGetPassword(); + clearErrorMessage(); SystemMessage m = checkPassword(); if (m == null) { m = checkUserId(); } + if (m != null) { + setErrorMessage(m); + } okButton.setEnabled(m == null); - setErrorMessage(m); if (savePasswordCB != null) { savePasswordCB.setEnabled(!(connectorService.requiresPassword() && password.length() == 0)); } @@ -371,6 +373,7 @@ public final class SystemPasswordPromptDialog extends SystemPromptDialog impleme * Checks the value of the password instance variable. */ private SystemMessage checkPassword() { + internalGetPassword(); SystemMessage m = null; if (connectorService.supportsPassword() && validate) { if (passwordValidator != null) { diff --git a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/AbstractConnectorService.java b/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/AbstractConnectorService.java index 3a95715ab4b..0de1cc8e686 100644 --- a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/AbstractConnectorService.java +++ b/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/AbstractConnectorService.java @@ -338,22 +338,21 @@ public abstract class AbstractConnectorService extends RSEModelObject implements * change his userId. * * @param onDisk if this is true, clear the password from the disk cache as well - * @see #clearUserIdCache(boolean) + * @see #clearUserIdCache() */ final public void clearPasswordCache(boolean onDisk) { setPasswordInformation(null); - + String userId = getUserId(); if (onDisk) { // now get rid of userid/password from disk String systemType = getHostType(); String hostName = getHostName(); - if (_userId != null) - PasswordPersistenceManager.getInstance().remove(systemType, hostName, _userId); + if (userId != null) + PasswordPersistenceManager.getInstance().remove(systemType, hostName, userId); } - if (shareUserPasswordWithConnection()) { // clear this uid/password with other ISystems in connection - clearPasswordForOtherSystemsInConnection(_userId, onDisk); + clearPasswordForOtherSystemsInConnection(userId, onDisk); } } @@ -533,6 +532,7 @@ public abstract class AbstractConnectorService extends RSEModelObject implements logException(e); } if (dialog.wasCancelled()) { + _passwordInfo = null; throw new InterruptedException(); } String userId = dialog.getUserId();