summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/LoginDialog.java56
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationService.java2
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationServiceImpl.java14
3 files changed, 40 insertions, 32 deletions
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/LoginDialog.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/LoginDialog.java
index b6e5091..fc601a8 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/LoginDialog.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/LoginDialog.java
@@ -150,28 +150,36 @@ public class LoginDialog extends JDialog {
IdropConfigurationService.ACCOUNT_CACHE_USER_NAME);
txtUserName.setText(username);
-
+
String save = idropCore.getIdropConfig().getPropertyForKey(IdropConfigurationService.ACCOUNT_CACHE_USER_SAVE_PASS);
boolean saveP = "true".equals(save);
+ boolean autoGsi = false;
+ String gsi = idropCore.getIdropConfig().getPropertyForKey(IdropConfigurationService.ACCOUNT_CACHE_USER_AUTO_GSI);
+ autoGsi = "true".equals(gsi);
+
+ hideAdvancedViewFields();
+ hideProxyLoginFields();
+
+ if(autoGsi){
+ hideNormalLoginFields();
+ showProxyLoginFields();
+ chkProxyLogin.setSelected(true);
+ String gsiMode = idropCore.getIdropConfig().getPropertyForKey(IdropConfigurationService.ACCOUNT_CACHE_CERT_LOGIN_MODE);
+ try{
+ int gsiModeNum = Integer.parseInt(gsiMode);
+ setSelectedModeFields(gsiModeNum);
+ showProxyChoosenModeFields();
+ }catch(Exception e){
+ }
+ }
+
if (saveP) {
String savedPassword = idropCore.getIdropConfig().getPropertyForKey(IdropConfigurationService.ACCOUNT_CACHE_USER_PASSWORD);
password.setText(savedPassword);
chkRememberPass.setSelected(true);
-
- String gsi = idropCore.getIdropConfig().getPropertyForKey(IdropConfigurationService.ACCOUNT_CACHE_USER_AUTO_GSI);
- boolean autoGsi = "true".equals(gsi);
- chkProxyLogin.setSelected(autoGsi);
-
+
loginTrialSuccesful = !processLogin();
}
-
- hideAdvancedViewFields();
- hideProxyLoginFields();
- showProxyChoosenModeFields();
- if(getSelectedModeFieldNum() != -1){
- hideNormalLoginFields();
- showProxyLoginFields();
- }
}
private void loginUsingPreset() {
@@ -350,24 +358,34 @@ public class LoginDialog extends JDialog {
idropCore.setIrodsAccount(authResponse
.getAuthenticatedIRODSAccount());
try {
- idropCore.getIdropConfigurationService()
- .saveLogin(irodsAccount, chkRememberPass.isSelected());
-
+ idropCore.getIdropConfigurationService().saveLogin(irodsAccount);
+ if(chkRememberPass.isSelected()){
+ idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.ACCOUNT_CACHE_USER_PASSWORD,
+ irodsAccount.getPassword());
+ idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.ACCOUNT_CACHE_USER_SAVE_PASS,
+ "true");
+ }else{
+ idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.ACCOUNT_CACHE_USER_PASSWORD,
+ "");
+ idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.ACCOUNT_CACHE_USER_SAVE_PASS,
+ "false");
+ }
idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.ACCOUNT_CACHE_PROXY_LOCATION, txtProxy.getText());
idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.ACCOUNT_CACHE_CERTIFICATES_LOCATION, txtCerts.getText());
if (chkProxyLogin.isSelected()) {
idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.ACCOUNT_CACHE_USER_AUTO_GSI, "true");
+ idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.ACCOUNT_CACHE_CERT_LOGIN_MODE, "" + getSelectedModeFieldNum());
} else {
idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.ACCOUNT_CACHE_USER_AUTO_GSI, "false");
+ idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.ACCOUNT_CACHE_CERT_LOGIN_MODE, "-1");
}
// Save in properties: paths to certificates, key and gsi mode
idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.ACCOUNT_CACHE_CERT_PEM_LOCATION, txtPEMCertificateLocation.getText());
idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.ACCOUNT_CACHE_KEY_PEM_LOCATION, txtKeyLocation.getText());
idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.ACCOUNT_CACHE_CERT_P12_LOCATION, txtP12CertificateLocation.getText());
- idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.ACCOUNT_CACHE_CERT_LOGIN_MODE, "" + getSelectedModeFieldNum());
-
+
//todo save proxy path and certificates location
} catch (IdropException ex) {
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationService.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationService.java
index 108f74f..d9251fd 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationService.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationService.java
@@ -100,7 +100,7 @@ public interface IdropConfigurationService {
* {@link IRODSAccount} to be cached
* @throws IdropException
*/
- void saveLogin(final IRODSAccount irodsAccount, boolean savePassword) throws IdropException;
+ void saveLogin(final IRODSAccount irodsAccount) throws IdropException;
void removeConfigProperty(final String key) throws IdropException;
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationServiceImpl.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationServiceImpl.java
index 264f361..cd23864 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationServiceImpl.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationServiceImpl.java
@@ -250,7 +250,7 @@ public class IdropConfigurationServiceImpl implements IdropConfigurationService
}
@Override
- public void saveLogin(final IRODSAccount irodsAccount, boolean savePassword)
+ public void saveLogin(final IRODSAccount irodsAccount)
throws IdropException {
log.info("save login");
if (irodsAccount == null) {
@@ -272,17 +272,7 @@ public class IdropConfigurationServiceImpl implements IdropConfigurationService
irodsAccount.getUserName());
updateConfig(IdropConfigurationService.ACCOUNT_CACHE_LOGIN_MODE,
irodsAccount.getAuthenticationScheme().name());
- if(savePassword){
- updateConfig(IdropConfigurationService.ACCOUNT_CACHE_USER_PASSWORD,
- irodsAccount.getPassword());
- updateConfig(IdropConfigurationService.ACCOUNT_CACHE_USER_SAVE_PASS,
- "true");
- }else{
- updateConfig(IdropConfigurationService.ACCOUNT_CACHE_USER_PASSWORD,
- "");
- updateConfig(IdropConfigurationService.ACCOUNT_CACHE_USER_SAVE_PASS,
- "false");
- }
+
log.info("config updated");
}