diff options
author | Jean Michel-Lemieux | 2004-04-14 19:22:00 +0000 |
---|---|---|
committer | Jean Michel-Lemieux | 2004-04-14 19:22:00 +0000 |
commit | f468be41b78d48d05b4c77408389eb788923f926 (patch) | |
tree | 260af7d3eba13713a2ec78262fb9d4ab15da16ab | |
parent | 33efc21049605ec29f12723ee3d2834377c227a2 (diff) | |
download | eclipse.platform.team-f468be41b78d48d05b4c77408389eb788923f926.tar.gz eclipse.platform.team-f468be41b78d48d05b4c77408389eb788923f926.tar.xz eclipse.platform.team-f468be41b78d48d05b4c77408389eb788923f926.zip |
Allow caller to ommit cvs location when prompting for a password. This will
allow the prompt to ommit certain elements and make the dialog cleaner.
4 files changed, 13 insertions, 11 deletions
diff --git a/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/JSchSession.java b/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/JSchSession.java index b592b41ba..9a48347e6 100644 --- a/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/JSchSession.java +++ b/bundles/org.eclipse.team.cvs.ssh2/src/org/eclipse/team/internal/ccvs/ssh2/JSchSession.java @@ -79,7 +79,7 @@ class JSchSession { ); return prompt == 0; } - private String promptSecret(String message) throws CVSException{ + private String promptSecret(String message, boolean includeLocation) throws CVSException{ IUserAuthenticator authenticator = location.getUserAuthenticator(); final String[] _password = new String[1]; IUserInfo info = new IUserInfo() { @@ -95,12 +95,12 @@ class JSchSession { public void setUsername(String username) { } }; - authenticator.promptForUserInfo(location, info, message); + authenticator.promptForUserInfo(includeLocation ? location : null, info, message); return _password[0]; } public boolean promptPassphrase(String message) { try{ - String _passphrase=promptSecret(message); + String _passphrase=promptSecret(message, false); if(_passphrase!=null){ passphrase=_passphrase; } @@ -112,7 +112,7 @@ class JSchSession { } public boolean promptPassword(String message) { try{ - String _password=promptSecret(message); + String _password=promptSecret(message, true); if(_password!=null){ password=_password; // Cache the password with the repository location on the memory. diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/UserValidationDialog.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/UserValidationDialog.java index 3c587adff..2d6aa8025 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/UserValidationDialog.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/UserValidationDialog.java @@ -102,8 +102,6 @@ public class UserValidationDialog extends Dialog { Composite main = new Composite(top, SWT.NONE); layout = new GridLayout(); layout.numColumns = 3; - layout.marginHeight = 0; - layout.marginHeight = 0; main.setLayout(layout); main.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); @@ -139,7 +137,7 @@ public class UserValidationDialog extends Dialog { createUsernameFields(main); createPasswordFields(main); - if(showAllowCachingButton) { + if(domain != null && showAllowCachingButton) { allowCachingButton = new Button(main, SWT.CHECK); allowCachingButton.setText(Policy.bind("UserValidationDialog.6")); //$NON-NLS-1$ data = new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL); diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/WorkbenchUserAuthenticator.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/WorkbenchUserAuthenticator.java index c3559c86b..469adc2c9 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/WorkbenchUserAuthenticator.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/WorkbenchUserAuthenticator.java @@ -77,11 +77,15 @@ public class WorkbenchUserAuthenticator implements IUserAuthenticator { if (userinfo.isUsernameMutable()) { userinfo.setUsername(result[0]); - location.setUsername(result[0]); + } userinfo.setPassword(result[1]); - location.setPassword(result[1]); - location.setAllowCaching(allowCaching[0]); + + if(location != null) { + location.setUsername(result[0]); + location.setPassword(result[1]); + location.setAllowCaching(allowCaching[0]); + } } /** diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties index 2eec0044b..8e1ac1622 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties @@ -15,7 +15,7 @@ PasswordManagementPreferencePage.5=&Remove PasswordManagementPreferencePage.6=Remove &All UserValidationDialog.5=CVS Repository: UserValidationDialog.6=&Save Password -UserValidationDialog.7=Saved passwords are not secure when saved to disk. To protect the security of your passwords and data, use SSH key pairs for authentication or don't save the password. +UserValidationDialog.7=Saved passwords are stored on your computer in a file that's difficult, but not impossible, for an intruder to read. details=Press the details button for more information. simpleInternal=Internal error internal=An internal error has occurred, consult the error log for details. |