From c27d50c575ff5867aef8f10ccf2b5f2ac43dae08 Mon Sep 17 00:00:00 2001 From: Nino Breuer Date: Fri, 28 Nov 2014 16:07:58 +0100 Subject: • changed implementation of user authentication. • changed position of class file • fixed some little things (not necessary to mention) Important Notes: •organizationID in token returns "wrong" values, therefore university is still set by client. To be fixed someday. • userID is the value with which the user starts his log in. this value is not represented in the token! (as it is not(!) the email). To be implemented someday, as this value is represented in the masterserver. • Feature isn't well tested. --- .../src/main/java/gui/intro/MainMenue_GUI.java | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'dozentenmodul/src/main/java/gui/intro/MainMenue_GUI.java') diff --git a/dozentenmodul/src/main/java/gui/intro/MainMenue_GUI.java b/dozentenmodul/src/main/java/gui/intro/MainMenue_GUI.java index bd69571e..01b4aaeb 100644 --- a/dozentenmodul/src/main/java/gui/intro/MainMenue_GUI.java +++ b/dozentenmodul/src/main/java/gui/intro/MainMenue_GUI.java @@ -58,6 +58,7 @@ import models.person; import org.apache.log4j.Logger; import org.apache.thrift.TException; +import server.generated.Server.Client; import util.GuiOrganizer; import util.News; import util.OpenLinks; @@ -84,6 +85,8 @@ public class MainMenue_GUI extends JFrame { private final ButtonGroup buttonGroup = new ButtonGroup(); private JMenuItem mntmAbout; Component c = null; + + Client client = models.Client.clientcon.getClient(); @@ -94,7 +97,7 @@ public class MainMenue_GUI extends JFrame { // for testing ImageRights imageRights = new ImageRights(); - + boolean tokenDeleted; public MainMenue_GUI(Component formerGUI) { @@ -102,7 +105,18 @@ public class MainMenue_GUI extends JFrame { addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent arg0) { - System.exit(0); + try { + tokenDeleted = client.setSessionInvalid(SessionData.session.getAuthToken()); + } catch (TException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + if(tokenDeleted) + { + System.out.println("test"); + System.exit(0); + } + } }); try { -- cgit v1.2.3-55-g7522