diff options
| author | Michael Wilson | 2014-10-16 15:15:39 +0200 |
|---|---|---|
| committer | Michael Wilson | 2014-10-16 15:15:39 +0200 |
| commit | a7b7e76e8e9de04a3cac681f474c1946fe000ea1 (patch) | |
| tree | 2867903d05b9eadeb66278e181a073bb9ccf5c44 /dozentenmodul/src/main/java/gui | |
| parent | fehler protokoll erweitert (diff) | |
| parent | fix NPE if no args are given & fake user info for bwIDM tests (diff) | |
| download | tutor-module-a7b7e76e8e9de04a3cac681f474c1946fe000ea1.tar.gz tutor-module-a7b7e76e8e9de04a3cac681f474c1946fe000ea1.tar.xz tutor-module-a7b7e76e8e9de04a3cac681f474c1946fe000ea1.zip | |
Merge branch 'master' of ssh://git.openslx.org/openslx-ng/tutor-module
Diffstat (limited to 'dozentenmodul/src/main/java/gui')
| -rw-r--r-- | dozentenmodul/src/main/java/gui/intro/Login_GUI.java | 48 |
1 files changed, 44 insertions, 4 deletions
diff --git a/dozentenmodul/src/main/java/gui/intro/Login_GUI.java b/dozentenmodul/src/main/java/gui/intro/Login_GUI.java index 26aac289..46851b51 100644 --- a/dozentenmodul/src/main/java/gui/intro/Login_GUI.java +++ b/dozentenmodul/src/main/java/gui/intro/Login_GUI.java @@ -68,6 +68,7 @@ public class Login_GUI extends JFrame { JCheckBox chckbxBenutzernameSpeichern; private static final String HELP_MESSAGE = ""; Component c = null; + String[] args = null; private JPanel panel; private JPanel panel_1; @@ -93,7 +94,7 @@ public class Login_GUI extends JFrame { /** * Create the frame. */ - public Login_GUI() { + public Login_GUI(String[] args) { addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent e) { @@ -101,6 +102,7 @@ public class Login_GUI extends JFrame { } }); + this.args = args; // Fenster darf nicht vergroessert werden setResizable(false); @@ -119,7 +121,6 @@ public class Login_GUI extends JFrame { // Größe setzen und mittig ausrichten setBounds(0, 0, 785, 430); - GuiOrganizer.centerGUI(this); // Erzeugen eines Panels contentPane = new JPanel(); @@ -285,7 +286,32 @@ public class Login_GUI extends JFrame { public void performLogin(final String loginType) { LOGGER.info("Trying login of type: " + loginType); + if (loginType == LOGIN_TYPE_BWLEHRPOOL) { + + if(args.length != 0 && args[0].equals("offline_mode")) + { + SessionData.session.setServerAdress("141.79.128.102"); + System.out.println("Entering in offline_mode"); + String hochschule = "testhochschule.de"; + + person.verantwortlicher.setUsername(lblusername.getText().trim()); + person.verantwortlicher.setUserID(lblusername.getText().trim()); + person.verantwortlicher.setName("Hans"); + person.verantwortlicher.setVorname("Wurst"); + person.verantwortlicher.setEMail("hans.wurst@"+hochschule); + person.verantwortlicher.setHochschule(hochschule); + person.verantwortlicher.setRole("Dozent"); + + ThriftConnection bwthrift = new ThriftConnection(); + server.generated.Server.Client bwClient = bwthrift.getThriftConnection(); + models.Client.clientcon.setClient(bwClient); + + showMainMenu(); + + } + else + { // start the authentication process against the masterserver org.openslx.imagemaster.thrift.iface.SessionData result = null; // Connect to Master @@ -331,7 +357,8 @@ public class Login_GUI extends JFrame { e.printStackTrace(); setStatus(Color.red, "Kommunikation mit Masterserver fehlgeschlagen.", - Arrays.toString(e.getStackTrace())); + null); + LOGGER.error("Thrift-communication to the masterserver failed, see trace: ", e); return; } @@ -364,7 +391,8 @@ public class Login_GUI extends JFrame { // Spaeter ueber result.getRole zum Beispiel die Rolle holen person.verantwortlicher.setRole("Dozent"); } // end bwLehrpool-Login - + } + if (loginType == LOGIN_TYPE_BWIDM) { // try the shibbo login in its own SwingWorker to avoid GUI lockups SwingWorker<Boolean, String> worker = new SwingWorker<Boolean, String>(){ @@ -401,6 +429,18 @@ public class Login_GUI extends JFrame { } }; worker.execute(); + + // now we fake the user information for testing purposes. + // TODO parse the response from the SP and set the correct user info + person.verantwortlicher.setUsername(lblusername.getText().trim()); + person.verantwortlicher.setUserID(lblusername.getText().trim()); + person.verantwortlicher.setName("Joe"); + person.verantwortlicher.setVorname("B"); + person.verantwortlicher.setEMail("spam@aol.com"); + person.verantwortlicher.setHochschule("fr-test.de"); + person.verantwortlicher.setRole("Dozent"); + SessionData.session.setServerAdress("132.230.8.199"); + } // always save to user's config file. |
