diff options
| author | Jonathan Bauer | 2015-07-10 14:50:23 +0200 |
|---|---|---|
| committer | Jonathan Bauer | 2015-07-10 14:50:23 +0200 |
| commit | 68686268e4d0e33f6f829f0e3fee69c7286cca3a (patch) | |
| tree | 35617235f564d98e20fdb64785928407643a2abf /dozentenmodul/src/main/java | |
| parent | [client] create session from the ServiceProviderResponse (diff) | |
| download | tutor-module-68686268e4d0e33f6f829f0e3fee69c7286cca3a.tar.gz tutor-module-68686268e4d0e33f6f829f0e3fee69c7286cca3a.tar.xz tutor-module-68686268e4d0e33f6f829f0e3fee69c7286cca3a.zip | |
[client] fix idpCombo beeing shown even though TestAccount auth method was saved
check if loginWindow.isDisposed() in populateIdpCombo() to make sure have the widgets before doing anything
Diffstat (limited to 'dozentenmodul/src/main/java')
3 files changed, 11 insertions, 11 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/authentication/EcpAuthenticator.java b/dozentenmodul/src/main/java/org/openslx/dozmod/authentication/EcpAuthenticator.java index 288a4cbc..9bbc4175 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/authentication/EcpAuthenticator.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/authentication/EcpAuthenticator.java @@ -1,13 +1,10 @@ package org.openslx.dozmod.authentication; import org.apache.log4j.Logger; -import org.apache.thrift.TException; import org.openslx.bwlp.thrift.iface.TAuthenticationException; -import org.openslx.bwlp.thrift.iface.TInvalidTokenException; import org.openslx.bwlp.thrift.iface.UserInfo; import org.openslx.dozmod.authentication.ShibbolethEcp.ReturnCode; import org.openslx.dozmod.thrift.Session; -import org.openslx.thrifthelper.ThriftManager; /** * @author Jonathan Bauer diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/authentication/TestAccountAuthenticator.java b/dozentenmodul/src/main/java/org/openslx/dozmod/authentication/TestAccountAuthenticator.java index bdb92023..0c83ad0b 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/authentication/TestAccountAuthenticator.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/authentication/TestAccountAuthenticator.java @@ -36,6 +36,7 @@ public class TestAccountAuthenticator implements Authenticator { // handle answer from server if (authResult != null && authResult.authToken != null) { + // TODO: Session.fromClientSessionData(authResult); UserInfo userInfo = null; try { userInfo = ThriftManager.getMasterClient().getUserFromToken(authResult.authToken); diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LoginWindow.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LoginWindow.java index edf7b030..f034b537 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LoginWindow.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LoginWindow.java @@ -25,7 +25,6 @@ import org.openslx.dozmod.gui.MainWindow; import org.openslx.dozmod.gui.helper.MessageType; import org.openslx.dozmod.gui.window.layout.LoginWindowLayout; import org.openslx.dozmod.thrift.OrganizationCache; -import org.openslx.dozmod.thrift.Session; import org.openslx.thrifthelper.ThriftManager; import edu.kit.scc.dei.ecplean.ECPAuthenticationException; @@ -85,14 +84,14 @@ public class LoginWindow extends LoginWindowLayout { if (savedLoginType == null) { authButtons[LOGIN_TYPE.BWIDM.getId()].setSelection(true); loginType = LOGIN_TYPE.BWIDM; + idpText.setVisible(true); + idpCombo.setVisible(true); } else { authButtons[savedLoginType.getId()].setSelection(true); loginType = savedLoginType; // enable the IDP combo only if we actually have items in it - if (idpCombo.getItemCount() > 1) { - idpText.setVisible(savedLoginType == LOGIN_TYPE.BWIDM); - idpCombo.setVisible(savedLoginType == LOGIN_TYPE.BWIDM); - } + idpText.setVisible(savedLoginType == LOGIN_TYPE.BWIDM); + idpCombo.setVisible(savedLoginType == LOGIN_TYPE.BWIDM); } } else { // default value for LOGIN_TYPE is BWIDM @@ -176,6 +175,10 @@ public class LoginWindow extends LoginWindowLayout { } public void populateIdpCombo(List<Organization> orgs) { + + // safety check to see if the login window still exists + // when this function gets called by the other thread + if (this.isDisposed()) return; // always clearup the list first idpCombo.removeAll(); @@ -211,8 +214,8 @@ public class LoginWindow extends LoginWindowLayout { // if no organization was saved, none is selected, so select the first one in the combobox if (idpCombo.getSelectionIndex() == -1) idpCombo.select(0); - // finally reenable it - idpCombo.setEnabled(true); + // finally re-enable it + if (idpCombo.isVisible()) idpCombo.setEnabled(true); } /** @@ -357,7 +360,6 @@ public class LoginWindow extends LoginWindowLayout { MainWindow.openPopup(VirtualizerNoticeWindow.class, true); getShell().dispose(); - } /** |
