public static void userMenu() { while (adminIsAuthenticated) { int menu = userMenuScreen(); switch (menu) { case 1: miscOut("Game List: "); ArrayList<Game> gameList = Logic.getGames(DatabaseWrapper.ALL_GAMES, 0); listGames(gameList); break; case 2: miscOut("User List: "); ArrayList<User> userList = Logic.getUsers(); listUsers(userList); break; case 3: miscOut("Create User: "******"Delete User: "******"You Logged Out."); adminIsAuthenticated = false; break; default: miscOut("Unassigned key."); break; } } }
public static void login() { miscOut("Please log in."); HashMap<String, Integer> hashMap = Logic.authenticateUser(enterUsername(), Security.hashing(enterPassword())); if (hashMap.get("usertype") == 1) { hashMap.put("code", 0); } int code = hashMap.get("code"); if (code == 0) miscOut("User does not exist."); else if (code == 1) { miscOut("Wrong password."); } else if (code == 2) { miscOut("Success."); adminIsAuthenticated = true; userMenu(); } }
public static int deleteUserScreen() { listUsers(Logic.getUsers()); System.out.print("Type id on the user you wish to delete: "); return input.nextInt(); }