1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 import Exceptions.AccessException;
21 import Utilities.DbInt;
22 import javafx.application.Application;
23 import javafx.stage.Stage;
24 import javafx.util.Pair;
25
26 import java.util.Map;
27
28 @SuppressWarnings("UseOfSystemOutOrSystemErr")
29 public class addFlyWay extends Application {
30 public static void main(String[] args) { launch(args); }
31
32 @Override
33 public void start(final Stage stage) {
34 Map<String, String> params = getParameters().getNamed();
35 if (params.containsKey("username") && params.containsKey("password")) {
36 if (!DbInt.verifyLoginAndUser(new Pair<>(params.get("username"), params.get("password")))) {
37 System.out.println("Error Logging in");
38 System.exit(0);
39
40 }
41
42 }
43 DbInt.getDatabses().forEach((db) -> {
44 try {
45 DbInt.baselineDatabse(db);
46 } catch (AccessException ignored) {
47 System.out.println("You must be admin");
48 System.exit(0);
49 }
50 });
51 System.exit(0);
52
53 }
54 }