diff options
| author | Jonathan Bauer | 2014-12-01 16:31:32 +0100 |
|---|---|---|
| committer | Jonathan Bauer | 2014-12-01 16:31:32 +0100 |
| commit | 0f601d6a9f1c9caa92c57aaaf61357e466171268 (patch) | |
| tree | d40650655e622b80cde48f4309adbbb0eb425d6e /dozentenmodul/src/main/java/gui/intro/Login_GUI.java | |
| parent | [client] minor comment fixes (diff) | |
| parent | Merge branch 'master' of ssh://git.openslx.org/openslx-ng/tutor-module (diff) | |
| download | tutor-module-0f601d6a9f1c9caa92c57aaaf61357e466171268.tar.gz tutor-module-0f601d6a9f1c9caa92c57aaaf61357e466171268.tar.xz tutor-module-0f601d6a9f1c9caa92c57aaaf61357e466171268.zip | |
Merge branch 'master' of git.openslx.org:openslx-ng/tutor-module
Diffstat (limited to 'dozentenmodul/src/main/java/gui/intro/Login_GUI.java')
| -rw-r--r-- | dozentenmodul/src/main/java/gui/intro/Login_GUI.java | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/dozentenmodul/src/main/java/gui/intro/Login_GUI.java b/dozentenmodul/src/main/java/gui/intro/Login_GUI.java index 1ac62333..f11d6c6f 100644 --- a/dozentenmodul/src/main/java/gui/intro/Login_GUI.java +++ b/dozentenmodul/src/main/java/gui/intro/Login_GUI.java @@ -104,6 +104,7 @@ public class Login_GUI extends JFrame { addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent e) { + System.exit(0); } }); @@ -285,6 +286,7 @@ public class Login_GUI extends JFrame { GuiOrganizer.centerGUI(this); c = this; + }// end LoginGUI() @@ -293,8 +295,10 @@ public class Login_GUI extends JFrame { LOGGER.info("Trying login of type: " + loginType); - if (loginType == LOGIN_TYPE_BWLEHRPOOL) { - + + if (loginType == LOGIN_TYPE_BWLEHRPOOL) + { + // start the authentication process against the masterserver org.openslx.imagemaster.thrift.iface.SessionData result = null; // Connect to Master @@ -307,7 +311,7 @@ public class Login_GUI extends JFrame { LOGGER.info("Thrift client could not be initialized, is the masterserver up and running?"); return; } - + String passText = new String(lblpass.getPassword()); UserInfo user = null; // Log user in @@ -328,6 +332,7 @@ public class Login_GUI extends JFrame { LOGGER.info("Authentifizierung von '" + lblusername.getText() + "' erfolgreich."); user = client.getUserFromToken(result.authToken); authToken = result.authToken; + } catch (org.openslx.imagemaster.thrift.iface.AuthenticationException e) { setStatus( @@ -466,23 +471,28 @@ public class Login_GUI extends JFrame { server.generated.Server.Client client_2 = models.Client.clientcon.getClient(); try { - client_2.setTokenForSession(authToken); + boolean authenticated = client_2.authenticated(authToken); + + if(!authenticated) + { + //TODO message for user and deactivation of menu points, actually just system exit + System.exit(0); + } } catch (TException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } try { - String pk_institution = client_2.setInstitution(person.verantwortlicher.getHochschule()); + String pk_institution = client_2.setInstitution(person.verantwortlicher.getHochschule(),SessionData.session.getAuthToken()); //LOGGER.info("Institution of user is: "+pk_institution); - client_2.setPerson(person.verantwortlicher.getUserID(), person.verantwortlicher.getName(), person.verantwortlicher.getVorname(), person.verantwortlicher.getEMail(), pk_institution); + client_2.setPerson(person.verantwortlicher.getUserID(),SessionData.session.getAuthToken(),pk_institution); //LOGGER.info("user data, ID="+person.verantwortlicher.getUserID()+" , Name="+person.verantwortlicher.getName()+" , Vorname="+ person.verantwortlicher.getVorname()+" , E-Mail="+ person.verantwortlicher.getEMail()+" , Institution="+ pk_institution); } catch (TException e) { // TODO Auto-generated catch block e.printStackTrace(); } - // Pruefe ob Bills Of Rights schon akzeptiert wurden, // wenn nicht zeige diese an if (!Config.getBillOfRights()) { |
