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. --- .../main/java/gui/lecture/SearchLecture_GUI.java | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'dozentenmodul/src/main/java/gui/lecture/SearchLecture_GUI.java') diff --git a/dozentenmodul/src/main/java/gui/lecture/SearchLecture_GUI.java b/dozentenmodul/src/main/java/gui/lecture/SearchLecture_GUI.java index 7401dc1c..fc00997f 100644 --- a/dozentenmodul/src/main/java/gui/lecture/SearchLecture_GUI.java +++ b/dozentenmodul/src/main/java/gui/lecture/SearchLecture_GUI.java @@ -119,13 +119,7 @@ public class SearchLecture_GUI extends JFrame { * Create the dialog. */ public SearchLecture_GUI(Component formerGUI) { - - try { - client.setTokenForSession(SessionData.session.getAuthToken()); - } catch (TException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } + filters.add(RowFilter.regexFilter(".", 0)); rf = RowFilter.orFilter(filters); @@ -136,6 +130,12 @@ public class SearchLecture_GUI extends JFrame { public void windowClosing(WindowEvent arg0) { // Beendet die Anwendung nach klick auf X con.closeThriftConnection(); + try { + client.setSessionInvalid(SessionData.session.getAuthToken()); + } catch (TException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } System.exit(0); } @Override @@ -633,10 +633,10 @@ public class SearchLecture_GUI extends JFrame { // Hole eine Liste der erlaubten Images für die diese Person if(person.verantwortlicher.getRole()=="Admin"){ //get complete list - lectures = client.getLectureList(); + lectures = client.getLectureList(SessionData.session.getAuthToken()); } else { //get permitted list - lectures = client.getLectureListPermissionRead(person.verantwortlicher.getUserID()); + lectures = client.getLectureListPermissionRead(SessionData.session.getAuthToken()); } Iterator i = lectures.iterator(); @@ -675,7 +675,7 @@ public class SearchLecture_GUI extends JFrame { try { // Hole eine Liste der erlaubten Images für die diese Person //lectures = client.getLectureList(); - lectures = client.getLectureList(); + lectures = client.getLectureList(SessionData.session.getAuthToken()); Iterator i = lectures.iterator(); SimpleDateFormat in=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat out=new SimpleDateFormat("dd.MM.yyyy HH:mm:ss"); @@ -726,7 +726,7 @@ public class SearchLecture_GUI extends JFrame { SimpleDateFormat in=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat out=new SimpleDateFormat("dd.MM.yyyy HH:mm:ss"); - Map res=client.getLectureData(id); + Map res=client.getLectureData(id,SessionData.session.getAuthToken()); labelName.setText(res.get("name")); labelAktiv.setText(res.get("isActive")); labeldesc.setText(res.get("desc")); -- cgit v1.2.3-55-g7522