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. --- .../java/gui/image/FTPSearchDownloader_GUI.java | 34 +++++++++++++++------- 1 file changed, 23 insertions(+), 11 deletions(-) (limited to 'dozentenmodul/src/main/java/gui/image/FTPSearchDownloader_GUI.java') diff --git a/dozentenmodul/src/main/java/gui/image/FTPSearchDownloader_GUI.java b/dozentenmodul/src/main/java/gui/image/FTPSearchDownloader_GUI.java index 1810f0b1..fea3ae42 100644 --- a/dozentenmodul/src/main/java/gui/image/FTPSearchDownloader_GUI.java +++ b/dozentenmodul/src/main/java/gui/image/FTPSearchDownloader_GUI.java @@ -105,12 +105,6 @@ public class FTPSearchDownloader_GUI extends JFrame implements */ public FTPSearchDownloader_GUI(Component formerGUI) { - try { - client.setTokenForSession(SessionData.session.getAuthToken()); - } catch (TException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } final Object[] options = { "Beenden", "Abbrechen" }; @@ -131,8 +125,20 @@ public class FTPSearchDownloader_GUI extends JFrame implements if (choice == 0) { try { - client.DeleteFtpUser(user.userName); + client.DeleteFtpUser(user.userName,SessionData.session.getAuthToken()); + try { + client.setSessionInvalid(SessionData.session.getAuthToken()); + } catch (TException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } con.closeThriftConnection(); + try { + client.setSessionInvalid(SessionData.session.getAuthToken()); + } catch (TException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } } catch (TException e1) { // TODO Auto-generated catch block e1.printStackTrace(); @@ -143,6 +149,12 @@ public class FTPSearchDownloader_GUI extends JFrame implements }// end if choice } else { // no download running, close window + try { + client.setSessionInvalid(SessionData.session.getAuthToken()); + } catch (TException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } System.exit(0); }// end if taskrun }// end window closing @@ -429,7 +441,7 @@ public class FTPSearchDownloader_GUI extends JFrame implements isAborted = true; // set flag try { - client.DeleteFtpUser(user.userName); + client.DeleteFtpUser(user.userName,SessionData.session.getAuthToken()); LOGGER.info("Deleted FTP user."); } catch (TException e1) { // TODO Auto-generated catch block @@ -469,7 +481,7 @@ public class FTPSearchDownloader_GUI extends JFrame implements if (choice == 0) { task.cancel(true); try { - client.DeleteFtpUser(user.userName); + client.DeleteFtpUser(user.userName,SessionData.session.getAuthToken()); } catch (TException e1) { // TODO Auto-generated catch block e1.printStackTrace(); @@ -531,12 +543,12 @@ public class FTPSearchDownloader_GUI extends JFrame implements // Klick btnDownloadStarten.setText("Bitte warten"); try { - user = client.getFtpUser(); + user = client.getFtpUser(SessionData.session.getAuthToken()); downloadFile = user.path + "/" + client.getPathOfImage(Image.image.getImageId(), - Image.image.getVersion()); + Image.image.getVersion(),SessionData.session.getAuthToken()); } catch (TException e) { // TODO Auto-generated catch block -- cgit v1.2.3-55-g7522