Author: xcoulon
Date: 2012-05-16 05:26:23 -0400 (Wed, 16 May 2012)
New Revision: 41046
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPageModel.java
Log:
Fixed - JBIDE-10845 Application configuration UI issues JBIDE-10850
loading cartridges could be cached after shown first page
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPageModel.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPageModel.java 2012-05-16
09:20:44 UTC (rev 41045)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPageModel.java 2012-05-16
09:26:23 UTC (rev 41046)
@@ -184,12 +184,20 @@
IStatus status = Status.OK_STATUS;
UserDelegate user = null;
try {
- user = new UserDelegate(UserModel.getDefault().createUser(rhLogin, password),
rememberPassword, password != null);
- if (user.isValid()) {
- storeUser(user);
+ // reuse previous user if it was properly logged in
+ user = UserModel.getDefault().findUser(rhLogin);
+ // check user credentials if not logged before or if input password changed
+ if(user != null && user.getPassword().equals(password)) {
+ wizardModel.setUser(user);
} else {
- status = OpenShiftUIActivator.createErrorStatus(
- NLS.bind("The credentials for user {0} are not valid",
user.getRhlogin()));
+ user = new UserDelegate(UserModel.getDefault().createUser(rhLogin, password),
rememberPassword,
+ password != null);
+ if (user.isValid()) {
+ storeUser(user);
+ } else {
+ status = OpenShiftUIActivator.createErrorStatus(NLS.bind(
+ "The credentials for user {0} are not valid", user.getRhlogin()));
+ }
}
} catch (NotFoundOpenShiftException e) {
// valid user without domain