summaryrefslogtreecommitdiffstats
path: root/Dozentenmodul/src/GUI/Login_GUI.java
diff options
context:
space:
mode:
Diffstat (limited to 'Dozentenmodul/src/GUI/Login_GUI.java')
-rw-r--r--Dozentenmodul/src/GUI/Login_GUI.java57
1 files changed, 50 insertions, 7 deletions
diff --git a/Dozentenmodul/src/GUI/Login_GUI.java b/Dozentenmodul/src/GUI/Login_GUI.java
index c982fa7b..990500db 100644
--- a/Dozentenmodul/src/GUI/Login_GUI.java
+++ b/Dozentenmodul/src/GUI/Login_GUI.java
@@ -18,9 +18,17 @@ import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JPasswordField;
+
+import org.ini4j.InvalidFileFormatException;
+import org.ini4j.Wini;
+
+import config.config_file;
+
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.SystemColor;
+import java.io.File;
+import java.io.IOException;
@SuppressWarnings("serial")
@@ -29,7 +37,7 @@ public class Login_GUI extends JFrame {
private JPanel contentPane;
private JTextField username;
private JPasswordField pass;
-
+
/**
* Launch the application.
*/
@@ -37,9 +45,22 @@ public class Login_GUI extends JFrame {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
+
+ config_file cf=new config_file();
+ boolean conf=cf.createConfig();
+ if(conf==true)
+ {
//Aufruf und Anzeige des Login Fensters
Login_GUI frame = new Login_GUI();
frame.setVisible(true);
+ }
+ else
+ {
+ JOptionPane.showMessageDialog(null,
+ "Fehler beim erzeugen der Konfigurationsfile", "Message",
+ JOptionPane.ERROR_MESSAGE);
+ }
+
} catch (Exception e) {
e.printStackTrace();
}
@@ -126,12 +147,34 @@ public class Login_GUI extends JFrame {
if(login==true)
{
-
- //Erstellen einer Instanz der Aktionsauswahl
- BillOfRights_GUI re=new BillOfRights_GUI();
- re.setVisible(true);
- //Schließen des Fensters nach erfolgreichen Login
- setVisible(false);
+ try {
+ Wini ini=new Wini(new File("C:\\Users\\"+System.getProperty("user.name")+"\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini"));
+ if(ini.get("main", "BillOfRights",boolean.class)==false){
+ //Erstellen einer Instanz der Aktionsauswahl
+ BillOfRights_GUI re=new BillOfRights_GUI();
+ re.setVisible(true);
+ //Schließen des Fensters nach erfolgreichen Login
+ setVisible(false);
+ }
+ else
+ {
+ if(ini.get("main", "vmware",boolean.class)==false){
+ VmWareLink_GUI vm=new VmWareLink_GUI();
+ vm.setVisible(true);
+ setVisible(false);
+ }
+ else
+ {
+ MainMenue_GUI main=new MainMenue_GUI();
+ main.setVisible(true);
+ setVisible(false);
+ }
+ }
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
}
else
{